summaryrefslogtreecommitdiff
path: root/libmhello/tests
diff options
context:
space:
mode:
Diffstat (limited to 'libmhello/tests')
-rw-r--r--libmhello/tests/.gitignore1
-rw-r--r--libmhello/tests/build/.gitignore1
-rw-r--r--libmhello/tests/build/bootstrap.build5
-rw-r--r--libmhello/tests/build/root.build13
-rw-r--r--libmhello/tests/buildfile1
-rw-r--r--libmhello/tests/test/buildfile6
-rw-r--r--libmhello/tests/test/driver.cxx15
-rw-r--r--libmhello/tests/test/test.out3
8 files changed, 45 insertions, 0 deletions
diff --git a/libmhello/tests/.gitignore b/libmhello/tests/.gitignore
new file mode 100644
index 0000000..e54525b
--- /dev/null
+++ b/libmhello/tests/.gitignore
@@ -0,0 +1 @@
+driver
diff --git a/libmhello/tests/build/.gitignore b/libmhello/tests/build/.gitignore
new file mode 100644
index 0000000..225c27f
--- /dev/null
+++ b/libmhello/tests/build/.gitignore
@@ -0,0 +1 @@
+config.build
diff --git a/libmhello/tests/build/bootstrap.build b/libmhello/tests/build/bootstrap.build
new file mode 100644
index 0000000..2c2de24
--- /dev/null
+++ b/libmhello/tests/build/bootstrap.build
@@ -0,0 +1,5 @@
+project = # Unnamed subproject.
+
+using config
+using dist
+using test
diff --git a/libmhello/tests/build/root.build b/libmhello/tests/build/root.build
new file mode 100644
index 0000000..58dffed
--- /dev/null
+++ b/libmhello/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/libmhello/tests/buildfile b/libmhello/tests/buildfile
new file mode 100644
index 0000000..1a8bcc9
--- /dev/null
+++ b/libmhello/tests/buildfile
@@ -0,0 +1 @@
+./: test/
diff --git a/libmhello/tests/test/buildfile b/libmhello/tests/test/buildfile
new file mode 100644
index 0000000..88a391c
--- /dev/null
+++ b/libmhello/tests/test/buildfile
@@ -0,0 +1,6 @@
+import libs = libmhello%lib{mhello}
+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/libmhello/tests/test/driver.cxx b/libmhello/tests/test/driver.cxx
new file mode 100644
index 0000000..debf04a
--- /dev/null
+++ b/libmhello/tests/test/driver.cxx
@@ -0,0 +1,15 @@
+// file: tests/test/driver.cxx -*- C++ -*-
+
+import std.core;
+import format; // volume
+import hello;
+
+int
+main ()
+{
+ using namespace hello;
+
+ say ("World");
+ say ("World", format::volume::loud);
+ say_formatted ("Hi, World!");
+}
diff --git a/libmhello/tests/test/test.out b/libmhello/tests/test/test.out
new file mode 100644
index 0000000..a9ec19f
--- /dev/null
+++ b/libmhello/tests/test/test.out
@@ -0,0 +1,3 @@
+Hello, World!
+HELLO, World!
+Hi, World!