From d7aeb79c65338320a690b404b613f0671a65e403 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 2 Nov 2016 11:39:33 +0200 Subject: Implement missing testscript integration tests --- tests/test/script/integration/bootstrap.build | 4 -- tests/test/script/integration/testscript | 84 ++++++++++++++++----------- 2 files changed, 49 insertions(+), 39 deletions(-) delete mode 100644 tests/test/script/integration/bootstrap.build diff --git a/tests/test/script/integration/bootstrap.build b/tests/test/script/integration/bootstrap.build deleted file mode 100644 index 876be09..0000000 --- a/tests/test/script/integration/bootstrap.build +++ /dev/null @@ -1,4 +0,0 @@ -project = test -amalgamation = - -using test diff --git a/tests/test/script/integration/testscript b/tests/test/script/integration/testscript index 658a6dc..f9e89e2 100644 --- a/tests/test/script/integration/testscript +++ b/tests/test/script/integration/testscript @@ -2,42 +2,49 @@ # copyright : Copyright (c) 2014-2016 Code Synthesis Ltd # license : MIT; see accompanying LICENSE file ++mkdir build &build/ # @@ TMP ++cat <>>build/boostrap.build +project = test +amalgamation = + +using test +EOI + test.options += -q --buildfile - test.arguments = test -+mkdir build -#+cat <>>build/boostrap.build -#project = test -#amalgamation = -# -#using test -#EOI -+cp $src_base/bootstrap.build build/ - +: scrip-files +: { +touch testscript foo.test bar.test + : testscript-and-other + : $* <>EOE != 0 -./: test{../testscript ../foo} -EOI -error: both 'testscript' and other names specified for dir{./} -EOE + ./: test{../testscript ../foo} + EOI + error: both 'testscript' and other names specified for dir{./} + EOE + : other-and-testscript + : $* <>EOE != 0 -./: test{../foo ../testscript} -EOI -error: both 'testscript' and other names specified for dir{./} -EOE + ./: test{../foo ../testscript} + EOI + error: both 'testscript' and other names specified for dir{./} + EOE + : others + : $* <>EOE != 0 @@ -46,21 +53,21 @@ EOI error: working directory test/ is a file/symlink EOE -# work-dir-exists -# +: wd-exists-before +: touch foo.test &foo.test; #@@ TMP -mkdir test; #@@ Need a way to ignore/deregister cleanup. +mkdir test &!test/; $* <>EOE ./: test{foo} EOI warning: working directory test/ exists at the beginning of the test EOE -# work-dir-not-empty -# +: wd-not-empty-before +: touch foo.test &foo.test; #@@ TMP -mkdir test; #@@ Need a way to ignore/deregister cleanup. -touch test/dummy; #@@ Need a way to ignore/deregister cleanup. +mkdir test &!test/; +touch test/dummy &!test/dummy; $* <>EOE ./: test{foo} EOI @@ -68,10 +75,17 @@ warning: working directory test/ exists and is not empty at the beginning \ of the test EOE -# work-dir-not-empty-end -# -# @@ No (easy) way to test this. Maybe if the inner test creates something -# without cleanup? - --rm -f build/bootstrap.build --rmdir build/ +: wd-not-empty-after +: +: The idea here is to run a nested testscript that creates (but does not +: clean up) a file in our working directory. Note that we still have to +: remove everything after detecting the failure. +: +cat <>>foo.test; +touch ../../dummy &!../../dummy +EOI +$* <>EOE &test/*** != 0 +./: test{foo} +EOI +error: working directory test/ is not empty at the end of the test +EOE -- cgit v1.1