summaryrefslogtreecommitdiff
path: root/libmformat/tests/test
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-07-20 08:55:31 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-07-20 08:55:31 +0200
commit0c71feb0363b337152f11e301303f85f9621c148 (patch)
treec87351ae473f43fff599061b9d1389f42357e0fd /libmformat/tests/test
parent28b92b59909030424420fefbca5a3f5df22337b5 (diff)
Add modularized version
Diffstat (limited to 'libmformat/tests/test')
-rw-r--r--libmformat/tests/test/buildfile5
-rw-r--r--libmformat/tests/test/driver.cxx16
-rw-r--r--libmformat/tests/test/test.out3
3 files changed, 24 insertions, 0 deletions
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!