diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2020-06-03 16:38:23 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2020-06-04 14:20:33 +0300 |
commit | d280946474568925016359be742b59fd6c000c52 (patch) | |
tree | 5b48a599c33f442867dfa32690e141883af0322d /libbuild2/build/script/parser+diag.test.testscript | |
parent | f50d0d58c8eb659e803282e19cf15398e3a8e373 (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.testscript | 57 |
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 +} |