aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-10-21 09:10:36 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-11-04 09:26:34 +0200
commit658731ac32fa2e06a9f2b1a8cfffc65090f9373e (patch)
treef20e22b9fa636d9274dfc31c2ffc3471d9cb6a70
parent89424b41ef62430a49012c5c57b1979f29029505 (diff)
Minor testscript changes
-rw-r--r--build2/test/script/script13
-rw-r--r--unit-tests/test/script/lexer/script-line.test40
-rw-r--r--unit-tests/test/script/parser/buildfile3
-rw-r--r--unit-tests/test/script/parser/command-re-parse.test2
-rw-r--r--unit-tests/test/script/parser/here-document.test2
5 files changed, 7 insertions, 53 deletions
diff --git a/build2/test/script/script b/build2/test/script/script
index 236b025..e563363 100644
--- a/build2/test/script/script
+++ b/build2/test/script/script
@@ -95,20 +95,13 @@ namespace build2
// [126, 255] range are such a special ones (see Appendix E, "Exit
// Codes With Special Meanings" in the Advanced Bash-Scripting Guide).
//
- exit_comparison comparison = exit_comparison::eq;
- uint8_t status = 0;
-
- // Required by VC which fails to initialize as aggregate a class with
- // default member initializers.
- //
- command_exit () = default;
- command_exit (exit_comparison c, uint8_t s)
- : comparison (c), status (s) {}
+ exit_comparison comparison;
+ uint8_t status;
};
struct test: command
{
- command_exit exit;
+ command_exit exit {exit_comparison::eq, 0};
};
ostream&
diff --git a/unit-tests/test/script/lexer/script-line.test b/unit-tests/test/script/lexer/script-line.test
deleted file mode 100644
index 64d7c18..0000000
--- a/unit-tests/test/script/lexer/script-line.test
+++ /dev/null
@@ -1,40 +0,0 @@
-foo != 0
-a=aaa
-foo bar <"bbb $a ccc" >ddd 2>>EOE == 2
-eee
-EOE
-foo
-bar
-$cxx.target.class
-foo = baz
-$foo
-fox = $foo-$cxx.target.class
-$fox
-$test
-$~
-$*
-$0
-test = xxx
-$0
-$*
-test.options += --foo
-$1
-$*
-test.arguments += bar
-$2
-$*
-($3 == [null])
-
-x = [uint64] 001
-foo $x
-cmd abc$(x)23
-cmd >>EOO << EOI
-foo
-$x
-bar
-EOO
-$x$x$x
-EOI
-
-y = >>
-cmd "2"$y
diff --git a/unit-tests/test/script/parser/buildfile b/unit-tests/test/script/parser/buildfile
index 56a4682..af602b1 100644
--- a/unit-tests/test/script/parser/buildfile
+++ b/unit-tests/test/script/parser/buildfile
@@ -10,6 +10,7 @@ scope prerequisite file module operation rule b-options algorithm search \
filesystem config/{utility init operation} dump types-parsers \
test/{target script/{token lexer parser script}}
-exe{driver}: cxx{driver} ../../../../build2/cxx{$src} $libs #test{testscript}
+exe{driver}: cxx{driver} ../../../../build2/cxx{$src} $libs \
+test{pre-parse expansion here-document command-re-parse}
include ../../../../build2/
diff --git a/unit-tests/test/script/parser/command-re-parse.test b/unit-tests/test/script/parser/command-re-parse.test
index 956052d..5ea2284 100644
--- a/unit-tests/test/script/parser/command-re-parse.test
+++ b/unit-tests/test/script/parser/command-re-parse.test
@@ -3,7 +3,7 @@
#
$* <<EOI >>EOO
x = cmd \\">!\\" "'<!'"
-$x
+\$x
EOI
cmd ">!" "<!"
EOO
diff --git a/unit-tests/test/script/parser/here-document.test b/unit-tests/test/script/parser/here-document.test
index 7cfa8d4..13b070a 100644
--- a/unit-tests/test/script/parser/here-document.test
+++ b/unit-tests/test/script/parser/here-document.test
@@ -15,6 +15,6 @@ cmd <<EOF
'single'
"double"
b'o't"h"
-'single' "double"
+single double
EOF
EOO