From b216616363cdb99b56dfef4fda3ce313bd617e1a Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 12 Jan 2017 12:17:32 +0200 Subject: Rename script/integration to script-integration --- tests/test/buildfile | 2 +- tests/test/script-integration/buildfile | 8 ++++ tests/test/script-integration/testscript | 81 ++++++++++++++++++++++++++++++++ tests/test/script/buildfile | 2 +- tests/test/script/integration/buildfile | 5 -- tests/test/script/integration/testscript | 81 -------------------------------- 6 files changed, 91 insertions(+), 88 deletions(-) create mode 100644 tests/test/script-integration/buildfile create mode 100644 tests/test/script-integration/testscript delete mode 100644 tests/test/script/integration/buildfile delete mode 100644 tests/test/script/integration/testscript (limited to 'tests') diff --git a/tests/test/buildfile b/tests/test/buildfile index c0ea682..85ae8be 100644 --- a/tests/test/buildfile +++ b/tests/test/buildfile @@ -2,6 +2,6 @@ # copyright : Copyright (c) 2014-2017 Code Synthesis Ltd # license : MIT; see accompanying LICENSE file -d = config-test/ script/ +d = config-test/ script/ script-integration/ ./: $d file{common.test} include $d diff --git a/tests/test/script-integration/buildfile b/tests/test/script-integration/buildfile new file mode 100644 index 0000000..4249e1f --- /dev/null +++ b/tests/test/script-integration/buildfile @@ -0,0 +1,8 @@ +# file : tests/test/script-integration/buildfile +# copyright : Copyright (c) 2014-2017 Code Synthesis Ltd +# license : MIT; see accompanying LICENSE file + +# Test integration of testscript into build system. +# + +./: test{testscript} $b diff --git a/tests/test/script-integration/testscript b/tests/test/script-integration/testscript new file mode 100644 index 0000000..914ff30 --- /dev/null +++ b/tests/test/script-integration/testscript @@ -0,0 +1,81 @@ +# file : tests/test/script-integration/testscript +# copyright : Copyright (c) 2014-2017 Code Synthesis Ltd +# license : MIT; see accompanying LICENSE file + +.include ../common.test + +: script-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 + + : other-and-testscript + : + $* <>~%EOE% != 0 + ./: test{../foo ../testscript} + EOI + %error: both 'testscript' and other names specified for dir\{\.[/\\]\}% + EOE + + : others + : + $* <>~%EOE% != 0 +./: test{foo} +EOI +%error: working directory test[/\\] is a file/symlink% +EOE + +: wd-exists-before +: +touch foo.test; +mkdir test &!test/; +$* <>~%EOE% +./: test{foo} +EOI +%warning: working directory test[/\\] exists at the beginning of the test% +EOE + +: wd-not-empty-before +: +touch foo.test; +mkdir test &!test/; +touch test/dummy &!test/dummy; +$* <>~%EOE% +./: test{foo} +EOI +%warning: working directory test[/\\] exists and is not empty at the beginning of the test% +EOE + +: 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 an implicit cleanup +: cancelation is not required as the file is out of the test root directory +: scope. Also note that we still have to remove everything after detecting the +: failure. +: +cat <>>foo.test; +touch ../../dummy +EOI +$* <>~%EOE% &test/*** != 0 +./: test{foo} +EOI +%error: working directory test[/\\] is not empty at the end of the test% +EOE diff --git a/tests/test/script/buildfile b/tests/test/script/buildfile index 5bf02fb..b57c983 100644 --- a/tests/test/script/buildfile +++ b/tests/test/script/buildfile @@ -2,6 +2,6 @@ # copyright : Copyright (c) 2014-2017 Code Synthesis Ltd # license : MIT; see accompanying LICENSE file -d = builtin/ integration/ runner/ +d = builtin/ runner/ ./: $d file{common.test} include $d diff --git a/tests/test/script/integration/buildfile b/tests/test/script/integration/buildfile deleted file mode 100644 index dcaa527..0000000 --- a/tests/test/script/integration/buildfile +++ /dev/null @@ -1,5 +0,0 @@ -# file : tests/test/script/integration/buildfile -# copyright : Copyright (c) 2014-2017 Code Synthesis Ltd -# license : MIT; see accompanying LICENSE file - -./: test{testscript} $b diff --git a/tests/test/script/integration/testscript b/tests/test/script/integration/testscript deleted file mode 100644 index c09eb6c..0000000 --- a/tests/test/script/integration/testscript +++ /dev/null @@ -1,81 +0,0 @@ -# file : tests/test/script/integration/testscript -# copyright : Copyright (c) 2014-2017 Code Synthesis Ltd -# license : MIT; see accompanying LICENSE file - -.include ../../common.test - -: script-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 - - : other-and-testscript - : - $* <>~%EOE% != 0 - ./: test{../foo ../testscript} - EOI - %error: both 'testscript' and other names specified for dir\{\.[/\\]\}% - EOE - - : others - : - $* <>~%EOE% != 0 -./: test{foo} -EOI -%error: working directory test[/\\] is a file/symlink% -EOE - -: wd-exists-before -: -touch foo.test; -mkdir test &!test/; -$* <>~%EOE% -./: test{foo} -EOI -%warning: working directory test[/\\] exists at the beginning of the test% -EOE - -: wd-not-empty-before -: -touch foo.test; -mkdir test &!test/; -touch test/dummy &!test/dummy; -$* <>~%EOE% -./: test{foo} -EOI -%warning: working directory test[/\\] exists and is not empty at the beginning of the test% -EOE - -: 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 an implicit cleanup -: cancelation is not required as the file is out of the test root directory -: scope. Also note that we still have to remove everything after detecting the -: failure. -: -cat <>>foo.test; -touch ../../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