From d52c1fb406b1cef82c5f5a28fc1804d7d99a49d8 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Thu, 17 Nov 2016 01:35:29 +0300 Subject: Add support for build2 for tests and examples --- tests/file/testscript | 241 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 241 insertions(+) create mode 100644 tests/file/testscript (limited to 'tests/file/testscript') diff --git a/tests/file/testscript b/tests/file/testscript new file mode 100644 index 0000000..3e7c18c --- /dev/null +++ b/tests/file/testscript @@ -0,0 +1,241 @@ +# file : tests/file/testscript +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# license : MIT; see accompanying LICENSE file + +# End-of-line marker. Place its expansion in here-documents after the trailing +# spaces to prevent them from being stripped by editors and to improve +# readability. +# +eol = "" + ++cat <>>empty.cli +# Empty options file. +# + +EOI ++cat <>>base.cli +-a 21 +-b 21 +EOI + +# @@ Give tests some meaningfull descriptions. +# + +: 000 +: +cat <>>test.cli; +-a 11 +-b 11 + -a 12 + + -b 12 +a +EOI +$* -a 1 --file ../empty.cli -b 1 --file ../base.cli --file test.cli b >>EOO +-a +1 +-b +1 +-a +21 +-b +21 +-a +11 +-b +11 +-a +12 +-b +12 +a +b +EOO + +: 001 +: +cat <>>test.cli; +# Empty options file. +# + +EOI +$* -a 1 -- --file test.cli b >>EOO +-a +1 +-- +--file +test.cli +b +EOO + +: 002 +: +cat <>>test.cli; +-a 11 +-b 11 +-- +--file ../base.cli +-a 12 +-b 12 +a +EOI +$* -a 1 --file test.cli --file ../empty.cli b >>EOO +-a +1 +-a +11 +-b +11 +-- +--file +../base.cli +-a +12 +-b +12 +a +--file +../empty.cli +b +EOO + +: 003 +: +$* -a 1 --file ../base.cli --file test.cli b >>EOO 2>>EOE +-a +1 +-a +21 +-b +21 +EOO +unable to open file 'test.cli' or read failure +EOE + +: 004 +: +cat <>>test.cli; +-a a"b"c +-a "abc" +-a "a"b" +-a "" +-a " abc " +-a " " +-a """ +-a "'" + +-a a'b'c +-a 'abc' +-a 'a'b' +-a '' +-a ' abc ' +-a ' ' +-a ''' +-a '"' +EOI +$* --file test.cli >>EOO +-a +a"b"c +-a +abc +-a +a"b +-a + +-a + abc $eol +-a + $eol +-a +" +-a +' +-a +a'b'c +-a +abc +-a +a'b +-a + +-a + abc $eol +-a + $eol +-a +' +-a +" +EOO + +: 005 +: +cat <>>test.cli; +-a " +EOI +$* --file test.cli 2>>EOE +unmatched quote in argument '"' +EOE + +: 006 +: +cat <>>test.cli; +-a "abc +EOI +$* --file test.cli 2>>EOE +unmatched quote in argument '"abc' +EOE + +: 007 +: +cat <>>test.cli; +-a abc" +EOI +$* --file test.cli 2>>EOE +unmatched quote in argument 'abc"' +EOE + +: 008 +: +cat <>>test.cli; +-a ' +EOI +$* --file test.cli 2>>EOE +unmatched quote in argument ''' +EOE + +: 009 +: +cat <>>test.cli; +-a 'abc +EOI +$* --file test.cli 2>>EOE +unmatched quote in argument ''abc' +EOE + +: 010 +: +cat <>>test.cli; +-a abc' +EOI +$* --file test.cli 2>>EOE +unmatched quote in argument 'abc'' +EOE + +: 011 +: +cat <>>test.cli; +-a "abc' +EOI +$* --file test.cli 2>>EOE +unmatched quote in argument '"abc'' +EOE + +: 012 +: +cat <>>test.cli; +-a 'abc" +EOI +$* --file test.cli 2>>EOE +unmatched quote in argument ''abc"' +EOE -- cgit v1.1