From 720c5a33b6a49cf328fdd7611f49153cf8f60247 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Wed, 8 Apr 2020 14:51:57 +0300 Subject: Separate tests and examples into individual packages Also make cli module to be explicitly enabled via the config.cli configuration variable. --- tests/combined/buildfile | 9 ---- tests/combined/driver.cxx | 39 ----------------- tests/combined/test.cli | 16 ------- tests/combined/testscript | 108 ---------------------------------------------- 4 files changed, 172 deletions(-) delete mode 100644 tests/combined/buildfile delete mode 100644 tests/combined/driver.cxx delete mode 100644 tests/combined/test.cli delete mode 100644 tests/combined/testscript (limited to 'tests/combined') diff --git a/tests/combined/buildfile b/tests/combined/buildfile deleted file mode 100644 index 7d1e167..0000000 --- a/tests/combined/buildfile +++ /dev/null @@ -1,9 +0,0 @@ -# file : tests/combined/buildfile -# license : MIT; see accompanying LICENSE file - -exe{driver}: {hxx cxx}{* -test} cli.cxx{test} testscript - -cxx.poptions =+ "-I$out_base" - -cli.cxx{test}: cli{test} -cli.options = --generate-specifier --generate-file-scanner diff --git a/tests/combined/driver.cxx b/tests/combined/driver.cxx deleted file mode 100644 index ace3e64..0000000 --- a/tests/combined/driver.cxx +++ /dev/null @@ -1,39 +0,0 @@ -// file : tests/combined/driver.cxx -// author : Boris Kolpackov -// license : MIT; see accompanying LICENSE file - -// Test combined flags (-xyz vs -x -y -z) and option values (--foo=bar). -// - -#include - -#include "test.hxx" - -using namespace std; - -int -main (int argc, char* argv[]) -{ - try - { - cli::argv_file_scanner s (argc, argv, "--file"); - options o (s); - - if (o.foo_specified ()) - cout << "--foo=" << o.foo () << endl; - - if (o.x () || o.y () || o.z ()) - cout << '-' - << (o.x () ? "x" : "") - << (o.y () ? "y" : "") - << (o.z () ? "z" : "") << endl; - - if (o.xyz ()) - cout << "--xyz" << endl; - } - catch (const cli::exception& e) - { - cerr << e << endl; - return 1; - } -} diff --git a/tests/combined/test.cli b/tests/combined/test.cli deleted file mode 100644 index 1576859..0000000 --- a/tests/combined/test.cli +++ /dev/null @@ -1,16 +0,0 @@ -// file : tests/combined/test.cli -// author : Boris Kolpackov -// license : MIT; see accompanying LICENSE file - -include ; - -class options -{ - std::string --foo|-f; - - bool -x; - bool -y; - bool -z; - - bool --xyz; -}; diff --git a/tests/combined/testscript b/tests/combined/testscript deleted file mode 100644 index 986ed02..0000000 --- a/tests/combined/testscript +++ /dev/null @@ -1,108 +0,0 @@ -# file : tests/combined/testscript -# license : MIT; see accompanying LICENSE file - -: values -: -{ - : long - : - $* --foo=123 >'--foo=123' - - : short - : - $* -f=123 >'--foo=123' - - : empty - : - $* --foo= >'--foo=' - - : unknown-option-long - : - $* --bar=123 2>>EOE != 0 - unknown option '--bar' - EOE - - : unknown-option-short - : - $* -b=123 2>>EOE != 0 - unknown option '-b' - EOE - - : unknown-value - : - $* --xyz=123 2>>EOE != 0 - invalid value '123' for option '--xyz' - EOE - - : options-file - : - { - : basics - : - cat <=options; - --foo=123 - EOI - $* --file=options >'--foo=123' - - : equal-in-value - : - cat <=options; - --foo bar=123 - EOI - $* --file=options >'--foo=bar=123' - - : space-in-value - : - cat <=options; - --foo= 123 - EOI - $* --file=options >'--foo= 123' - - : quoted-value - : - cat <=options; - --foo="'bar 123'" - EOI - $* --file=options >"--foo='bar 123'" - } -} - -: flags -: -{ - : basic - : - $* -zyx >'-xyz' - - : separate - : - $* -zx -y >'-xyz' - - : long - : - $* --xyz >'--xyz' - - : unknown-option - : - $* -xYz 2>>EOE != 0 - unknown option '-Y' - EOE - - : alnum-only - : - $* -xy+ 2>>EOE != 0 - unknown option '-xy+' - EOE - - : flags-only - : - $* -xyf 123 2>>EOE != 0 - missing value for option '-f' - EOE - - : flags-only-combined - : - $* -xyf=123 2>>EOE != 0 - missing value for option '-f' - EOE -} -- cgit v1.1