aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2016-11-15 22:47:30 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2016-11-17 15:20:17 +0300
commitbe095014187fbe40e91e6b45166e9f2b3530123a (patch)
tree74aa4e3f342ab2f0222cea00c13237ab31338864
parente8a09d9833d67a40c43e4de1d578551cc9020cb7 (diff)
Add support for build2 for tests
-rw-r--r--buildfile2
-rw-r--r--tests/.gitignore1
-rw-r--r--tests/build/.gitignore1
-rw-r--r--tests/build/bootstrap.build9
-rw-r--r--tests/build/root.build14
-rw-r--r--tests/buildfile7
-rw-r--r--tests/compiler/buildfile7
-rw-r--r--tests/compiler/cxx-indenter/buildfile8
-rw-r--r--tests/compiler/sloc-counter/buildfile7
-rw-r--r--tests/compiler/sloc-counter/driver.cxx2
-rw-r--r--tests/compiler/sloc-counter/testscript46
-rw-r--r--tests/compiler/traversal/buildfile8
-rw-r--r--tests/container/buildfile7
-rw-r--r--tests/container/multi-index/buildfile7
-rw-r--r--tests/fs/buildfile7
-rw-r--r--tests/fs/path/buildfile7
-rw-r--r--tests/re/buildfile8
-rw-r--r--tests/shared-ptr/buildfile7
18 files changed, 153 insertions, 2 deletions
diff --git a/buildfile b/buildfile
index b6d12ea..945a454 100644
--- a/buildfile
+++ b/buildfile
@@ -2,7 +2,7 @@
# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC
# license : MIT; see accompanying LICENSE file
-d = cutl/
+d = cutl/ tests/
./: $d doc{INSTALL LICENSE NEWS README version} file{manifest}
include $d
diff --git a/tests/.gitignore b/tests/.gitignore
new file mode 100644
index 0000000..e54525b
--- /dev/null
+++ b/tests/.gitignore
@@ -0,0 +1 @@
+driver
diff --git a/tests/build/.gitignore b/tests/build/.gitignore
new file mode 100644
index 0000000..225c27f
--- /dev/null
+++ b/tests/build/.gitignore
@@ -0,0 +1 @@
+config.build
diff --git a/tests/build/bootstrap.build b/tests/build/bootstrap.build
new file mode 100644
index 0000000..904c361
--- /dev/null
+++ b/tests/build/bootstrap.build
@@ -0,0 +1,9 @@
+# file : tests/build/bootstrap.build
+# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC
+# license : MIT; see accompanying LICENSE file
+
+project = # Unnamed subproject.
+
+using config
+using dist
+using test
diff --git a/tests/build/root.build b/tests/build/root.build
new file mode 100644
index 0000000..d8550db
--- /dev/null
+++ b/tests/build/root.build
@@ -0,0 +1,14 @@
+# file : tests/build/root.build
+# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC
+# license : MIT; see accompanying LICENSE file
+
+cxx.std = 11
+
+using cxx
+
+hxx{*}: extension = hxx
+cxx{*}: extension = cxx
+
+# Every exe{} in this subproject is by default a test.
+#
+exe{*}: test = true
diff --git a/tests/buildfile b/tests/buildfile
new file mode 100644
index 0000000..8401e1b
--- /dev/null
+++ b/tests/buildfile
@@ -0,0 +1,7 @@
+# file : tests/buildfile
+# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC
+# license : MIT; see accompanying LICENSE file
+
+d = compiler/ container/ fs/ re/ shared-ptr/
+./: $d
+include $d
diff --git a/tests/compiler/buildfile b/tests/compiler/buildfile
new file mode 100644
index 0000000..8c1604b
--- /dev/null
+++ b/tests/compiler/buildfile
@@ -0,0 +1,7 @@
+# file : tests/compiler/buildfile
+# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC
+# license : MIT; see accompanying LICENSE file
+
+d = cxx-indenter/ sloc-counter/ traversal/
+./: $d
+include $d
diff --git a/tests/compiler/cxx-indenter/buildfile b/tests/compiler/cxx-indenter/buildfile
new file mode 100644
index 0000000..aad54c6
--- /dev/null
+++ b/tests/compiler/cxx-indenter/buildfile
@@ -0,0 +1,8 @@
+# file : tests/compiler/cxx-indenter/buildfile
+# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC
+# license : MIT; see accompanying LICENSE file
+
+import libs = libcutl%lib{cutl}
+
+exe{driver}: cxx{driver} $libs
+exe{driver}: test.output = output.std
diff --git a/tests/compiler/sloc-counter/buildfile b/tests/compiler/sloc-counter/buildfile
new file mode 100644
index 0000000..e84c722
--- /dev/null
+++ b/tests/compiler/sloc-counter/buildfile
@@ -0,0 +1,7 @@
+# file : tests/compiler/sloc-counter/buildfile
+# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC
+# license : MIT; see accompanying LICENSE file
+
+import libs = libcutl%lib{cutl}
+
+exe{driver}: cxx{driver} $libs test{testscript}
diff --git a/tests/compiler/sloc-counter/driver.cxx b/tests/compiler/sloc-counter/driver.cxx
index 504fbb7..9d738b3 100644
--- a/tests/compiler/sloc-counter/driver.cxx
+++ b/tests/compiler/sloc-counter/driver.cxx
@@ -22,7 +22,7 @@ main (int argc, char* argv[])
ostream_filter<sloc_counter, char> filt (cout);
- ifstream ifs(argv[1]);
+ ifstream ifs (argv[1]);
for (istream::int_type c (ifs.get ());
c != istream::traits_type::eof ();
diff --git a/tests/compiler/sloc-counter/testscript b/tests/compiler/sloc-counter/testscript
new file mode 100644
index 0000000..802d406
--- /dev/null
+++ b/tests/compiler/sloc-counter/testscript
@@ -0,0 +1,46 @@
+# file : tests/compiler/sloc-counter/testscript
+# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC
+# license : MIT; see accompanying LICENSE file
+
+: c++-program-sloc
+:
+text = '// C++ comment
+ // C++ comment
+
+/* C comment */
+
+/* Multiline
+ C
+ Comment
+
+
+*/
+
+#include <iostream>
+
+char str[] = "multi\
+line\
+string\
+literal";
+
+using namespace std;
+
+
+int main(
+ int argc /*count*/,
+ char* argv[] /*array*/)
+{
+ /* comment start */ int x = 0;
+ char* s =
+ /* comment start */"foo";
+ int y = 2
+ /* tricky stuff *//
+ 2;
+ cerr << "Hello, \"world!" << '"'\\''"' << endl;
+}';
+cat <"$text" >>>file;
+$* file >>EOO
+$text
+
+18
+EOO
diff --git a/tests/compiler/traversal/buildfile b/tests/compiler/traversal/buildfile
new file mode 100644
index 0000000..414856a
--- /dev/null
+++ b/tests/compiler/traversal/buildfile
@@ -0,0 +1,8 @@
+# file : tests/compiler/traversal/buildfile
+# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC
+# license : MIT; see accompanying LICENSE file
+
+import libs = libcutl%lib{cutl}
+
+exe{driver}: cxx{driver} $libs
+exe{driver}: test.output = output.std
diff --git a/tests/container/buildfile b/tests/container/buildfile
new file mode 100644
index 0000000..3ddbe33
--- /dev/null
+++ b/tests/container/buildfile
@@ -0,0 +1,7 @@
+# file : tests/container/buildfile
+# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC
+# license : MIT; see accompanying LICENSE file
+
+d = multi-index/
+./: $d
+include $d
diff --git a/tests/container/multi-index/buildfile b/tests/container/multi-index/buildfile
new file mode 100644
index 0000000..b42351c
--- /dev/null
+++ b/tests/container/multi-index/buildfile
@@ -0,0 +1,7 @@
+# file : tests/container/multi-index/buildfile
+# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC
+# license : MIT; see accompanying LICENSE file
+
+import libs = libcutl%lib{cutl}
+
+exe{driver}: cxx{driver} $libs
diff --git a/tests/fs/buildfile b/tests/fs/buildfile
new file mode 100644
index 0000000..8f1ad67
--- /dev/null
+++ b/tests/fs/buildfile
@@ -0,0 +1,7 @@
+# file : tests/fs/buildfile
+# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC
+# license : MIT; see accompanying LICENSE file
+
+d = path/
+./: $d
+include $d
diff --git a/tests/fs/path/buildfile b/tests/fs/path/buildfile
new file mode 100644
index 0000000..dd9b1fe
--- /dev/null
+++ b/tests/fs/path/buildfile
@@ -0,0 +1,7 @@
+# file : tests/fs/path/buildfile
+# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC
+# license : MIT; see accompanying LICENSE file
+
+import libs = libcutl%lib{cutl}
+
+exe{driver}: cxx{driver} $libs
diff --git a/tests/re/buildfile b/tests/re/buildfile
new file mode 100644
index 0000000..d31eb62
--- /dev/null
+++ b/tests/re/buildfile
@@ -0,0 +1,8 @@
+# file : tests/re/buildfile
+# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC
+# license : MIT; see accompanying LICENSE file
+
+import libs = libcutl%lib{cutl}
+
+exe{driver}: cxx{driver} $libs
+exe{driver}: test = false # @@ TMP, fails.
diff --git a/tests/shared-ptr/buildfile b/tests/shared-ptr/buildfile
new file mode 100644
index 0000000..fc6fe06
--- /dev/null
+++ b/tests/shared-ptr/buildfile
@@ -0,0 +1,7 @@
+# file : tests/shared-ptr/buildfile
+# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC
+# license : MIT; see accompanying LICENSE file
+
+import libs = libcutl%lib{cutl}
+
+exe{driver}: cxx{driver} $libs