From 0c71feb0363b337152f11e301303f85f9621c148 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 20 Jul 2017 08:55:31 +0200 Subject: Add modularized version --- libmformat/tests/.gitignore | 1 + libmformat/tests/build/.gitignore | 1 + libmformat/tests/build/bootstrap.build | 5 +++++ libmformat/tests/build/root.build | 13 +++++++++++++ libmformat/tests/buildfile | 1 + libmformat/tests/test/buildfile | 5 +++++ libmformat/tests/test/driver.cxx | 16 ++++++++++++++++ libmformat/tests/test/test.out | 3 +++ 8 files changed, 45 insertions(+) create mode 100644 libmformat/tests/.gitignore create mode 100644 libmformat/tests/build/.gitignore create mode 100644 libmformat/tests/build/bootstrap.build create mode 100644 libmformat/tests/build/root.build create mode 100644 libmformat/tests/buildfile create mode 100644 libmformat/tests/test/buildfile create mode 100644 libmformat/tests/test/driver.cxx create mode 100644 libmformat/tests/test/test.out (limited to 'libmformat/tests') diff --git a/libmformat/tests/.gitignore b/libmformat/tests/.gitignore new file mode 100644 index 0000000..e54525b --- /dev/null +++ b/libmformat/tests/.gitignore @@ -0,0 +1 @@ +driver diff --git a/libmformat/tests/build/.gitignore b/libmformat/tests/build/.gitignore new file mode 100644 index 0000000..225c27f --- /dev/null +++ b/libmformat/tests/build/.gitignore @@ -0,0 +1 @@ +config.build diff --git a/libmformat/tests/build/bootstrap.build b/libmformat/tests/build/bootstrap.build new file mode 100644 index 0000000..2c2de24 --- /dev/null +++ b/libmformat/tests/build/bootstrap.build @@ -0,0 +1,5 @@ +project = # Unnamed subproject. + +using config +using dist +using test diff --git a/libmformat/tests/build/root.build b/libmformat/tests/build/root.build new file mode 100644 index 0000000..58dffed --- /dev/null +++ b/libmformat/tests/build/root.build @@ -0,0 +1,13 @@ +cxx.std = experimental + +using cxx + +cxx{*}: extension = cxx + +# Every exe{} in this subproject is by default a test. +# +exe{*}: test = true + +# Specify the test target for cross-testing. +# +test.target = $cxx.target diff --git a/libmformat/tests/buildfile b/libmformat/tests/buildfile new file mode 100644 index 0000000..1a8bcc9 --- /dev/null +++ b/libmformat/tests/buildfile @@ -0,0 +1 @@ +./: test/ diff --git a/libmformat/tests/test/buildfile b/libmformat/tests/test/buildfile new file mode 100644 index 0000000..19d311d --- /dev/null +++ b/libmformat/tests/test/buildfile @@ -0,0 +1,5 @@ +import libs = libmformat%lib{mformat} +import libs += libstd-modules%liba{std-modules} + +exe{driver}: cxx{driver} $libs +exe{driver}: test.output = test.out diff --git a/libmformat/tests/test/driver.cxx b/libmformat/tests/test/driver.cxx new file mode 100644 index 0000000..9cc8748 --- /dev/null +++ b/libmformat/tests/test/driver.cxx @@ -0,0 +1,16 @@ +// file: tests/test/driver.cxx -*- C++ -*- + +import std.core; +import std.io; +import format; + +int +main () +{ + using namespace std; + using namespace format; + + cout << message ("Hello", "World", volume::quiet) << endl; + cout << message ("Hello", "World", volume::normal) << endl; + cout << message ("Hello", "World", volume::loud) << endl; +} diff --git a/libmformat/tests/test/test.out b/libmformat/tests/test/test.out new file mode 100644 index 0000000..7ce133b --- /dev/null +++ b/libmformat/tests/test/test.out @@ -0,0 +1,3 @@ +hello, World! +Hello, World! +HELLO, World! -- cgit v1.1