aboutsummaryrefslogtreecommitdiff
path: root/tests/test/simple
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test/simple')
-rw-r--r--tests/test/simple/generated/buildfile8
-rw-r--r--tests/test/simple/generated/driver.cxx11
-rw-r--r--tests/test/simple/generated/output.in1
-rw-r--r--tests/test/simple/generated/testscript42
-rw-r--r--tests/test/simple/generated/utility.cxx28
5 files changed, 90 insertions, 0 deletions
diff --git a/tests/test/simple/generated/buildfile b/tests/test/simple/generated/buildfile
new file mode 100644
index 0000000..af97abd
--- /dev/null
+++ b/tests/test/simple/generated/buildfile
@@ -0,0 +1,8 @@
+# file : tests/test/simple/generated/buildfile
+# copyright : Copyright (c) 2014-2017 Code Synthesis Ltd
+# license : MIT; see accompanying LICENSE file
+
+# Test generated test inputs/outputs.
+#
+
+./: test{testscript} $b file{*.cxx +*.in}
diff --git a/tests/test/simple/generated/driver.cxx b/tests/test/simple/generated/driver.cxx
new file mode 100644
index 0000000..fb3ab8f
--- /dev/null
+++ b/tests/test/simple/generated/driver.cxx
@@ -0,0 +1,11 @@
+// file : tests/test/simple/generated/driver.cxx -*- C++ -*-
+// copyright : Copyright (c) 2014-2017 Code Synthesis Ltd
+// license : MIT; see accompanying LICENSE file
+
+#include <iostream>
+
+int
+main ()
+{
+ std::cout << "1.2.3" << std::endl;
+}
diff --git a/tests/test/simple/generated/output.in b/tests/test/simple/generated/output.in
new file mode 100644
index 0000000..36d79d4
--- /dev/null
+++ b/tests/test/simple/generated/output.in
@@ -0,0 +1 @@
+$version$
diff --git a/tests/test/simple/generated/testscript b/tests/test/simple/generated/testscript
new file mode 100644
index 0000000..9ec5220
--- /dev/null
+++ b/tests/test/simple/generated/testscript
@@ -0,0 +1,42 @@
+# file : tests/test/simple/generated/testscript
+# copyright : Copyright (c) 2014-2017 Code Synthesis Ltd
+# license : MIT; see accompanying LICENSE file
+
+test.arguments = test clean
+
+.include ../../common.test
+
+# @@ in module
+#
++cat <<EOI >+build/bootstrap.build
+using version
+EOI
++cat <<EOI >=manifest
+: 1
+name: test
+version: 1.2.3
+EOI
+
++cat <<EOI >=build/root.build
+using cxx
+EOI
+
+: input
+:
+ln -s $src_base/driver.cxx ./;
+ln -s $src_base/utility.cxx ./;
+$* <<EOI
+exe{utility}: cxx{utility}
+exe{utility}: exe{driver}: test.input = true
+exe{driver}: cxx{driver}
+EOI
+
+: output
+:
+ln -s $src_base/driver.cxx ./;
+ln -s $src_base/output.in ./;
+$* <<EOI
+exe{driver}: cxx{driver}
+exe{driver}: file{output}: test.stdout = true
+file{output}: in{output} $src_root/file{manifest} #@@ in module
+EOI
diff --git a/tests/test/simple/generated/utility.cxx b/tests/test/simple/generated/utility.cxx
new file mode 100644
index 0000000..e2113bd
--- /dev/null
+++ b/tests/test/simple/generated/utility.cxx
@@ -0,0 +1,28 @@
+// file : tests/test/simple/generated/utility.cxx -*- C++ -*-
+// copyright : Copyright (c) 2014-2017 Code Synthesis Ltd
+// license : MIT; see accompanying LICENSE file
+
+#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;
+}