summaryrefslogtreecommitdiff
path: root/tests/group
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2020-04-08 14:51:57 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2020-04-27 11:38:53 +0300
commit720c5a33b6a49cf328fdd7611f49153cf8f60247 (patch)
tree9725f3d1f42ec90fde84520f49647edea013ce5e /tests/group
parent3183f3bb927a90783ae0aeaf190a0919377aabe4 (diff)
Separate tests and examples into individual packages
Also make cli module to be explicitly enabled via the config.cli configuration variable.
Diffstat (limited to 'tests/group')
-rw-r--r--tests/group/buildfile9
-rw-r--r--tests/group/driver.cxx58
-rw-r--r--tests/group/test.cli7
-rw-r--r--tests/group/testscript140
4 files changed, 0 insertions, 214 deletions
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 <boris@codesynthesis.com>
-// license : MIT; see accompanying LICENSE file
-
-// Test group_scanner.
-//
-
-#include <iostream>
-
-#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 <boris@codesynthesis.com>
-// 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