summaryrefslogtreecommitdiff
path: root/libformat/tests
diff options
context:
space:
mode:
Diffstat (limited to 'libformat/tests')
-rw-r--r--libformat/tests/.gitignore7
-rw-r--r--libformat/tests/basics/buildfile3
-rw-r--r--libformat/tests/basics/driver.cxx14
-rw-r--r--libformat/tests/build/.gitignore2
-rw-r--r--libformat/tests/build/bootstrap.build4
-rw-r--r--libformat/tests/build/root.build6
-rw-r--r--libformat/tests/buildfile2
-rw-r--r--libformat/tests/test/buildfile4
-rw-r--r--libformat/tests/test/driver.cxx16
-rw-r--r--libformat/tests/test/test.out3
10 files changed, 33 insertions, 28 deletions
diff --git a/libformat/tests/.gitignore b/libformat/tests/.gitignore
index e54525b..662178d 100644
--- a/libformat/tests/.gitignore
+++ b/libformat/tests/.gitignore
@@ -1 +1,8 @@
+# Test executables.
+#
driver
+
+# Testscript output directories (can be symlinks).
+#
+test
+test-*
diff --git a/libformat/tests/basics/buildfile b/libformat/tests/basics/buildfile
new file mode 100644
index 0000000..813cb7e
--- /dev/null
+++ b/libformat/tests/basics/buildfile
@@ -0,0 +1,3 @@
+import libs = libformat%lib{format}
+
+exe{driver}: {hxx ixx txx cxx}{*} $libs
diff --git a/libformat/tests/basics/driver.cxx b/libformat/tests/basics/driver.cxx
new file mode 100644
index 0000000..03faea7
--- /dev/null
+++ b/libformat/tests/basics/driver.cxx
@@ -0,0 +1,14 @@
+#include <cassert>
+
+#include <libformat/version.hxx>
+#include <libformat/format.hxx>
+
+using namespace std;
+using namespace format;
+
+int main ()
+{
+ assert (format_hello ("Hello", "World", volume::quiet) == "hello, World!");
+ assert (format_hello ("Hello", "World", volume::normal) == "Hello, World!");
+ assert (format_hello ("Hello", "World", volume::loud) == "HELLO, World!");
+}
diff --git a/libformat/tests/build/.gitignore b/libformat/tests/build/.gitignore
index 225c27f..4a730a3 100644
--- a/libformat/tests/build/.gitignore
+++ b/libformat/tests/build/.gitignore
@@ -1 +1,3 @@
config.build
+root/
+bootstrap/
diff --git a/libformat/tests/build/bootstrap.build b/libformat/tests/build/bootstrap.build
index 2c2de24..a07b5ea 100644
--- a/libformat/tests/build/bootstrap.build
+++ b/libformat/tests/build/bootstrap.build
@@ -1,5 +1,5 @@
-project = # Unnamed subproject.
+project = # Unnamed tests subproject.
using config
-using dist
using test
+using dist
diff --git a/libformat/tests/build/root.build b/libformat/tests/build/root.build
index a2ee38a..a67b2fe 100644
--- a/libformat/tests/build/root.build
+++ b/libformat/tests/build/root.build
@@ -1,14 +1,16 @@
-cxx.std = 11
+cxx.std = latest
using cxx
hxx{*}: extension = hxx
+ixx{*}: extension = ixx
+txx{*}: extension = txx
cxx{*}: extension = cxx
# Every exe{} in this subproject is by default a test.
#
exe{*}: test = true
-# Specify the test target for cross-testing.
+# The test target for cross-testing (running tests under Wine, etc).
#
test.target = $cxx.target
diff --git a/libformat/tests/buildfile b/libformat/tests/buildfile
index 1a8bcc9..aeeab15 100644
--- a/libformat/tests/buildfile
+++ b/libformat/tests/buildfile
@@ -1 +1 @@
-./: test/
+./: {*/ -build/}
diff --git a/libformat/tests/test/buildfile b/libformat/tests/test/buildfile
deleted file mode 100644
index e99af23..0000000
--- a/libformat/tests/test/buildfile
+++ /dev/null
@@ -1,4 +0,0 @@
-import libs = libformat%lib{format}
-
-exe{driver}: cxx{driver} $libs
-exe{driver}: file{test.out}: test.stdout = true
diff --git a/libformat/tests/test/driver.cxx b/libformat/tests/test/driver.cxx
deleted file mode 100644
index 1cf2959..0000000
--- a/libformat/tests/test/driver.cxx
+++ /dev/null
@@ -1,16 +0,0 @@
-// file: tests/test/driver.cxx -*- C++ -*-
-
-#include <iostream>
-
-#include <libformat/format.hxx>
-
-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/libformat/tests/test/test.out b/libformat/tests/test/test.out
deleted file mode 100644
index 7ce133b..0000000
--- a/libformat/tests/test/test.out
+++ /dev/null
@@ -1,3 +0,0 @@
-hello, World!
-Hello, World!
-HELLO, World!