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 --- buildfile | 24 +++- cli/context.cxx | 8 +- cli/header.cxx | 10 +- cli/parser.cxx | 2 +- cli/txt.cxx | 4 +- examples/.gitignore | 1 + examples/build/.gitignore | 1 + examples/build/bootstrap.build | 9 ++ examples/build/root.build | 27 +++++ examples/buildfile | 7 ++ examples/features/.gitignore | 1 + examples/features/buildfile | 11 ++ examples/features/makefile | 72 ------------ examples/file/.gitignore | 1 + examples/file/buildfile | 14 +++ examples/file/makefile | 74 ------------ examples/hello/.gitignore | 1 + examples/hello/buildfile | 12 ++ examples/hello/makefile | 72 ------------ 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 -------------- unit-tests/.gitignore | 1 + unit-tests/buildfile | 7 ++ unit-tests/lexer/buildfile | 12 ++ unit-tests/lexer/driver.cxx | 123 ++++++++++++++++++++ unit-tests/lexer/testscript | 192 +++++++++++++++++++++++++++++++ unit-tests/parser/buildfile | 14 +++ unit-tests/parser/driver.cxx | 46 ++++++++ unit-tests/parser/testscript | 243 +++++++++++++++++++++++++++++++++++++++ 116 files changed, 1315 insertions(+), 1592 deletions(-) create mode 100644 examples/.gitignore create mode 100644 examples/build/.gitignore create mode 100644 examples/build/bootstrap.build create mode 100644 examples/build/root.build create mode 100644 examples/buildfile create mode 100644 examples/features/.gitignore create mode 100644 examples/features/buildfile delete mode 100644 examples/features/makefile create mode 100644 examples/file/.gitignore create mode 100644 examples/file/buildfile delete mode 100644 examples/file/makefile create mode 100644 examples/hello/.gitignore create mode 100644 examples/hello/buildfile delete mode 100644 examples/hello/makefile 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 create mode 100644 unit-tests/.gitignore create mode 100644 unit-tests/buildfile create mode 100644 unit-tests/lexer/buildfile create mode 100644 unit-tests/lexer/driver.cxx create mode 100644 unit-tests/lexer/testscript create mode 100644 unit-tests/parser/buildfile create mode 100644 unit-tests/parser/driver.cxx create mode 100644 unit-tests/parser/testscript diff --git a/buildfile b/buildfile index a4a8411..2cf31c3 100644 --- a/buildfile +++ b/buildfile @@ -2,11 +2,27 @@ # copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : MIT; see accompanying LICENSE file -d = cli/ +d = cli/ unit-tests/ + +# Building examples/ and tests/ while bootstrapping the compiler is tricky. +# What we are going to do is omit these two directories if there is no cli +# compiler yet. Once it's built the user can reconfigure the project which +# will enable tests and examples. Alternatively, the user can install the +# compiler and test the installation with out-of-tree builds of tests/ and +# examples/. +# +# @@ A problem with this approach is an old cli compiler installed in the +# system -- it will be used for the project including tests and examples. +# +if $cli.configured + d += tests/ examples/ + ./: $d doc{INSTALL LICENSE NEWS README version} file{manifest} include $d -# Don't install tests or the INSTALL file. +# Don't install examples, tests or the INSTALL file. # -dir{tests/}: install = false -doc{INSTALL}@./: install = false +dir{examples/}: install = false +dir{tests/}: install = false +dir{unit-tests/}: install = false +doc{INSTALL}@./: install = false diff --git a/cli/context.cxx b/cli/context.cxx index 7cec6e3..1c70cc7 100644 --- a/cli/context.cxx +++ b/cli/context.cxx @@ -404,8 +404,8 @@ format_line (output_type ot, string& r, const char* s, size_t n) vector blocks; string link_target; - string link_section; // If not empty, man section; target is man name. - bool link_empty; // Link has no text. + string link_section; // If not empty, man section; target is man name. + bool link_empty (false); // Link has no text. bool escape (false); for (size_t i (0); i < n; ++i) @@ -1186,7 +1186,7 @@ format (semantics::scope& scope, string const& s, bool para) // Number of li in ol. Since we don't support nested lists, we don't // need to push it into the stack. // - size_t ol_count; + size_t ol_count (0); // Mapping of \h to HTML tag. By default it is

until we encounter // \h0 or \h1 at which point we change it to

. @@ -1283,7 +1283,7 @@ format (semantics::scope& scope, string const& s, bool para) // First determine what kind of paragraph block this is. // - block::kind_type k; + block::kind_type k (block::h); string id; string header; string trailer; diff --git a/cli/header.cxx b/cli/header.cxx index 41bdab5..41ff3c5 100644 --- a/cli/header.cxx +++ b/cli/header.cxx @@ -272,11 +272,11 @@ namespace // // - struct includes: traversal::cxx_includes, - traversal::cli_includes, - context + struct includes_: traversal::cxx_includes, + traversal::cli_includes, + context { - includes (context& c) : context (c) {} + includes_ (context& c) : context (c) {} virtual void traverse (semantics::cxx_includes& i) @@ -318,7 +318,7 @@ generate_header (context& ctx) ostream& os (ctx.os); traversal::cli_unit unit; - includes includes (ctx); + includes_ includes (ctx); traversal::names unit_names; namespace_ ns (ctx); class_ cl (ctx); diff --git a/cli/parser.cxx b/cli/parser.cxx index d8c11c5..cdc421b 100644 --- a/cli/parser.cxx +++ b/cli/parser.cxx @@ -1155,7 +1155,7 @@ doc_string (const char* l, size_t n) size_t b (0), e, p; bool pre (false); - size_t m; // Number of leading spaces to remove in pre. + size_t m (0); // Number of leading spaces to remove in pre. while (more) { diff --git a/cli/txt.cxx b/cli/txt.cxx index 9fbfb27..cff6dc1 100644 --- a/cli/txt.cxx +++ b/cli/txt.cxx @@ -171,7 +171,7 @@ namespace struct option: traversal::option, context { - option (context& c, class_doc_type cd) : context (c), cd_ (cd) {} + option (context& c, class_doc_type) : context (c)/*, cd_ (cd)*/ {} virtual void traverse (type& o) @@ -187,7 +187,7 @@ namespace } private: - class_doc_type cd_; + // class_doc_type cd_; }; // diff --git a/examples/.gitignore b/examples/.gitignore new file mode 100644 index 0000000..e54525b --- /dev/null +++ b/examples/.gitignore @@ -0,0 +1 @@ +driver diff --git a/examples/build/.gitignore b/examples/build/.gitignore new file mode 100644 index 0000000..225c27f --- /dev/null +++ b/examples/build/.gitignore @@ -0,0 +1 @@ +config.build diff --git a/examples/build/bootstrap.build b/examples/build/bootstrap.build new file mode 100644 index 0000000..c67bb12 --- /dev/null +++ b/examples/build/bootstrap.build @@ -0,0 +1,9 @@ +# file : examples/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/examples/build/root.build b/examples/build/root.build new file mode 100644 index 0000000..8c33a1c --- /dev/null +++ b/examples/build/root.build @@ -0,0 +1,27 @@ +# file : examples/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 examples, 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/examples/buildfile b/examples/buildfile new file mode 100644 index 0000000..3bd38c8 --- /dev/null +++ b/examples/buildfile @@ -0,0 +1,7 @@ +# file : examples/buildfile +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# license : MIT; see accompanying LICENSE file + +d = features/ file/ hello/ +./: $d doc{README} +include $d diff --git a/examples/features/.gitignore b/examples/features/.gitignore new file mode 100644 index 0000000..c6e608b --- /dev/null +++ b/examples/features/.gitignore @@ -0,0 +1 @@ +options.?xx diff --git a/examples/features/buildfile b/examples/features/buildfile new file mode 100644 index 0000000..3b7b1dc --- /dev/null +++ b/examples/features/buildfile @@ -0,0 +1,11 @@ +# file : examples/features/buildfile +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# license : MIT; see accompanying LICENSE file + +exe{driver}: cxx{driver} {hxx ixx cxx}{options} doc{README} + +cxx.poptions =+ -I$out_base + +# Generated options parser. +# +{hxx ixx cxx}{options}: cli{options} diff --git a/examples/features/makefile b/examples/features/makefile deleted file mode 100644 index 9b7ceac..0000000 --- a/examples/features/makefile +++ /dev/null @@ -1,72 +0,0 @@ -# file : examples/features/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 - -cli := options.cli -cxx := driver.cxx - -obj := $(addprefix $(out_base)/,$(cxx:.cxx=.o) $(cli:.cli=.o)) -dep := $(obj:.o=.o.d) - -driver := $(out_base)/driver -install := $(out_base)/.install -clean := $(out_base)/.clean - -# Build. -# -$(driver): $(obj) - -$(obj) $(dep): cpp_options := -I$(out_base) - -genf := $(cli:.cli=.hxx) $(cli:.cli=.ixx) $(cli:.cli=.cxx) -gen := $(addprefix $(out_base)/,$(genf)) - -$(gen): cli := $(out_root)/cli/cli -$(gen): $(out_root)/cli/cli - -$(call include-dep,$(dep),$(obj),$(gen)) - -# Convenience alias for default target. -# -$(out_base)/: $(driver) - -# Install -# -$(install): path := $(subst $(src_root)/,,$(src_base)) -$(install): - $(call install-data,$(src_base)/driver.cxx,$(install_doc_dir)/cli/$(path)/driver.cxx) - $(call install-data,$(src_base)/options.cli,$(install_doc_dir)/cli/$(path)/options.cli) - $(call install-data,$(src_base)/README,$(install_doc_dir)/cli/$(path)/README) - -# Clean. -# -$(clean): $(driver).o.clean \ - $(addsuffix .cxx.clean,$(obj)) \ - $(addsuffix .cxx.clean,$(dep)) \ - $(addprefix $(out_base)/,$(cli:.cli=.cxx.cli.clean)) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(gen): | $(out_base)/.gitignore -$(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/examples/file/.gitignore b/examples/file/.gitignore new file mode 100644 index 0000000..c6e608b --- /dev/null +++ b/examples/file/.gitignore @@ -0,0 +1 @@ +options.?xx diff --git a/examples/file/buildfile b/examples/file/buildfile new file mode 100644 index 0000000..d26a9d6 --- /dev/null +++ b/examples/file/buildfile @@ -0,0 +1,14 @@ +# file : examples/file/buildfile +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# license : MIT; see accompanying LICENSE file + +exe{driver}: cxx{driver} {hxx ixx cxx}{options} doc{README} file{test.ops} +exe{driver}: test.arguments = --options-file $src_base/test.ops + +cxx.poptions =+ -I$out_base + +# Generated options parser. +# +{hxx ixx cxx}{options}: cli{options} + +cli.options = --generate-file-scanner diff --git a/examples/file/makefile b/examples/file/makefile deleted file mode 100644 index ba1a760..0000000 --- a/examples/file/makefile +++ /dev/null @@ -1,74 +0,0 @@ -# file : examples/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 - -cli := options.cli -cxx := driver.cxx - -obj := $(addprefix $(out_base)/,$(cxx:.cxx=.o) $(cli:.cli=.o)) -dep := $(obj:.o=.o.d) - -driver := $(out_base)/driver -install := $(out_base)/.install -clean := $(out_base)/.clean - -# Build. -# -$(driver): $(obj) - -$(obj) $(dep): cpp_options := -I$(out_base) - -genf := $(cli:.cli=.hxx) $(cli:.cli=.ixx) $(cli:.cli=.cxx) -gen := $(addprefix $(out_base)/,$(genf)) - -$(gen): cli := $(out_root)/cli/cli -$(gen): cli_options += --generate-file-scanner -$(gen): $(out_root)/cli/cli - -$(call include-dep,$(dep),$(obj),$(gen)) - -# Convenience alias for default target. -# -$(out_base)/: $(driver) - -# Install -# -$(install): path := $(subst $(src_root)/,,$(src_base)) -$(install): - $(call install-data,$(src_base)/driver.cxx,$(install_doc_dir)/cli/$(path)/driver.cxx) - $(call install-data,$(src_base)/options.cli,$(install_doc_dir)/cli/$(path)/options.cli) - $(call install-data,$(src_base)/README,$(install_doc_dir)/cli/$(path)/README) - $(call install-data,$(src_base)/test.ops,$(install_doc_dir)/cli/$(path)/test.ops) - -# Clean. -# -$(clean): $(driver).o.clean \ - $(addsuffix .cxx.clean,$(obj)) \ - $(addsuffix .cxx.clean,$(dep)) \ - $(addprefix $(out_base)/,$(cli:.cli=.cxx.cli.clean)) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(gen): | $(out_base)/.gitignore -$(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/examples/hello/.gitignore b/examples/hello/.gitignore new file mode 100644 index 0000000..d73130a --- /dev/null +++ b/examples/hello/.gitignore @@ -0,0 +1 @@ +hello.?xx diff --git a/examples/hello/buildfile b/examples/hello/buildfile new file mode 100644 index 0000000..f45001d --- /dev/null +++ b/examples/hello/buildfile @@ -0,0 +1,12 @@ +# file : examples/hello/buildfile +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# license : MIT; see accompanying LICENSE file + +exe{driver}: cxx{driver} {hxx ixx cxx}{hello} doc{README} +exe{driver}: test.arguments = --greeting Hi John Jane + +cxx.poptions =+ -I$out_base + +# Generated options parser. +# +{hxx ixx cxx}{hello}: cli{hello} diff --git a/examples/hello/makefile b/examples/hello/makefile deleted file mode 100644 index cd8d29d..0000000 --- a/examples/hello/makefile +++ /dev/null @@ -1,72 +0,0 @@ -# file : examples/hello/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 - -cli := hello.cli -cxx := driver.cxx - -obj := $(addprefix $(out_base)/,$(cxx:.cxx=.o) $(cli:.cli=.o)) -dep := $(obj:.o=.o.d) - -driver := $(out_base)/driver -install := $(out_base)/.install -clean := $(out_base)/.clean - -# Build. -# -$(driver): $(obj) - -$(obj) $(dep): cpp_options := -I$(out_base) - -genf := $(cli:.cli=.hxx) $(cli:.cli=.ixx) $(cli:.cli=.cxx) -gen := $(addprefix $(out_base)/,$(genf)) - -$(gen): cli := $(out_root)/cli/cli -$(gen): $(out_root)/cli/cli - -$(call include-dep,$(dep),$(obj),$(gen)) - -# Convenience alias for default target. -# -$(out_base)/: $(driver) - -# Install -# -$(install): path := $(subst $(src_root)/,,$(src_base)) -$(install): - $(call install-data,$(src_base)/driver.cxx,$(install_doc_dir)/cli/$(path)/driver.cxx) - $(call install-data,$(src_base)/hello.cli,$(install_doc_dir)/cli/$(path)/hello.cli) - $(call install-data,$(src_base)/README,$(install_doc_dir)/cli/$(path)/README) - -# Clean. -# -$(clean): $(driver).o.clean \ - $(addsuffix .cxx.clean,$(obj)) \ - $(addsuffix .cxx.clean,$(dep)) \ - $(addprefix $(out_base)/,$(cli:.cli=.cxx.cli.clean)) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(gen): | $(out_base)/.gitignore -$(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/.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.

- diff --git a/unit-tests/.gitignore b/unit-tests/.gitignore new file mode 100644 index 0000000..e54525b --- /dev/null +++ b/unit-tests/.gitignore @@ -0,0 +1 @@ +driver diff --git a/unit-tests/buildfile b/unit-tests/buildfile new file mode 100644 index 0000000..6e25aae --- /dev/null +++ b/unit-tests/buildfile @@ -0,0 +1,7 @@ +# file : unit-tests/buildfile +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# license : MIT; see accompanying LICENSE file + +d = lexer/ parser/ +./: $d +include $d diff --git a/unit-tests/lexer/buildfile b/unit-tests/lexer/buildfile new file mode 100644 index 0000000..483250e --- /dev/null +++ b/unit-tests/lexer/buildfile @@ -0,0 +1,12 @@ +# file : unit-tests/lexer/buildfile +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# license : MIT; see accompanying LICENSE file + +#@@ Temporary until we get utility library support. +# +import libs = libcutl%lib{cutl} +src = lexer + +exe{driver}: cxx{driver} ../../cli/cxx{$src} $libs test{testscript} + +include ../../cli/ diff --git a/unit-tests/lexer/driver.cxx b/unit-tests/lexer/driver.cxx new file mode 100644 index 0000000..471bc1b --- /dev/null +++ b/unit-tests/lexer/driver.cxx @@ -0,0 +1,123 @@ +// file : unit-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/unit-tests/lexer/testscript b/unit-tests/lexer/testscript new file mode 100644 index 0000000..fb4f862 --- /dev/null +++ b/unit-tests/lexer/testscript @@ -0,0 +1,192 @@ +# file : unit-tests/lexer/testscript +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# license : MIT; see accompanying LICENSE file + +# @@ Give tests some meaningfull descriptions. +# + +: 000 +: +cat <>>test.cli; +help +help-me +-h +--help +--help-me +--help-me- +/h +/help-me +/help/me +--_ + +EOI +$* test.cli >>EOO +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: --_ + +EOO + +: 001 +: +cat <>>test.cli; +5 +123456 +-12345 +- 1 +- +123 +EOI +$* test.cli >>EOO +5 +123456 +-12345 +-1 +-123 + +EOO + +: 002 +: +cat <>>test.cli; +'a' +'\\n' +'\\\\' +'\\0' +'\\'' +'\\xaf' +'\\111' +EOI +$* test.cli >>EOO +'a' +'\\n' +'\\\\' +'\\0' +'\\'' +'\\xaf' +'\\111' + +EOO + +: 003 +: +cat <>>test.cli; +"abc"; +"a\\nb"; +"abc\\\\"; +"aaa\\0"; +"\\""; +"a\\xaf"; +"a\\111"; +"abc""def"; +"abc" "def"; +"abc + def + + xyz"; +EOI +$* test.cli >>EOO +"abc" +; +"a\\nb" +; +"abc\\\\" +; +"aaa\\0" +; +"\\"" +; +"a\\xaf" +; +"a\\111" +; +"abc""def" +; +"abc""def" +; +"abc + def + + xyz" +; + +EOO + +: 004 +: +cat <>>test.cli; +include "foo/abc.hxx"; +include ; +include "c++:map"; +include ; +include "map.cli" +EOI +$* test.cli >>EOO +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" + +EOO + +: 005 +: +cat <>>test.cli; +\(abc, 123 - 345, 12.34) + +EOI +$* test.cli >>EOO +\(abc, 123 - 345, 12.34) + + +EOO + +: 006 +: +cat <>>test.cli; +// c++ comment ; +/* c comment ; */ +; +"a" // foo +"b" +"a" /* foo +bar +baz */ "b"; +- // aaa +5; +- /* a +a +a*/ 5 +// eos +: +:: +EOI +$* test.cli >>EOO +; +"a""b""a""b" +; +-5 +; +-5 +: +:: + +EOO diff --git a/unit-tests/parser/buildfile b/unit-tests/parser/buildfile new file mode 100644 index 0000000..c7a2b59 --- /dev/null +++ b/unit-tests/parser/buildfile @@ -0,0 +1,14 @@ +# file : unit-tests/parser/buildfile +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# license : MIT; see accompanying LICENSE file + +#@@ Temporary until we get utility library support. +# +import libs = libcutl%lib{cutl} +src = lexer parser \ +semantics/{class elements expression namespace option unit} \ +traversal/{class elements namespace option unit} + +exe{driver}: cxx{driver} ../../cli/cxx{$src} $libs test{testscript} + +include ../../cli/ diff --git a/unit-tests/parser/driver.cxx b/unit-tests/parser/driver.cxx new file mode 100644 index 0000000..b2dc9d5 --- /dev/null +++ b/unit-tests/parser/driver.cxx @@ -0,0 +1,46 @@ +// file : unit-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/unit-tests/parser/testscript b/unit-tests/parser/testscript new file mode 100644 index 0000000..0ae0378 --- /dev/null +++ b/unit-tests/parser/testscript @@ -0,0 +1,243 @@ +# file : unit-tests/parser/testscript +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# license : MIT; see accompanying LICENSE file + +# @@ Give tests some meaningfull descriptions. Probably move c++-style comments +# from the test.cli files to test descriptions. +# + +: 000 +: +cat <>>test.cli; +// def-unit +// +include ; +namespace n {} +class c {}; +EOI +$* test.cli >:"" + +: 001 +: +cat <>>base.cli; +EOI +cat <>>common.cli; +include "base.cli"; +EOI +cat <>>test.cli; +// include-decl-seq, include-decl +// +include ; +include "types.hxx"; +include "common.cli"; +include "../001/base.cli"; +EOI +$* test.cli >:"" + +: 002 +: +cat <>>test.cli; +// namespace-def, namespace-def-body +// +namespace n1 {} + +namespace n1 +{ + namespace n2 {} + class c {}; + namespace n2 + { + namespace n3 {} + } +} + +namespace n4 {} +EOI +$* test.cli >:"" + +: 003 +: +cat <>>test.cli; +// class-def, inheritance-spec, abstract-spec +// +class c1 +{ +}; + +class c2 = 0 +{ +}; + +class c3: c1, ::c2 +{ +}; + +namespace n1 +{ + class c {}; +} + +class c4: n1::c = 0 +{ +}; + +EOI +$* test.cli >:"" + +: 004 +: +cat <>>test.cli; +// option-def-seq +// +class c +{ + bool -a; + int -b; + float -c; +}; +EOI +$* test.cli >:"" + +: 005 +: +cat <>>test.cli; +// 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); +}; +EOI +$* test.cli >:"" + +: 006 +: +cat <>>test.cli; +// 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." + }; +}; +EOI +$* test.cli >:"" + +: 007 +: +cat <>>base.cli; +class b1 {}; + +namespace n1 +{ + class b2 {}; + + namespace i1 + { + class b3 {}; + } +} +EOI +cat <>>test.cli; +// base class lookup +// + +include "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 {}; +EOI +$* test.cli >:"" -- cgit v1.1