From 2af491cc4ad0ae4064f2e858c83ed485613adafa Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 16 Dec 2016 17:29:01 +0200 Subject: Convert tests/ to subproject, initial work on cross-testing support --- tests/test/script/common.test | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) (limited to 'tests/test/script/common.test') 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 <>>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/*** -- cgit v1.1