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/group/buildfile | 9 ---- tests/group/driver.cxx | 58 -------------------- tests/group/test.cli | 7 --- tests/group/testscript | 140 ------------------------------------------------- 4 files changed, 214 deletions(-) delete mode 100644 tests/group/buildfile delete mode 100644 tests/group/driver.cxx delete mode 100644 tests/group/test.cli delete mode 100644 tests/group/testscript (limited to 'tests/group') diff --git a/tests/group/buildfile b/tests/group/buildfile deleted file mode 100644 index 427c68d..0000000 --- a/tests/group/buildfile +++ /dev/null @@ -1,9 +0,0 @@ -# file : tests/group/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-group-scanner diff --git a/tests/group/driver.cxx b/tests/group/driver.cxx deleted file mode 100644 index f24cdd8..0000000 --- a/tests/group/driver.cxx +++ /dev/null @@ -1,58 +0,0 @@ -// file : tests/group/driver.cxx -// author : Boris Kolpackov -// license : MIT; see accompanying LICENSE file - -// Test group_scanner. -// - -#include - -#include "test.hxx" - -using namespace std; - -int -main (int argc, char* argv[]) -{ - try - { - using namespace cli; - - // Mode flags. - // - // 'g' -- don't handle groups. - // 's' -- skip arguments. - // - string m (argv[1]); - - argv_scanner as (--argc, ++argv); - group_scanner s (as); - - while (s.more ()) - { - if (m.find ('s') == string::npos) - { - const char* a (s.next ()); - cout << "'" << a << "'"; - } - else - s.skip (); - - if (m.find ('g') == string::npos) - { - scanner& gs (s.group ()); - while (gs.more ()) - cout << " '" << gs.next () << "'"; - } - - cout << endl; - } - - return 0; - } - catch (const cli::exception& e) - { - cerr << e << endl; - return 1; - } -} diff --git a/tests/group/test.cli b/tests/group/test.cli deleted file mode 100644 index f4c1584..0000000 --- a/tests/group/test.cli +++ /dev/null @@ -1,7 +0,0 @@ -// file : tests/group/test.cli -// author : Boris Kolpackov -// license : MIT; see accompanying LICENSE file - -class options -{ -}; diff --git a/tests/group/testscript b/tests/group/testscript deleted file mode 100644 index 1370cbe..0000000 --- a/tests/group/testscript +++ /dev/null @@ -1,140 +0,0 @@ -# file : tests/group/testscript -# license : MIT; see accompanying LICENSE file - -: no-args -: -$* '' - -: no-groups -: -$* '' --foo arg >>EOO -'--foo' -'arg' -EOO - -: group-pre -: -$* '' { --foo --bar }+ arg1 arg2 >>EOO -'arg1' '--foo' '--bar' -'arg2' -EOO - -: group-pre-multi -: -$* '' { --foo }+ { --bar }+ arg1 arg2 >>EOO -'arg1' '--foo' '--bar' -'arg2' -EOO - -: group-post -: -$* '' arg1 arg2 +{ foo bar } >>EOO -'arg1' -'arg2' 'foo' 'bar' -EOO - -: group-post-multi -: -$* '' arg1 arg2 +{ foo } +{ bar } >>EOO -'arg1' -'arg2' 'foo' 'bar' -EOO - -: group-both -: -$* '' arg1 { --foo --bar }+ arg2 +{ foo bar } arg3 >>EOO -'arg1' -'arg2' '--foo' '--bar' 'foo' 'bar' -'arg3' -EOO - -: group-both-multi -: -$* '' arg1 { --foo }+ { --bar }+ arg2 +{ foo } +{ bar } arg3 >>EOO -'arg1' -'arg2' '--foo' '--bar' 'foo' 'bar' -'arg3' -EOO - -: multi-group -: -$* '' { --foo }+ arg1 arg2 +{ bar } >>EOO -'arg1' '--foo' -'arg2' 'bar' -EOO - -: empty-group -: -$* '' { }+ arg1 arg2 +{ } >>EOO -'arg1' -'arg2' -EOO - -: escape-arg -: -$* '' '\{' '\}' '\+{' '\}+' '{x' '}x' >>EOO -'{' -'}' -'+{' -'}+' -'{x' -'}x' -EOO - -: escape-group -: -$* '' { '\{' '\}' '\+{' '\}+' '{x' '}x' }+ arg >>EOO -'arg' '{' '}' '+{' '}+' '{x' '}x' -EOO - -: not-group -: -$* '' { --foo } 2>>EOE != 0 -expected group separator '}+' instead of '}', use '\}' to escape -EOE - -: no-arg-pre -: -$* '' { --foo }+ 2>>EOE != 0 -unexpected group separator '{', use '\{' to escape -EOE - -: no-arg-pre-empty -: -$* '' { }+ 2>>EOE != 0 -unexpected group separator '{', use '\{' to escape -EOE - -: no-arg-post -: -$* '' +{ --foo } 2>>EOE != 0 -unexpected group separator '+{', use '\+{' to escape -EOE - -: no-arg-post-empty -: -$* '' +{ } 2>>EOE != 0 -unexpected group separator '+{', use '\+{' to escape -EOE - -: unhandled-group-pre -: -$* 'g' { --foo }+ arg >>EOO 2>>EOE != 0 -'arg' -EOO -unexpected grouped argument '--foo' for argument 'arg' -EOE - -: unhandled-group-post -: -$* 'g' arg +{ bar } >>EOO 2>>EOE != 0 -'arg' -EOO -unexpected grouped argument 'bar' for argument 'arg' -EOE - -: unhandled-group-skip -: -$* 'sg' { --foo }+ arg +{ bar } >>EOO - -EOO -- cgit v1.1