summaryrefslogtreecommitdiff
path: root/tests/merge
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/merge
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/merge')
-rw-r--r--tests/merge/buildfile9
-rw-r--r--tests/merge/driver.cxx55
-rw-r--r--tests/merge/test.cli18
3 files changed, 0 insertions, 82 deletions
diff --git a/tests/merge/buildfile b/tests/merge/buildfile
deleted file mode 100644
index d786ad8..0000000
--- a/tests/merge/buildfile
+++ /dev/null
@@ -1,9 +0,0 @@
-# file : tests/merge/buildfile
-# license : MIT; see accompanying LICENSE file
-
-exe{driver}: {hxx cxx}{* -test} cli.cxx{test}
-
-cxx.poptions =+ "-I$out_base"
-
-cli.cxx{test}: cli{test}
-cli.options = --generate-merge
diff --git a/tests/merge/driver.cxx b/tests/merge/driver.cxx
deleted file mode 100644
index 0420442..0000000
--- a/tests/merge/driver.cxx
+++ /dev/null
@@ -1,55 +0,0 @@
-// file : tests/merge/driver.cxx
-// author : Boris Kolpackov <boris@codesynthesis.com>
-// license : MIT; see accompanying LICENSE file
-
-// Test parsed options merging.
-//
-
-#include <string>
-#include <cassert>
-
-#include "test.hxx"
-
-using namespace std;
-
-template <typename T, int N1, int N2>
-static T
-merge (const char* (&av1)[N1], const char* (&av2)[N2])
-{
- int ac1 (N1);
- int ac2 (N2);
- T o1 (ac1, const_cast<char**> (av1));
- T o2 (ac2, const_cast<char**> (av2));
- o1.merge (o2);
- return o1;
-}
-
-int
-main ()
-{
- // Basics.
- //
- {
- const char* a1[] = {"", "-i=123", "-v=1", "-v=2"};
- const char* a2[] = {"", "-b", "-i=456", "-s=xyz", "-v=3", "-v=4"};
- derived r (merge<derived> (a1, a2));
-
- assert (r.b ());
- assert (r.i_specified () && r.i () == 456);
- assert (r.s_specified () && r.s () == "xyz");
- assert (r.v_specified () && r.v ().size () == 4 &&
- r.v ()[0] == 1 &&
- r.v ()[1] == 2 &&
- r.v ()[2] == 3 &&
- r.v ()[3] == 4);
- }
-
- // Default value does not override.
- //
- {
- const char* a1[] = {"", "-i=456"};
- const char* a2[] = {"" };
- derived r (merge<derived> (a1, a2));
- assert (r.i_specified () && r.i () == 456);
- }
-}
diff --git a/tests/merge/test.cli b/tests/merge/test.cli
deleted file mode 100644
index 4c61f6a..0000000
--- a/tests/merge/test.cli
+++ /dev/null
@@ -1,18 +0,0 @@
-// file : tests/merge/test.cli
-// author : Boris Kolpackov <boris@codesynthesis.com>
-// license : MIT; see accompanying LICENSE file
-
-include <string>;
-include <vector>;
-
-class base
-{
- bool -b;
- int -i = -1;
- std::string -s;
-};
-
-class derived: base
-{
- std::vector<int> -v;
-};