aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/build/script/parser+diag.test.testscript
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2020-06-03 16:38:23 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2020-06-04 14:20:33 +0300
commitd280946474568925016359be742b59fd6c000c52 (patch)
tree5b48a599c33f442867dfa32690e141883af0322d /libbuild2/build/script/parser+diag.test.testscript
parentf50d0d58c8eb659e803282e19cf15398e3a8e373 (diff)
Properly handle diag directive in build script parser
Diffstat (limited to 'libbuild2/build/script/parser+diag.test.testscript')
-rw-r--r--libbuild2/build/script/parser+diag.test.testscript57
1 files changed, 57 insertions, 0 deletions
diff --git a/libbuild2/build/script/parser+diag.test.testscript b/libbuild2/build/script/parser+diag.test.testscript
new file mode 100644
index 0000000..bb0672e
--- /dev/null
+++ b/libbuild2/build/script/parser+diag.test.testscript
@@ -0,0 +1,57 @@
+# file : libbuild2/build/script/parser+diag.test.testscript
+# license : MIT; see accompanying LICENSE file
+
+test.options += -g
+
+: name
+:
+$* test <<EOI >>EOO
+ echo abc
+ EOI
+ name: test
+ EOO
+
+: name-deduce
+:
+$* <<EOI >>EOO
+ echo abc
+ EOI
+ name: echo
+ EOO
+
+: diag
+:
+$* <<EOI >>~%EOO%
+ echo abc
+ cat abc
+ diag abc '==>' $>
+ cp abc xyz
+ EOI
+ %diag: abc ==> .+file\{driver\.\}%
+ EOO
+
+: ambiguity
+:
+{
+: name
+:
+ $* test <<EOI 2>>EOE != 0
+ echo abc
+ diag xyz
+ EOI
+ buildfile:12:1: error: both low-verbosity script diagnostics name and 'diag' builtin call
+ buildfile:10: info: script name specified here
+ EOE
+
+ : diag
+ :
+ $* <<EOI 2>>EOE != 0
+ echo abc
+ diag abc
+ cat abc
+ diag xyz
+ EOI
+ buildfile:14:1: error: multiple 'diag' builtin calls
+ buildfile:12:1: info: previous call is here
+ EOE
+}