From d280946474568925016359be742b59fd6c000c52 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Wed, 3 Jun 2020 16:38:23 +0300 Subject: Properly handle diag directive in build script parser --- libbuild2/build/script/parser+diag.test.testscript | 57 ++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 libbuild2/build/script/parser+diag.test.testscript (limited to 'libbuild2/build/script/parser+diag.test.testscript') 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 <>EOO + echo abc + EOI + name: test + EOO + +: name-deduce +: +$* <>EOO + echo abc + EOI + name: echo + EOO + +: diag +: +$* <>~%EOO% + echo abc + cat abc + diag abc '==>' $> + cp abc xyz + EOI + %diag: abc ==> .+file\{driver\.\}% + EOO + +: ambiguity +: +{ +: name +: + $* test <>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 + : + $* <>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 +} -- cgit v1.1