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/.gitignore | 2 + tests/build/.gitignore | 1 + tests/build/bootstrap.build | 9 ++ tests/build/root.build | 27 +++++ tests/buildfile | 7 ++ tests/ctor/buildfile | 11 ++ tests/ctor/makefile | 72 ------------ tests/erase/buildfile | 12 ++ tests/erase/makefile | 72 ------------ tests/file/base.ops | 2 - tests/file/buildfile | 13 +++ tests/file/driver.cxx | 2 +- tests/file/empty.ops | 3 - tests/file/makefile | 99 ---------------- tests/file/test-000.ops | 6 - tests/file/test-000.std | 18 --- tests/file/test-001.ops | 3 - tests/file/test-001.std | 6 - tests/file/test-002.ops | 7 -- tests/file/test-002.std | 17 --- tests/file/test-003.std | 7 -- tests/file/test-004.ops | 17 --- tests/file/test-004.std | 32 ------ tests/file/test-005.ops | 1 - tests/file/test-005.std | 1 - tests/file/test-006.ops | 1 - tests/file/test-006.std | 1 - tests/file/test-007.ops | 1 - tests/file/test-007.std | 1 - tests/file/test-008.ops | 1 - tests/file/test-008.std | 1 - tests/file/test-009.ops | 1 - tests/file/test-009.std | 1 - tests/file/test-010.ops | 1 - tests/file/test-010.std | 1 - tests/file/test-011.ops | 1 - tests/file/test-011.std | 1 - tests/file/test-012.ops | 1 - tests/file/test-012.std | 1 - tests/file/testscript | 241 +++++++++++++++++++++++++++++++++++++++ tests/headings/buildfile | 5 + tests/headings/map.cli | 15 --- tests/headings/map.html | 12 -- tests/headings/testscript | 39 +++++++ tests/inheritance/buildfile | 15 +++ tests/inheritance/makefile | 76 ------------ tests/lexer/driver.cxx | 123 -------------------- tests/lexer/makefile | 77 ------------- tests/lexer/test-000.cli | 11 -- tests/lexer/test-000.std | 12 -- tests/lexer/test-001.cli | 6 - tests/lexer/test-001.std | 6 - tests/lexer/test-002.cli | 7 -- tests/lexer/test-002.std | 8 -- tests/lexer/test-003.cli | 13 --- tests/lexer/test-003.std | 24 ---- tests/lexer/test-004.cli | 5 - tests/lexer/test-004.std | 15 --- tests/lexer/test-005.cli | 2 - tests/lexer/test-005.std | 3 - tests/lexer/test-006.cli | 16 --- tests/lexer/test-006.std | 9 -- tests/parser/driver.cxx | 46 -------- tests/parser/makefile | 94 --------------- tests/parser/test-000.cli | 5 - tests/parser/test-000.std | 0 tests/parser/test-001-base.cli | 0 tests/parser/test-001-common.cli | 1 - tests/parser/test-001.cli | 6 - tests/parser/test-001.std | 0 tests/parser/test-002.cli | 15 --- tests/parser/test-002.std | 0 tests/parser/test-003.cli | 23 ---- tests/parser/test-003.std | 0 tests/parser/test-004.cli | 8 -- tests/parser/test-004.std | 0 tests/parser/test-005.cli | 67 ----------- tests/parser/test-005.std | 0 tests/parser/test-006.cli | 16 --- tests/parser/test-006.std | 0 tests/parser/test-007-base.cli | 11 -- tests/parser/test-007.cli | 30 ----- tests/parser/test-007.std | 0 tests/specifier/buildfile | 14 +++ tests/specifier/makefile | 73 ------------ tests/toc/buildfile | 5 + tests/toc/testscript | 158 +++++++++++++++++++++++++ tests/toc/toc.cli | 57 --------- tests/toc/toc.html | 88 -------------- 89 files changed, 560 insertions(+), 1358 deletions(-) create mode 100644 tests/.gitignore create mode 100644 tests/build/.gitignore create mode 100644 tests/build/bootstrap.build create mode 100644 tests/build/root.build create mode 100644 tests/buildfile create mode 100644 tests/ctor/buildfile delete mode 100644 tests/ctor/makefile create mode 100644 tests/erase/buildfile delete mode 100644 tests/erase/makefile delete mode 100644 tests/file/base.ops create mode 100644 tests/file/buildfile delete mode 100644 tests/file/empty.ops delete mode 100644 tests/file/makefile delete mode 100644 tests/file/test-000.ops delete mode 100644 tests/file/test-000.std delete mode 100644 tests/file/test-001.ops delete mode 100644 tests/file/test-001.std delete mode 100644 tests/file/test-002.ops delete mode 100644 tests/file/test-002.std delete mode 100644 tests/file/test-003.std delete mode 100644 tests/file/test-004.ops delete mode 100644 tests/file/test-004.std delete mode 100644 tests/file/test-005.ops delete mode 100644 tests/file/test-005.std delete mode 100644 tests/file/test-006.ops delete mode 100644 tests/file/test-006.std delete mode 100644 tests/file/test-007.ops delete mode 100644 tests/file/test-007.std delete mode 100644 tests/file/test-008.ops delete mode 100644 tests/file/test-008.std delete mode 100644 tests/file/test-009.ops delete mode 100644 tests/file/test-009.std delete mode 100644 tests/file/test-010.ops delete mode 100644 tests/file/test-010.std delete mode 100644 tests/file/test-011.ops delete mode 100644 tests/file/test-011.std delete mode 100644 tests/file/test-012.ops delete mode 100644 tests/file/test-012.std create mode 100644 tests/file/testscript create mode 100644 tests/headings/buildfile delete mode 100644 tests/headings/map.cli delete mode 100644 tests/headings/map.html create mode 100644 tests/headings/testscript create mode 100644 tests/inheritance/buildfile delete mode 100644 tests/inheritance/makefile delete mode 100644 tests/lexer/driver.cxx delete mode 100644 tests/lexer/makefile delete mode 100644 tests/lexer/test-000.cli delete mode 100644 tests/lexer/test-000.std delete mode 100644 tests/lexer/test-001.cli delete mode 100644 tests/lexer/test-001.std delete mode 100644 tests/lexer/test-002.cli delete mode 100644 tests/lexer/test-002.std delete mode 100644 tests/lexer/test-003.cli delete mode 100644 tests/lexer/test-003.std delete mode 100644 tests/lexer/test-004.cli delete mode 100644 tests/lexer/test-004.std delete mode 100644 tests/lexer/test-005.cli delete mode 100644 tests/lexer/test-005.std delete mode 100644 tests/lexer/test-006.cli delete mode 100644 tests/lexer/test-006.std delete mode 100644 tests/parser/driver.cxx delete mode 100644 tests/parser/makefile delete mode 100644 tests/parser/test-000.cli delete mode 100644 tests/parser/test-000.std delete mode 100644 tests/parser/test-001-base.cli delete mode 100644 tests/parser/test-001-common.cli delete mode 100644 tests/parser/test-001.cli delete mode 100644 tests/parser/test-001.std delete mode 100644 tests/parser/test-002.cli delete mode 100644 tests/parser/test-002.std delete mode 100644 tests/parser/test-003.cli delete mode 100644 tests/parser/test-003.std delete mode 100644 tests/parser/test-004.cli delete mode 100644 tests/parser/test-004.std delete mode 100644 tests/parser/test-005.cli delete mode 100644 tests/parser/test-005.std delete mode 100644 tests/parser/test-006.cli delete mode 100644 tests/parser/test-006.std delete mode 100644 tests/parser/test-007-base.cli delete mode 100644 tests/parser/test-007.cli delete mode 100644 tests/parser/test-007.std create mode 100644 tests/specifier/buildfile delete mode 100644 tests/specifier/makefile create mode 100644 tests/toc/buildfile create mode 100644 tests/toc/testscript delete mode 100644 tests/toc/toc.cli delete mode 100644 tests/toc/toc.html (limited to 'tests') diff --git a/tests/.gitignore b/tests/.gitignore new file mode 100644 index 0000000..3381565 --- /dev/null +++ b/tests/.gitignore @@ -0,0 +1,2 @@ +driver +test.?xx diff --git a/tests/build/.gitignore b/tests/build/.gitignore new file mode 100644 index 0000000..225c27f --- /dev/null +++ b/tests/build/.gitignore @@ -0,0 +1 @@ +config.build diff --git a/tests/build/bootstrap.build b/tests/build/bootstrap.build new file mode 100644 index 0000000..904c361 --- /dev/null +++ b/tests/build/bootstrap.build @@ -0,0 +1,9 @@ +# file : tests/build/bootstrap.build +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# license : MIT; see accompanying LICENSE file + +project = # Unnamed subproject. + +using config +using dist +using test diff --git a/tests/build/root.build b/tests/build/root.build new file mode 100644 index 0000000..b503d3f --- /dev/null +++ b/tests/build/root.build @@ -0,0 +1,27 @@ +# file : tests/build/root.build +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# license : MIT; see accompanying LICENSE file + +cxx.std = 11 + +using cxx + +hxx{*}: extension = hxx +ixx{*}: extension = ixx +txx{*}: extension = txx +cxx{*}: extension = cxx + +# Load cli module. It must be available from the system or from the base +# project. Generating files with cli is a part of the tests, so distributing +# pre-generated files would be meaningless. +# +# @@ How to initialize the module to use a base project cli executable by +# default (if present and not configured to use another one)? Should it be +# assignment like 'config.cli = $out_root/../cli/cli' prior 'using config' +# in bootstrap.build, but what if it doesn't exist? +# +using cli + +# Every exe{} in this subproject is by default a test. +# +exe{*}: test = true diff --git a/tests/buildfile b/tests/buildfile new file mode 100644 index 0000000..dbb3a22 --- /dev/null +++ b/tests/buildfile @@ -0,0 +1,7 @@ +# file : tests/buildfile +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# license : MIT; see accompanying LICENSE file + +d = ctor/ erase/ file/ headings/ inheritance/ specifier/ toc/ +./: $d +include $d diff --git a/tests/ctor/buildfile b/tests/ctor/buildfile new file mode 100644 index 0000000..ce0dc03 --- /dev/null +++ b/tests/ctor/buildfile @@ -0,0 +1,11 @@ +# file : tests/ctor/buildfile +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# license : MIT; see accompanying LICENSE file + +exe{driver}: cxx{driver} {hxx ixx cxx}{test} + +cxx.poptions =+ -I$out_base + +# Generated options parser. +# +{hxx ixx cxx}{test}: cli{test} diff --git a/tests/ctor/makefile b/tests/ctor/makefile deleted file mode 100644 index d50c32d..0000000 --- a/tests/ctor/makefile +++ /dev/null @@ -1,72 +0,0 @@ -# file : tests/ctor/makefile -# author : Boris Kolpackov -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC -# license : MIT; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx -cli_tun := test.cli - -# -# -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o) $(cli_tun:.cli=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -driver := $(out_base)/driver -test := $(out_base)/.test -clean := $(out_base)/.clean - -# Build. -# -$(driver): $(cxx_obj) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) - -genf := $(cli_tun:.cli=.hxx) $(cli_tun:.cli=.ixx) $(cli_tun:.cli=.cxx) -gen := $(addprefix $(out_base)/,$(genf)) - -$(gen): $(out_root)/cli/cli -$(gen): cli := $(out_root)/cli/cli - -$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) - -# Alias for default target. -# -$(out_base)/: $(driver) - -# Test. -# -$(test): driver := $(driver) -$(test): $(driver) - $(call message,test $$1,$$1,$(driver)) - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(cli_tun:.cli=.cxx.cli.clean)) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/cxx/o-e.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(scf_root)/cli/cli-cxx.make) - -# Dependencies. -# -$(call import,$(src_root)/cli/makefile) - diff --git a/tests/erase/buildfile b/tests/erase/buildfile new file mode 100644 index 0000000..887c9d9 --- /dev/null +++ b/tests/erase/buildfile @@ -0,0 +1,12 @@ +# file : tests/erase/buildfile +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# license : MIT; see accompanying LICENSE file + +exe{driver}: cxx{driver} {hxx ixx cxx}{test} +exe{driver}: test.arguments = foo -a bar -b 123 --arg -- -b 234 + +cxx.poptions =+ -I$out_base + +# Generated options parser. +# +{hxx ixx cxx}{test}: cli{test} diff --git a/tests/erase/makefile b/tests/erase/makefile deleted file mode 100644 index ef26ed7..0000000 --- a/tests/erase/makefile +++ /dev/null @@ -1,72 +0,0 @@ -# file : tests/erase/makefile -# author : Boris Kolpackov -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC -# license : MIT; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx -cli_tun := test.cli - -# -# -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o) $(cli_tun:.cli=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -driver := $(out_base)/driver -test := $(out_base)/.test -clean := $(out_base)/.clean - -# Build. -# -$(driver): $(cxx_obj) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) - -genf := $(cli_tun:.cli=.hxx) $(cli_tun:.cli=.ixx) $(cli_tun:.cli=.cxx) -gen := $(addprefix $(out_base)/,$(genf)) - -$(gen): $(out_root)/cli/cli -$(gen): cli := $(out_root)/cli/cli - -$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) - -# Alias for default target. -# -$(out_base)/: $(driver) - -# Test. -# -$(test): driver := $(driver) -$(test): $(driver) - $(call message,test $$1,$$1 foo -a bar -b 123 --arg -- -b 234,$(driver)) - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(cli_tun:.cli=.cxx.cli.clean)) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/cxx/o-e.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(scf_root)/cli/cli-cxx.make) - -# Dependencies. -# -$(call import,$(src_root)/cli/makefile) - diff --git a/tests/file/base.ops b/tests/file/base.ops deleted file mode 100644 index 45d7696..0000000 --- a/tests/file/base.ops +++ /dev/null @@ -1,2 +0,0 @@ --a 21 --b 21 diff --git a/tests/file/buildfile b/tests/file/buildfile new file mode 100644 index 0000000..08e1017 --- /dev/null +++ b/tests/file/buildfile @@ -0,0 +1,13 @@ +# file : tests/file/buildfile +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# license : MIT; see accompanying LICENSE file + +exe{driver}: cxx{driver} {hxx ixx cxx}{test} test{testscript} + +cxx.poptions =+ -I$out_base + +# Generated options parser. +# +{hxx ixx cxx}{test}: cli{test} + +cli.options = --generate-file-scanner diff --git a/tests/file/driver.cxx b/tests/file/driver.cxx index d0b5774..16609ec 100644 --- a/tests/file/driver.cxx +++ b/tests/file/driver.cxx @@ -24,6 +24,6 @@ main (int argc, char* argv[]) } catch (const cli::exception& e) { - cout << e << endl; + cerr << e << endl; } } diff --git a/tests/file/empty.ops b/tests/file/empty.ops deleted file mode 100644 index ed080fb..0000000 --- a/tests/file/empty.ops +++ /dev/null @@ -1,3 +0,0 @@ -# Empty options file. -# - diff --git a/tests/file/makefile b/tests/file/makefile deleted file mode 100644 index 7e4df6a..0000000 --- a/tests/file/makefile +++ /dev/null @@ -1,99 +0,0 @@ -# file : tests/file/makefile -# author : Boris Kolpackov -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC -# license : MIT; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx -cli_tun := test.cli - -tests := 000 001 002 003 004 005 006 007 008 009 010 011 012 - -# -# -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o) $(cli_tun:.cli=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -driver := $(out_base)/driver -test := $(out_base)/.test -clean := $(out_base)/.clean - -# Build. -# -$(driver): $(cxx_obj) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) - -genf := $(cli_tun:.cli=.hxx) $(cli_tun:.cli=.ixx) $(cli_tun:.cli=.cxx) -gen := $(addprefix $(out_base)/,$(genf)) - -$(gen): $(out_root)/cli/cli -$(gen): cli := $(out_root)/cli/cli -$(gen): cli_options += --generate-file-scanner - -$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) - -# Alias for default target. -# -$(out_base)/: $(driver) - -# Test. -# -test_targets := $(addprefix $(out_base)/.test-,$(tests)) - -$(test): $(test_targets) -$(test_targets): driver := $(driver) - -.PHONY: $(out_base)/.test-% - -$(out_base)/.test-000: $(driver) $(src_base)/test-000.ops - $(call message,test $(out_base)/000,$(driver) -a 1 \ ---file $(src_base)/empty.ops -b 1 --file $(src_base)/base.ops \ ---file $(src_base)/test-000.ops b | diff -u $(src_base)/test-000.std -) - -$(out_base)/.test-001: $(driver) $(src_base)/test-001.ops - $(call message,test $(out_base)/001,$(driver) -a 1 -- --file \ -test-001.ops b | diff -u $(src_base)/test-001.std -) - -$(out_base)/.test-002: $(driver) $(src_base)/test-002.ops - $(call message,test $(out_base)/002,$(driver) -a 1 --file \ -$(src_base)/test-002.ops --file empty.ops b | diff -u $(src_base)/test-002.std -) - -$(out_base)/.test-003: $(driver) - $(call message,test $(out_base)/003,$(driver) -a 1 --file \ -$(src_base)/base.ops --file test-003.ops b | diff -u $(src_base)/test-003.std -) - -$(out_base)/.test-%: $(driver) $(src_base)/test-%.ops $(src_base)/test-%.std - $(call message,test $(out_base)/$*,$(driver) --file \ -$(src_base)/test-$*.ops | diff -u $(src_base)/test-$*.std -) - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(cli_tun:.cli=.cxx.cli.clean)) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/cxx/o-e.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(scf_root)/cli/cli-cxx.make) - -# Dependencies. -# -$(call import,$(src_root)/cli/makefile) - diff --git a/tests/file/test-000.ops b/tests/file/test-000.ops deleted file mode 100644 index c0462e2..0000000 --- a/tests/file/test-000.ops +++ /dev/null @@ -1,6 +0,0 @@ --a 11 --b 11 - -a 12 - - -b 12 -a diff --git a/tests/file/test-000.std b/tests/file/test-000.std deleted file mode 100644 index 392b83d..0000000 --- a/tests/file/test-000.std +++ /dev/null @@ -1,18 +0,0 @@ --a -1 --b -1 --a -21 --b -21 --a -11 --b -11 --a -12 --b -12 -a -b diff --git a/tests/file/test-001.ops b/tests/file/test-001.ops deleted file mode 100644 index ed080fb..0000000 --- a/tests/file/test-001.ops +++ /dev/null @@ -1,3 +0,0 @@ -# Empty options file. -# - diff --git a/tests/file/test-001.std b/tests/file/test-001.std deleted file mode 100644 index 8dec5e4..0000000 --- a/tests/file/test-001.std +++ /dev/null @@ -1,6 +0,0 @@ --a -1 --- ---file -test-001.ops -b diff --git a/tests/file/test-002.ops b/tests/file/test-002.ops deleted file mode 100644 index 5c728a0..0000000 --- a/tests/file/test-002.ops +++ /dev/null @@ -1,7 +0,0 @@ --a 11 --b 11 --- ---file base.ops --a 12 --b 12 -a diff --git a/tests/file/test-002.std b/tests/file/test-002.std deleted file mode 100644 index cd99b20..0000000 --- a/tests/file/test-002.std +++ /dev/null @@ -1,17 +0,0 @@ --a -1 --a -11 --b -11 --- ---file -base.ops --a -12 --b -12 -a ---file -empty.ops -b diff --git a/tests/file/test-003.std b/tests/file/test-003.std deleted file mode 100644 index 6e9a6ae..0000000 --- a/tests/file/test-003.std +++ /dev/null @@ -1,7 +0,0 @@ --a -1 --a -21 --b -21 -unable to open file 'test-003.ops' or read failure diff --git a/tests/file/test-004.ops b/tests/file/test-004.ops deleted file mode 100644 index dee1b30..0000000 --- a/tests/file/test-004.ops +++ /dev/null @@ -1,17 +0,0 @@ --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 '"' diff --git a/tests/file/test-004.std b/tests/file/test-004.std deleted file mode 100644 index b06e8b9..0000000 --- a/tests/file/test-004.std +++ /dev/null @@ -1,32 +0,0 @@ --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 -" diff --git a/tests/file/test-005.ops b/tests/file/test-005.ops deleted file mode 100644 index c9acf33..0000000 --- a/tests/file/test-005.ops +++ /dev/null @@ -1 +0,0 @@ --a " diff --git a/tests/file/test-005.std b/tests/file/test-005.std deleted file mode 100644 index 52b6e89..0000000 --- a/tests/file/test-005.std +++ /dev/null @@ -1 +0,0 @@ -unmatched quote in argument '"' diff --git a/tests/file/test-006.ops b/tests/file/test-006.ops deleted file mode 100644 index 454366d..0000000 --- a/tests/file/test-006.ops +++ /dev/null @@ -1 +0,0 @@ --a "abc diff --git a/tests/file/test-006.std b/tests/file/test-006.std deleted file mode 100644 index 903f7a7..0000000 --- a/tests/file/test-006.std +++ /dev/null @@ -1 +0,0 @@ -unmatched quote in argument '"abc' diff --git a/tests/file/test-007.ops b/tests/file/test-007.ops deleted file mode 100644 index 8012af9..0000000 --- a/tests/file/test-007.ops +++ /dev/null @@ -1 +0,0 @@ --a abc" diff --git a/tests/file/test-007.std b/tests/file/test-007.std deleted file mode 100644 index fff8f85..0000000 --- a/tests/file/test-007.std +++ /dev/null @@ -1 +0,0 @@ -unmatched quote in argument 'abc"' diff --git a/tests/file/test-008.ops b/tests/file/test-008.ops deleted file mode 100644 index 773a366..0000000 --- a/tests/file/test-008.ops +++ /dev/null @@ -1 +0,0 @@ --a ' diff --git a/tests/file/test-008.std b/tests/file/test-008.std deleted file mode 100644 index 5d74dc3..0000000 --- a/tests/file/test-008.std +++ /dev/null @@ -1 +0,0 @@ -unmatched quote in argument ''' diff --git a/tests/file/test-009.ops b/tests/file/test-009.ops deleted file mode 100644 index 6c3d5c9..0000000 --- a/tests/file/test-009.ops +++ /dev/null @@ -1 +0,0 @@ --a 'abc diff --git a/tests/file/test-009.std b/tests/file/test-009.std deleted file mode 100644 index b212446..0000000 --- a/tests/file/test-009.std +++ /dev/null @@ -1 +0,0 @@ -unmatched quote in argument ''abc' diff --git a/tests/file/test-010.ops b/tests/file/test-010.ops deleted file mode 100644 index eb33825..0000000 --- a/tests/file/test-010.ops +++ /dev/null @@ -1 +0,0 @@ --a abc' diff --git a/tests/file/test-010.std b/tests/file/test-010.std deleted file mode 100644 index 868ee9d..0000000 --- a/tests/file/test-010.std +++ /dev/null @@ -1 +0,0 @@ -unmatched quote in argument 'abc'' diff --git a/tests/file/test-011.ops b/tests/file/test-011.ops deleted file mode 100644 index 2330c9c..0000000 --- a/tests/file/test-011.ops +++ /dev/null @@ -1 +0,0 @@ --a "abc' diff --git a/tests/file/test-011.std b/tests/file/test-011.std deleted file mode 100644 index 2133ddf..0000000 --- a/tests/file/test-011.std +++ /dev/null @@ -1 +0,0 @@ -unmatched quote in argument '"abc'' diff --git a/tests/file/test-012.ops b/tests/file/test-012.ops deleted file mode 100644 index d5efe67..0000000 --- a/tests/file/test-012.ops +++ /dev/null @@ -1 +0,0 @@ --a 'abc" diff --git a/tests/file/test-012.std b/tests/file/test-012.std deleted file mode 100644 index 2e85d39..0000000 --- a/tests/file/test-012.std +++ /dev/null @@ -1 +0,0 @@ -unmatched quote in argument ''abc"' 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 diff --git a/tests/headings/buildfile b/tests/headings/buildfile new file mode 100644 index 0000000..d903d09 --- /dev/null +++ b/tests/headings/buildfile @@ -0,0 +1,5 @@ +# file : tests/headings/buildfile +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# license : MIT; see accompanying LICENSE file + +./: test{testscript} diff --git a/tests/headings/map.cli b/tests/headings/map.cli deleted file mode 100644 index cdbec38..0000000 --- a/tests/headings/map.cli +++ /dev/null @@ -1,15 +0,0 @@ -// Note that auto-headings break if we split into multiple doc strings. -// -" -\h1|Heading 1| - -\h|Heading 1.1| - -\h2|Heading 1.1.1| - -\h|Heading 1.2| - -\h2|Heading 1.2.1| - -\h1|Heading 2| -" diff --git a/tests/headings/map.html b/tests/headings/map.html deleted file mode 100644 index f08086c..0000000 --- a/tests/headings/map.html +++ /dev/null @@ -1,12 +0,0 @@ -

Heading 1

- -

Heading 1.1

- -

Heading 1.1.1

- -

Heading 1.2

- -

Heading 1.2.1

- -

Heading 2

- diff --git a/tests/headings/testscript b/tests/headings/testscript new file mode 100644 index 0000000..0c31f99 --- /dev/null +++ b/tests/headings/testscript @@ -0,0 +1,39 @@ +# file : tests/headings/testscript +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# license : MIT; see accompanying LICENSE file + +test = $effect($cli.path) + +: auto-headings +: +: Note that auto-headings break if we split into multiple doc strings. +: +cat <>>map.cli; +" +\\h1|Heading 1| + +\\h|Heading 1.1| + +\\h2|Heading 1.1.1| + +\\h|Heading 1.2| + +\\h2|Heading 1.2.1| + +\\h1|Heading 2| +" +EOI +$* --generate-html --stdout map.cli >>EOO +

Heading 1

+ +

Heading 1.1

+ +

Heading 1.1.1

+ +

Heading 1.2

+ +

Heading 1.2.1

+ +

Heading 2

+ +EOO diff --git a/tests/inheritance/buildfile b/tests/inheritance/buildfile new file mode 100644 index 0000000..0f8bbcb --- /dev/null +++ b/tests/inheritance/buildfile @@ -0,0 +1,15 @@ +# file : tests/erase/buildfile +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# license : MIT; see accompanying LICENSE file + +exe{driver}: cxx{driver} {hxx ixx cxx}{test} +exe{driver}: test.arguments = --very-long-flag -s short -i 123 --string long +exe{driver}: test.output = test.std + +cxx.poptions =+ -I$out_base + +# Generated options parser. +# +{hxx ixx cxx}{test}: cli{test} + +cli.options = --generate-description --option-length 17 diff --git a/tests/inheritance/makefile b/tests/inheritance/makefile deleted file mode 100644 index 3d99a99..0000000 --- a/tests/inheritance/makefile +++ /dev/null @@ -1,76 +0,0 @@ -# file : tests/inheritance/makefile -# author : Boris Kolpackov -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC -# license : MIT; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx -cli_tun := test.cli - -# -# -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o) $(cli_tun:.cli=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -driver := $(out_base)/driver -test := $(out_base)/.test -clean := $(out_base)/.clean - -# Build. -# -$(driver): $(cxx_obj) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) - -genf := $(cli_tun:.cli=.hxx) $(cli_tun:.cli=.ixx) $(cli_tun:.cli=.cxx) -gen := $(addprefix $(out_base)/,$(genf)) - -$(gen): $(out_root)/cli/cli -$(gen): cli := $(out_root)/cli/cli -$(gen): cli_options := --generate-description --option-length 17 - -$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) - -# Alias for default target. -# -$(out_base)/: $(driver) - -# Test. -# -$(test): driver := $(driver) -$(test): $(driver) $(src_base)/test.std - $(call message,test $$1,$$1 --very-long-flag -s short -i 123 \ ---string long >$(out_base)/test.out,$(driver)) - $(call message,,diff -u $(src_base)/test.std $(out_base)/test.out) - $(call message,,rm -f $(out_base)/test.out) - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(cli_tun:.cli=.cxx.cli.clean)) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/cxx/o-e.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(scf_root)/cli/cli-cxx.make) - -# Dependencies. -# -$(call import,$(src_root)/cli/makefile) - diff --git a/tests/lexer/driver.cxx b/tests/lexer/driver.cxx deleted file mode 100644 index a054aad..0000000 --- a/tests/lexer/driver.cxx +++ /dev/null @@ -1,123 +0,0 @@ -// file : tests/lexer/driver.cxx -// author : Boris Kolpackov -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC -// license : MIT; see accompanying LICENSE file - -#include -#include - -#include -#include - -using namespace std; - -const char* keywords[] = -{ - "source", - "include", - "namespace", - "class", - "signed", - "unsigned", - "bool", - "char", - "wchar_t", - "short", - "int", - "long", - "float", - "double" -}; - -const char* punctuation[] = { - ";", ",", ":", "::", "{", "}", /*"(", ")",*/ "=", "|"}; - -int -main (int argc, char* argv[]) -{ - if (argc != 2) - { - cerr << "usage: " << argv[0] << " file.cli" << endl; - return 1; - } - - ifstream ifs; - ifs.exceptions (ifstream::failbit | ifstream::badbit); - ifs.open (argv[1]); - - lexer l (ifs, argv[1]); - - while (true) - { - token t (l.next ()); - - switch (t.type ()) - { - case token::t_eos: - { - cout << "" << endl; - return 0; - } - case token::t_keyword: - { - cout << "keyword: " << keywords[t.keyword ()] << endl; - break; - } - case token::t_identifier: - { - cout << "identifier: " << t.identifier () << endl; - break; - } - case token::t_punctuation: - { - cout << punctuation[t.punctuation ()] << endl; - break; - } - case token::t_cxx_path_lit: - { - cout << "c++ path: " << t.literal () << endl; - break; - } - case token::t_cli_path_lit: - { - cout << "cli path: " << t.literal () << endl; - break; - } - case token::t_string_lit: - { - cout << t.literal () << endl; - break; - } - case token::t_char_lit: - { - cout << t.literal () << endl; - break; - } - case token::t_bool_lit: - { - cout << t.literal () << endl; - break; - } - case token::t_int_lit: - { - cout << t.literal () << endl; - break; - } - case token::t_float_lit: - { - cout << t.literal () << endl; - break; - } - case token::t_call_expr: - { - cout << t.expression () << endl; - break; - } - case token::t_template_expr: - { - cout << t.expression () << endl; - break; - } - } - } -} diff --git a/tests/lexer/makefile b/tests/lexer/makefile deleted file mode 100644 index 80fceb8..0000000 --- a/tests/lexer/makefile +++ /dev/null @@ -1,77 +0,0 @@ -# file : tests/lexer/makefile -# author : Boris Kolpackov -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC -# license : MIT; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx - -tests := 000 001 002 003 004 005 006 - -# -# -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -driver := $(out_base)/driver -test := $(out_base)/.test -clean := $(out_base)/.clean - -# Import. -# -$(call import,\ - $(scf_root)/import/libcutl/stub.make,\ - l: cutl.l,cpp-options: cutl.l.cpp-options) - -# Build. -# -$(driver): $(cxx_obj) $(out_root)/cli/lexer.o $(cutl.l) - -$(cxx_obj) $(cxx_od): cpp_options := -I$(src_base) -I$(src_root)/cli -$(cxx_obj) $(cxx_od): $(cutl.l.cpp-options) - -$(call include-dep,$(cxx_od)) - -# Alias for default target. -# -$(out_base)/: $(driver) - -# Test. -# -test_targets := $(addprefix $(out_base)/.test-,$(tests)) - -$(test): $(test_targets) -$(test_targets): driver := $(driver) - -.PHONY: $(out_base)/.test-% -$(out_base)/.test-%: $(driver) $(src_base)/test-%.cli $(src_base)/test-%.std - $(call message,test $(out_base)/$*,$(driver) $(src_base)/test-$*.cli | diff -u $(src_base)/test-$*.std -) - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/cxx/o-e.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/cxx-d.make) - -# Dependencies. -# -$(call import,$(src_root)/cli/makefile) diff --git a/tests/lexer/test-000.cli b/tests/lexer/test-000.cli deleted file mode 100644 index 68cf59f..0000000 --- a/tests/lexer/test-000.cli +++ /dev/null @@ -1,11 +0,0 @@ -help -help-me --h ---help ---help-me ---help-me- -/h -/help-me -/help/me ---_ - diff --git a/tests/lexer/test-000.std b/tests/lexer/test-000.std deleted file mode 100644 index 9a44438..0000000 --- a/tests/lexer/test-000.std +++ /dev/null @@ -1,12 +0,0 @@ -identifier: help -identifier: help-me -identifier: -h -identifier: --help -identifier: --help-me -identifier: --help-me- -identifier: /h -identifier: /help-me -identifier: /help -identifier: /me -identifier: --_ - diff --git a/tests/lexer/test-001.cli b/tests/lexer/test-001.cli deleted file mode 100644 index 6c2f917..0000000 --- a/tests/lexer/test-001.cli +++ /dev/null @@ -1,6 +0,0 @@ -5 -123456 --12345 -- 1 -- -123 diff --git a/tests/lexer/test-001.std b/tests/lexer/test-001.std deleted file mode 100644 index 9732d65..0000000 --- a/tests/lexer/test-001.std +++ /dev/null @@ -1,6 +0,0 @@ -5 -123456 --12345 --1 --123 - diff --git a/tests/lexer/test-002.cli b/tests/lexer/test-002.cli deleted file mode 100644 index fcd6b16..0000000 --- a/tests/lexer/test-002.cli +++ /dev/null @@ -1,7 +0,0 @@ -'a' -'\n' -'\\' -'\0' -'\'' -'\xaf' -'\111' diff --git a/tests/lexer/test-002.std b/tests/lexer/test-002.std deleted file mode 100644 index 01daa18..0000000 --- a/tests/lexer/test-002.std +++ /dev/null @@ -1,8 +0,0 @@ -'a' -'\n' -'\\' -'\0' -'\'' -'\xaf' -'\111' - diff --git a/tests/lexer/test-003.cli b/tests/lexer/test-003.cli deleted file mode 100644 index a8c2c28..0000000 --- a/tests/lexer/test-003.cli +++ /dev/null @@ -1,13 +0,0 @@ -"abc"; -"a\nb"; -"abc\\"; -"aaa\0"; -"\""; -"a\xaf"; -"a\111"; -"abc""def"; -"abc" "def"; -"abc - def - - xyz"; diff --git a/tests/lexer/test-003.std b/tests/lexer/test-003.std deleted file mode 100644 index 81f2a47..0000000 --- a/tests/lexer/test-003.std +++ /dev/null @@ -1,24 +0,0 @@ -"abc" -; -"a\nb" -; -"abc\\" -; -"aaa\0" -; -"\"" -; -"a\xaf" -; -"a\111" -; -"abc""def" -; -"abc""def" -; -"abc - def - - xyz" -; - diff --git a/tests/lexer/test-004.cli b/tests/lexer/test-004.cli deleted file mode 100644 index db95a81..0000000 --- a/tests/lexer/test-004.cli +++ /dev/null @@ -1,5 +0,0 @@ -include "foo/abc.hxx"; -include ; -include "c++:map"; -include ; -include "map.cli" diff --git a/tests/lexer/test-004.std b/tests/lexer/test-004.std deleted file mode 100644 index 4216cd1..0000000 --- a/tests/lexer/test-004.std +++ /dev/null @@ -1,15 +0,0 @@ -keyword: include -c++ path: "foo/abc.hxx" -; -keyword: include -c++ path: -; -keyword: include -c++ path: "map" -; -keyword: include -cli path: -; -keyword: include -cli path: "map.cli" - diff --git a/tests/lexer/test-005.cli b/tests/lexer/test-005.cli deleted file mode 100644 index 6085a33..0000000 --- a/tests/lexer/test-005.cli +++ /dev/null @@ -1,2 +0,0 @@ -(abc, 123 - 345, 12.34) - diff --git a/tests/lexer/test-005.std b/tests/lexer/test-005.std deleted file mode 100644 index 20e941b..0000000 --- a/tests/lexer/test-005.std +++ /dev/null @@ -1,3 +0,0 @@ -(abc, 123 - 345, 12.34) - - diff --git a/tests/lexer/test-006.cli b/tests/lexer/test-006.cli deleted file mode 100644 index d67cea7..0000000 --- a/tests/lexer/test-006.cli +++ /dev/null @@ -1,16 +0,0 @@ -// c++ comment ; -/* c comment ; */ -; -"a" // foo -"b" -"a" /* foo -bar -baz */ "b"; -- // aaa -5; -- /* a -a -a*/ 5 -// eos -: -:: diff --git a/tests/lexer/test-006.std b/tests/lexer/test-006.std deleted file mode 100644 index 82709e0..0000000 --- a/tests/lexer/test-006.std +++ /dev/null @@ -1,9 +0,0 @@ -; -"a""b""a""b" -; --5 -; --5 -: -:: - diff --git a/tests/parser/driver.cxx b/tests/parser/driver.cxx deleted file mode 100644 index bc963b5..0000000 --- a/tests/parser/driver.cxx +++ /dev/null @@ -1,46 +0,0 @@ -// file : tests/parser/driver.cxx -// author : Boris Kolpackov -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC -// license : MIT; see accompanying LICENSE file - -#include -#include - -#include -#include -#include - -using namespace std; - -int -main (int argc, char* argv[]) -{ - if (argc != 2) - { - cerr << "usage: " << argv[0] << " file.cli" << endl; - return 1; - } - - try - { - semantics::path path (argv[1]); - - ifstream ifs; - ifs.exceptions (ifstream::failbit | ifstream::badbit); - ifs.open (path.string ().c_str ()); - - parser::paths include_paths; - parser p (include_paths); - p.parse (ifs, path); - } - catch (semantics::invalid_path const& e) - { - cerr << "error: '" << e.path () << "' is not a valid filesystem path" - << endl; - return 1; - } - catch (parser::invalid_input const&) - { - return 1; - } -} diff --git a/tests/parser/makefile b/tests/parser/makefile deleted file mode 100644 index 490fbf3..0000000 --- a/tests/parser/makefile +++ /dev/null @@ -1,94 +0,0 @@ -# file : tests/parser/makefile -# author : Boris Kolpackov -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC -# license : MIT; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx - -tests := 000 001 002 003 004 005 006 007 - -# -# -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -driver := $(out_base)/driver -test := $(out_base)/.test -clean := $(out_base)/.clean - -# Build. -# -# Import. -# -$(call import,\ - $(scf_root)/import/libcutl/stub.make,\ - l: cutl.l,cpp-options: cutl.l.cpp-options) - -# Build. -# -cli_obj := \ -lexer.o \ -parser.o \ -semantics/class.o \ -semantics/elements.o \ -semantics/expression.o \ -semantics/namespace.o \ -semantics/option.o \ -semantics/unit.o \ -traversal/class.o \ -traversal/elements.o \ -traversal/namespace.o \ -traversal/option.o \ -traversal/unit.o - -$(driver): $(cxx_obj) $(addprefix $(out_root)/cli/,$(cli_obj)) $(cutl.l) - -$(cxx_obj) $(cxx_od): cpp_options := -I$(src_base) -I$(src_root)/cli -$(cxx_obj) $(cxx_od): $(cutl.l.cpp-options) - -$(call include-dep,$(cxx_od)) - -# Alias for default target. -# -$(out_base)/: $(driver) - -# Test. -# -test_targets := $(addprefix $(out_base)/.test-,$(tests)) - -$(test): $(test_targets) -$(test_targets): driver := $(driver) - -.PHONY: $(out_base)/.test-% -$(out_base)/.test-%: $(driver) $(src_base)/test-%.cli $(src_base)/test-%.std - $(call message,test $(out_base)/$*,$(driver) $(src_base)/test-$*.cli | diff -u $(src_base)/test-$*.std -) - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/cxx/o-e.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/cxx-d.make) - -# Dependencies. -# -$(call import,$(src_root)/cli/makefile) diff --git a/tests/parser/test-000.cli b/tests/parser/test-000.cli deleted file mode 100644 index 04c6576..0000000 --- a/tests/parser/test-000.cli +++ /dev/null @@ -1,5 +0,0 @@ -// def-unit -// -include ; -namespace n {} -class c {}; diff --git a/tests/parser/test-000.std b/tests/parser/test-000.std deleted file mode 100644 index e69de29..0000000 diff --git a/tests/parser/test-001-base.cli b/tests/parser/test-001-base.cli deleted file mode 100644 index e69de29..0000000 diff --git a/tests/parser/test-001-common.cli b/tests/parser/test-001-common.cli deleted file mode 100644 index 73fb928..0000000 --- a/tests/parser/test-001-common.cli +++ /dev/null @@ -1 +0,0 @@ -include "test-001-base.cli"; diff --git a/tests/parser/test-001.cli b/tests/parser/test-001.cli deleted file mode 100644 index 52f7f8e..0000000 --- a/tests/parser/test-001.cli +++ /dev/null @@ -1,6 +0,0 @@ -// include-decl-seq, include-decl -// -include ; -include "types.hxx"; -include "test-001-common.cli"; -include "../parser/test-001-base.cli"; diff --git a/tests/parser/test-001.std b/tests/parser/test-001.std deleted file mode 100644 index e69de29..0000000 diff --git a/tests/parser/test-002.cli b/tests/parser/test-002.cli deleted file mode 100644 index f8f368e..0000000 --- a/tests/parser/test-002.cli +++ /dev/null @@ -1,15 +0,0 @@ -// namespace-def, namespace-def-body -// -namespace n1 {} - -namespace n1 -{ - namespace n2 {} - class c {}; - namespace n2 - { - namespace n3 {} - } -} - -namespace n4 {} diff --git a/tests/parser/test-002.std b/tests/parser/test-002.std deleted file mode 100644 index e69de29..0000000 diff --git a/tests/parser/test-003.cli b/tests/parser/test-003.cli deleted file mode 100644 index 2920b16..0000000 --- a/tests/parser/test-003.cli +++ /dev/null @@ -1,23 +0,0 @@ -// class-def, inheritance-spec, abstract-spec -// -class c1 -{ -}; - -class c2 = 0 -{ -}; - -class c3: c1, ::c2 -{ -}; - -namespace n1 -{ - class c {}; -} - -class c4: n1::c = 0 -{ -}; - diff --git a/tests/parser/test-003.std b/tests/parser/test-003.std deleted file mode 100644 index e69de29..0000000 diff --git a/tests/parser/test-004.cli b/tests/parser/test-004.cli deleted file mode 100644 index e913288..0000000 --- a/tests/parser/test-004.cli +++ /dev/null @@ -1,8 +0,0 @@ -// option-def-seq -// -class c -{ - bool -a; - int -b; - float -c; -}; diff --git a/tests/parser/test-004.std b/tests/parser/test-004.std deleted file mode 100644 index e69de29..0000000 diff --git a/tests/parser/test-005.cli b/tests/parser/test-005.cli deleted file mode 100644 index 7798552..0000000 --- a/tests/parser/test-005.cli +++ /dev/null @@ -1,67 +0,0 @@ -// option-def, type-spec, fundamental-type-spec, option-name-seq, -// option-name, initializer, initializer-expr -// -class c -{ - bool --bool; - char --char; - - int -i1; - unsigned int -i2; - int unsigned -i3; - long -i4; - long int -i5; - int long -i6; - unsigned long -i7; - long unsigned -i8; - - unsigned long int -i9; - long unsigned int -i10; - int long unsigned -i11; - unsigned int long -i12; - - short -i13; - unsigned short -i14; - short unsigned -i15; - - char -i16; - signed char -i17; - char signed -i18; - unsigned char -i19; - char unsigned -i20; - - long long -ll1; - long long int -ll2; - long long unsigned -ll3; - int long long -ll4; - unsigned long long -ll5; - long long int unsigned -ll6; - long long unsigned int -ll7; - unsigned long long int -ll8; - unsigned int long long -ll9; - int long long unsigned -ll10; - int unsigned long long -ll11; - - double -d1; - long double -d2; - double long -d3; - - foo -o1; - ::foo -o2; - ::foo -o3; - foo::bar -o4; - ::foo::bar -o5; - ::foo::baz -o6; - ::foo::baz< ::fox<2> > -o7; - - bool -n1|--name1|/name1; - bool "-n2"|"--name2"; - - string -init1 = "string"; - char -init2 = 'c'; - int -init3 = -5; - bool -inti4 = true; - long -init5 = (2 * 4 - 5); - type -init6 = type::default_value; - type -init7 (abc, 2 - 1); -}; diff --git a/tests/parser/test-005.std b/tests/parser/test-005.std deleted file mode 100644 index e69de29..0000000 diff --git a/tests/parser/test-006.cli b/tests/parser/test-006.cli deleted file mode 100644 index 5b555e4..0000000 --- a/tests/parser/test-006.cli +++ /dev/null @@ -1,16 +0,0 @@ -// option-doc -// -class c -{ - bool --help | -h {"Help me"}; - - int --comp = 5 - { - "", - "Set compression level", - "Set compression level to . - - The minimum value for this options is 0 and - maximum is 9." - }; -}; diff --git a/tests/parser/test-006.std b/tests/parser/test-006.std deleted file mode 100644 index e69de29..0000000 diff --git a/tests/parser/test-007-base.cli b/tests/parser/test-007-base.cli deleted file mode 100644 index 7c02a39..0000000 --- a/tests/parser/test-007-base.cli +++ /dev/null @@ -1,11 +0,0 @@ -class b1 {}; - -namespace n1 -{ - class b2 {}; - - namespace i1 - { - class b3 {}; - } -} diff --git a/tests/parser/test-007.cli b/tests/parser/test-007.cli deleted file mode 100644 index b890a34..0000000 --- a/tests/parser/test-007.cli +++ /dev/null @@ -1,30 +0,0 @@ -// base class lookup -// - -include "test-007-base.cli"; - -class c1 {}; -class c2: c1 {}; -class c3: ::c1 {}; - -namespace n1 -{ - class c4 {}; - class c5: c4 {}; - class c6: n1::c4 {}; - class c7: ::n1::c4 {}; - - class c8: b2 {}; // From included. - class c9: i1::b3 {}; // From included. - - namespace i1 - { - class c10: c4 {}; // Outer scope. - class c11: b3 {}; // From included. - class c12: b2 {}; // Outer scope from included. - class c4: n1::c4 {}; // Qualified name from outer scope. - } -} - -class c13: n1::c4 {}; -class c14: ::n1::c4 {}; diff --git a/tests/parser/test-007.std b/tests/parser/test-007.std deleted file mode 100644 index e69de29..0000000 diff --git a/tests/specifier/buildfile b/tests/specifier/buildfile new file mode 100644 index 0000000..3d11b0d --- /dev/null +++ b/tests/specifier/buildfile @@ -0,0 +1,14 @@ +# file : tests/specifier/buildfile +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# license : MIT; see accompanying LICENSE file + +exe{driver}: cxx{driver} {hxx ixx cxx}{test} +exe{driver}: test.arguments = -a -c foo + +cxx.poptions =+ -I$out_base + +# Generated options parser. +# +{hxx ixx cxx}{test}: cli{test} + +cli.options = --generate-specifier --generate-modifier diff --git a/tests/specifier/makefile b/tests/specifier/makefile deleted file mode 100644 index eed02fb..0000000 --- a/tests/specifier/makefile +++ /dev/null @@ -1,73 +0,0 @@ -# file : tests/specifier/makefile -# author : Boris Kolpackov -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC -# license : MIT; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx -cli_tun := test.cli - -# -# -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o) $(cli_tun:.cli=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -driver := $(out_base)/driver -test := $(out_base)/.test -clean := $(out_base)/.clean - -# Build. -# -$(driver): $(cxx_obj) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) - -genf := $(cli_tun:.cli=.hxx) $(cli_tun:.cli=.ixx) $(cli_tun:.cli=.cxx) -gen := $(addprefix $(out_base)/,$(genf)) - -$(gen): $(out_root)/cli/cli -$(gen): cli := $(out_root)/cli/cli -$(gen): cli_options := --generate-specifier --generate-modifier - -$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) - -# Alias for default target. -# -$(out_base)/: $(driver) - -# Test. -# -$(test): driver := $(driver) -$(test): $(driver) - $(call message,test $$1,$$1 -a -c foo,$(driver)) - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(cli_tun:.cli=.cxx.cli.clean)) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/cxx/o-e.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(scf_root)/cli/cli-cxx.make) - -# Dependencies. -# -$(call import,$(src_root)/cli/makefile) - diff --git a/tests/toc/buildfile b/tests/toc/buildfile new file mode 100644 index 0000000..36e12c9 --- /dev/null +++ b/tests/toc/buildfile @@ -0,0 +1,5 @@ +# file : tests/toc/buildfile +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# license : MIT; see accompanying LICENSE file + +./: test{testscript} diff --git a/tests/toc/testscript b/tests/toc/testscript new file mode 100644 index 0000000..76a28eb --- /dev/null +++ b/tests/toc/testscript @@ -0,0 +1,158 @@ +# file : tests/toc/testscript +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# license : MIT; see accompanying LICENSE file + +test = $effect($cli.path) + +: toc +: +cat <>>toc.cli; +"\\h1|Table of Contents|" +"\\\$TOC\$" + +" +\\h0#preface|Preface| + +This document describes something awesome. + +\\h#about-document|About This Document| + +And this document is also awesome. + +\\h#more-information|More Information| + +It is so awesome that no further information will be required." + +" +\\H#part1|PART I| + +Start of part one. + +\\h1#intro|Introduction| + +Beginning of the first chapter. + +\\h#arch-flow|Architecture and Workflow| + +Some basics. + +\\h#benefits|Benefits| + +You will like them. + +\\h1#hello|Hello World| + +Beginning of the second chapter. + +\\h#hell-setup|Setup| + +More basics. + +\\h#hello-compile|Compiling| + +How to build the example + +\\h2#hello-compile-gcc|Compiling with GCC| + +GCC. For Clang see \\l{#hello-compile-clang Compiling with Clang}. + +\\h2#hello-compile-clang|Compiling with Clang| + +Clang. For GCC see \\l{#hello-compile-gcc Compiling with GCC}. + +\\h#hello-conclusion|Conclusion| + +Some remarks. +" +EOI +$* --generate-html --stdout toc.cli >>EOO +

Table of Contents

+ + + + + + +
Preface + + + +
About +This Document
More +Information
+
PART I
1Introduction + + + +
1.1Architecture and +Workflow
1.2Benefits
+
2Hello World + + + + +
2.1Setup
2.2Compiling + + + +
2.2.1Compiling with +GCC
2.2.2Compiling +with Clang
+
2.3Conclusion
+
+ +

Preface

+ +

This document describes something awesome.

+ +

About This Document

+ +

And this document is also awesome.

+ +

More Information

+ +

It is so awesome that no further information will be required.

+ +

PART I

+ +

Start of part one.

+ +

1 Introduction

+ +

Beginning of the first chapter.

+ +

1.1 Architecture and Workflow

+ +

Some basics.

+ +

1.2 Benefits

+ +

You will like them.

+ +

2 Hello World

+ +

Beginning of the second chapter.

+ +

2.1 Setup

+ +

More basics.

+ +

2.2 Compiling

+ +

How to build the example

+ +

2.2.1 Compiling with GCC

+ +

GCC. For Clang see Compiling with + Clang.

+ +

2.2.2 Compiling with Clang

+ +

Clang. For GCC see Compiling with + GCC.

+ +

2.3 Conclusion

+ +

Some remarks.

+ +EOO diff --git a/tests/toc/toc.cli b/tests/toc/toc.cli deleted file mode 100644 index cb6fd8c..0000000 --- a/tests/toc/toc.cli +++ /dev/null @@ -1,57 +0,0 @@ -"\h1|Table of Contents|" -"\$TOC$" - -" -\h0#preface|Preface| - -This document describes something awesome. - -\h#about-document|About This Document| - -And this document is also awesome. - -\h#more-information|More Information| - -It is so awesome that no further information will be required." - -" -\H#part1|PART I| - -Start of part one. - -\h1#intro|Introduction| - -Beginning of the first chapter. - -\h#arch-flow|Architecture and Workflow| - -Some basics. - -\h#benefits|Benefits| - -You will like them. - -\h1#hello|Hello World| - -Beginning of the second chapter. - -\h#hell-setup|Setup| - -More basics. - -\h#hello-compile|Compiling| - -How to build the example - -\h2#hello-compile-gcc|Compiling with GCC| - -GCC. For Clang see \l{#hello-compile-clang Compiling with Clang}. - -\h2#hello-compile-clang|Compiling with Clang| - -Clang. For GCC see \l{#hello-compile-gcc Compiling with GCC}. - -\h#hello-conclusion|Conclusion| - -Some remarks. -" diff --git a/tests/toc/toc.html b/tests/toc/toc.html deleted file mode 100644 index 5305db9..0000000 --- a/tests/toc/toc.html +++ /dev/null @@ -1,88 +0,0 @@ -

Table of Contents

- - - - - - -
Preface - - - -
About This -Document
More Information
-
PART I
1Introduction - - - -
1.1Architecture and -Workflow
1.2Benefits
-
2Hello World - - - - -
2.1Setup
2.2Compiling - - - -
2.2.1Compiling with -GCC
2.2.2Compiling -with Clang
-
2.3Conclusion
-
- -

Preface

- -

This document describes something awesome.

- -

About This Document

- -

And this document is also awesome.

- -

More Information

- -

It is so awesome that no further information will be required.

- -

PART I

- -

Start of part one.

- -

1 Introduction

- -

Beginning of the first chapter.

- -

1.1 Architecture and Workflow

- -

Some basics.

- -

1.2 Benefits

- -

You will like them.

- -

2 Hello World

- -

Beginning of the second chapter.

- -

2.1 Setup

- -

More basics.

- -

2.2 Compiling

- -

How to build the example

- -

2.2.1 Compiling with GCC

- -

GCC. For Clang see Compiling with - Clang.

- -

2.2.2 Compiling with Clang

- -

Clang. For GCC see Compiling with - GCC.

- -

2.3 Conclusion

- -

Some remarks.

- -- cgit v1.1