aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2022-04-26 10:39:03 +0200
committerKaren Arutyunov <karen@codesynthesis.com>2022-07-07 18:08:25 +0300
commita473abe80f4c42a366f0573bbbc762fa440b7fe6 (patch)
tree6214c1d25162c2e614ed91e163011ac13091e7e3 /tests
parent900436dd83787f2cd47e7fc37f0530fc581a3e3b (diff)
Use new cmdline type for canned command lines in {Build,Test}script
Diffstat (limited to 'tests')
-rw-r--r--tests/cc/preprocessed/testscript2
-rw-r--r--tests/dependency/recipe/testscript4
-rw-r--r--tests/recipe/buildscript/testscript24
-rw-r--r--tests/test/script/common.testscript4
-rw-r--r--tests/test/script/runner/expr.testscript2
5 files changed, 30 insertions, 6 deletions
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 <<EOI >=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 <<EOI 2>>~%EOE%
- c = $cxx.path --version
+ c = [cmdline] $cxx.path --version
alias{x}:
{{
$c
@@ -729,7 +729,7 @@ EOE
$* <<EOI 2>>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 <<EOI >=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
: