From a473abe80f4c42a366f0573bbbc762fa440b7fe6 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 26 Apr 2022 10:39:03 +0200 Subject: Use new cmdline type for canned command lines in {Build,Test}script --- tests/cc/preprocessed/testscript | 2 +- tests/dependency/recipe/testscript | 4 ++-- tests/recipe/buildscript/testscript | 24 ++++++++++++++++++++++++ tests/test/script/common.testscript | 4 ++-- tests/test/script/runner/expr.testscript | 2 +- 5 files changed, 30 insertions(+), 6 deletions(-) (limited to 'tests') diff --git a/tests/cc/preprocessed/testscript b/tests/cc/preprocessed/testscript index 269cafe..7946b46 100644 --- a/tests/cc/preprocessed/testscript +++ b/tests/cc/preprocessed/testscript @@ -10,7 +10,7 @@ test.arguments = config.cxx=$quote($recall($cxx.path) $cxx.config.mode, true) up # # trace: cxx::compile::apply extracting (headers|modules) from: .../obje{(test).o...} # -filter = sed -n -e \ +filter = [cmdline] sed -n -e \ \''s/^trace: cxx::compile_rule::apply: extracting ([^ ]+) from[^{]+\{([^.]+).*/\1 \2/p'\' +cat <=build/root.build diff --git a/tests/dependency/recipe/testscript b/tests/dependency/recipe/testscript index ebcdfdb..36e0489 100644 --- a/tests/dependency/recipe/testscript +++ b/tests/dependency/recipe/testscript @@ -691,7 +691,7 @@ EOE EOI $* $config_cxx <>~%EOE% - c = $cxx.path --version + c = [cmdline] $cxx.path --version alias{x}: {{ $c @@ -729,7 +729,7 @@ EOE $* <>EOE != 0 alias{x}: {{ - foo = bar + foo = [cmdline] bar $foo }} dump alias{x} diff --git a/tests/recipe/buildscript/testscript b/tests/recipe/buildscript/testscript index 910ee67..8632280 100644 --- a/tests/recipe/buildscript/testscript +++ b/tests/recipe/buildscript/testscript @@ -700,6 +700,30 @@ posix = ($cxx.target.class != 'windows') $* clean 2>- } +: canned-cmdline +: +{ + cat <=buildfile; + ./: + {{ + x = echo >| + y = [cmdline] echo >| + diag update + $x foo + $y bar + ([cmdline] $x) baz + }} + EOI + + $* >> EOO 2>>EOE + bar + baz + EOO + update + >| foo + EOE +} + : timeout : if $posix diff --git a/tests/test/script/common.testscript b/tests/test/script/common.testscript index 4469d1c..651e056 100644 --- a/tests/test/script/common.testscript +++ b/tests/test/script/common.testscript @@ -31,7 +31,7 @@ end # Note that the buildfile is clever hack that relies on the first target # automatically becoming dir{./}'s prerequisite. # -c = cat >=testscript -b = $0 --no-default-options --serial-stop --quiet --buildfile - test \ +c = [cmdline] cat >=testscript +b = [cmdline] $0 --no-default-options --serial-stop --quiet --buildfile - test \ <"'testscript{testscript}: \$target'" \ &?test/*** diff --git a/tests/test/script/runner/expr.testscript b/tests/test/script/runner/expr.testscript index 98e495f..95d4bed 100644 --- a/tests/test/script/runner/expr.testscript +++ b/tests/test/script/runner/expr.testscript @@ -20,7 +20,7 @@ true = '$* >| -o' false = '$* -s 1 >| -o' - bf = $b 2>- + bf = [cmdline] $b 2>- : true : -- cgit v1.1