aboutsummaryrefslogtreecommitdiff
path: root/tests/test/script/common.test
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-12-16 17:29:01 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-12-16 17:29:01 +0200
commit2af491cc4ad0ae4064f2e858c83ed485613adafa (patch)
tree18010b6c7b9ef13072f6e2514fcb1bb60f38d60a /tests/test/script/common.test
parent3ab61fbc2ce25afa617ed6bb50c2f8d701beeaba (diff)
Convert tests/ to subproject, initial work on cross-testing support
Diffstat (limited to 'tests/test/script/common.test')
-rw-r--r--tests/test/script/common.test27
1 files changed, 18 insertions, 9 deletions
diff --git a/tests/test/script/common.test b/tests/test/script/common.test
index abd1faa..f58ed86 100644
--- a/tests/test/script/common.test
+++ b/tests/test/script/common.test
@@ -7,21 +7,30 @@
#
+mkdir build
-+cat <<EOI >>>build/bootstrap.build
++cat <<"EOI" >>>build/bootstrap.build
project = test
amalgamation =
using test
EOI
-# The "cat & build" setup: first cat ($c) the testscript, then run build
-# ($b) which will execute the testscript.
+# We assume the specified target if any is in out_base which would be two
+# levels up from our working directory.
#
-c = cat >>>testscript
-b = $effect($build.path) --jobs 1 --quiet --buildfile - test \
- <'./: test{testscript}' &?test/***
++if! $empty($target)
+ cat <<"EOI" >>>build/root.build
+ target = \$src_root/../../$string([name] $target)
+ test{*}: test = \$target
+ EOI
+end
-# Add extra set of quotes since this value will be "cat" (normally as $*)
-# into testscript.
+# The "cat & build" setup: first cat ($c) the testscript, then run build ($b)
+# which will execute the testscript. We have to quote stdin because of the
+# command line re-expansion.
+#
+# Note that the buildfile is clever hack that relies on the first target
+# automatically becoming dir{./}'s prerequisite.
#
-test = "'$test'"
+c = cat >>>testscript
+b = $0 --jobs 1 --quiet --buildfile - test <"'test{testscript}: \$target'" \
+&?test/***