aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-07-24 16:39:55 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-07-24 16:39:55 +0200
commit1d6e68fda762535fa8508f94ca254a79f293edb2 (patch)
tree7b97edd9f1786cd610c1f41e720d2b105dd87cbc /tests
parentbb4f9e6498ba715911f83e0dc221a5b1b86baf51 (diff)
Add support for generated test input/output
Diffstat (limited to 'tests')
-rw-r--r--tests/cli/lib/libtest/build/bootstrap.build1
-rw-r--r--tests/cli/lib/test/build/bootstrap.build1
-rw-r--r--tests/cli/lib/test/buildfile2
-rw-r--r--tests/test/generated/build/bootstrap.build4
-rw-r--r--tests/test/generated/buildfile12
-rw-r--r--tests/test/generated/driver.cxx24
-rw-r--r--tests/test/generated/utility.cxx1
7 files changed, 44 insertions, 1 deletions
diff --git a/tests/cli/lib/libtest/build/bootstrap.build b/tests/cli/lib/libtest/build/bootstrap.build
index 67a5f1a..2e04406 100644
--- a/tests/cli/lib/libtest/build/bootstrap.build
+++ b/tests/cli/lib/libtest/build/bootstrap.build
@@ -1,2 +1,3 @@
project = cli-lib-libtest
+amalgamation = # Disabled.
using config
diff --git a/tests/cli/lib/test/build/bootstrap.build b/tests/cli/lib/test/build/bootstrap.build
index e83e189..db43826 100644
--- a/tests/cli/lib/test/build/bootstrap.build
+++ b/tests/cli/lib/test/build/bootstrap.build
@@ -1,2 +1,3 @@
project = cli-lib-test
+amalgamation = # Disabled.
using config
diff --git a/tests/cli/lib/test/buildfile b/tests/cli/lib/test/buildfile
index 0bbeb95..d3e784d 100644
--- a/tests/cli/lib/test/buildfile
+++ b/tests/cli/lib/test/buildfile
@@ -1,4 +1,4 @@
-import libs += cli-lib-libtest
+import libs += cli-lib-libtest%lib{test}
exe{driver}: cxx{driver} cli.cxx{test} $libs
cli.cxx{test}: cli{test}
diff --git a/tests/test/generated/build/bootstrap.build b/tests/test/generated/build/bootstrap.build
new file mode 100644
index 0000000..5428eb8
--- /dev/null
+++ b/tests/test/generated/build/bootstrap.build
@@ -0,0 +1,4 @@
+project = test-generated
+amalgamation = # Disabled.
+using config
+using test
diff --git a/tests/test/generated/buildfile b/tests/test/generated/buildfile
new file mode 100644
index 0000000..ca06105
--- /dev/null
+++ b/tests/test/generated/buildfile
@@ -0,0 +1,12 @@
+# Test generated input.
+#
+using cxx
+
+hxx.ext = hxx
+cxx.ext = cxx
+
+exe{utility}: cxx{utility}
+exe{driver}: cxx{driver}
+exe{driver}: test.input = exe{utility}
+
+.: exe{driver}
diff --git a/tests/test/generated/driver.cxx b/tests/test/generated/driver.cxx
new file mode 100644
index 0000000..008dbf7
--- /dev/null
+++ b/tests/test/generated/driver.cxx
@@ -0,0 +1,24 @@
+#include <iostream>
+#include <fstream>
+
+using namespace std;
+
+int
+main (int argc, char* argv[])
+{
+ if (argc != 2)
+ {
+ cerr << "usage: " << argv[0] << " <file>" << endl;
+ return 1;
+ }
+
+ ifstream ifs (argv[1], ifstream::in | ifstream::binary | ifstream::ate);
+
+ if (!ifs.is_open ())
+ cerr << "unable to open " << argv[1] << endl;
+
+ if (ifs.tellg () == 0)
+ cerr << argv[1] << " is empty" << endl;
+
+ return 0;
+}
diff --git a/tests/test/generated/utility.cxx b/tests/test/generated/utility.cxx
new file mode 100644
index 0000000..ca2ac4a
--- /dev/null
+++ b/tests/test/generated/utility.cxx
@@ -0,0 +1 @@
+int main () {}