From 57b10c06925d0bdf6ffb38488ee908f085109e95 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Thu, 4 Jul 2019 19:12:15 +0300 Subject: Move config, dist, test, and install modules into library --- .../test/script/parser+include.test.testscript | 104 +++++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 libbuild2/test/script/parser+include.test.testscript (limited to 'libbuild2/test/script/parser+include.test.testscript') diff --git a/libbuild2/test/script/parser+include.test.testscript b/libbuild2/test/script/parser+include.test.testscript new file mode 100644 index 0000000..c86b583 --- /dev/null +++ b/libbuild2/test/script/parser+include.test.testscript @@ -0,0 +1,104 @@ +# file : libbuild2/test/script/parser+include.test.testscript +# copyright : Copyright (c) 2014-2019 Code Synthesis Ltd +# license : MIT; see accompanying LICENSE file + +: none +: +$* <=foo.testscript; +$* <>EOO +.include foo.testscript +EOI +cmd +EOO + +: multiple +: +cat <"cmd foo" >=foo.testscript; +cat <"cmd bar" >=bar.testscript; +$* <>EOO +.include foo.testscript bar.testscript +EOI +cmd foo +cmd bar +EOO + +: once +: +cat <"cmd" >=foo.testscript; +$* <>EOO +.include foo.testscript +x +.include --once foo.testscript +.include --once bar/../foo.testscript +y +.include ../once/foo.testscript +EOI +cmd +x +y +cmd +EOO + +: group-id +: +cat <=foo.testscript; +{ + x = b +} +EOI +$* -s -i <>EOO +x = a +.include foo.testscript +EOI +{ + { # 2-foo-1 + } +} +EOO + +: test-id +: +cat <=foo.testscript; +cmd +EOI +$* -s -i <>EOO +x = a +.include foo.testscript +EOI +{ + { # 2-foo-1 + cmd + } +} +EOO + +: invalid-path +: +$* <>EOE != 0 +.include "" +EOI +testscript:1:2: error: invalid testscript include path '' +EOE + +: unable-open +: +$* <>~/EOE/ != 0 +.include foo.testscript +EOI +/testscript:1:2: error: unable to read testscript foo.testscript: .+/ +EOE -- cgit v1.1