aboutsummaryrefslogtreecommitdiff
path: root/tests/cc/libu
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-07-27 14:45:05 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-07-27 14:45:05 +0200
commitbf959a7fc119f9156c4b84c9d0a10900d9153f8d (patch)
treed19b96238f58e305d936d186901edd1cf98e0c93 /tests/cc/libu
parent24f74ea70a19ccd7bcb489853fc73a972ab8638f (diff)
Initial infrastructure for utility libraries
Diffstat (limited to 'tests/cc/libu')
-rw-r--r--tests/cc/libu/buildfile8
-rw-r--r--tests/cc/libu/testscript54
2 files changed, 62 insertions, 0 deletions
diff --git a/tests/cc/libu/buildfile b/tests/cc/libu/buildfile
new file mode 100644
index 0000000..104a645
--- /dev/null
+++ b/tests/cc/libu/buildfile
@@ -0,0 +1,8 @@
+# file : tests/cc/libu/buildfile
+# copyright : Copyright (c) 2014-2017 Code Synthesis Ltd
+# license : MIT; see accompanying LICENSE file
+
+# Test utility library support.
+#
+
+./: test{testscript} $b
diff --git a/tests/cc/libu/testscript b/tests/cc/libu/testscript
new file mode 100644
index 0000000..454a443
--- /dev/null
+++ b/tests/cc/libu/testscript
@@ -0,0 +1,54 @@
+# file : tests/cc/libu/testscript
+# copyright : Copyright (c) 2014-2017 Code Synthesis Ltd
+# license : MIT; see accompanying LICENSE file
+
+crosstest = false
+test.arguments = config.cxx="$recall($cxx.path)"
+
+.include ../../common.test
+
++cat <<EOI >=build/root.build
+cxx.std = latest
+
+using cxx
+
+hxx{*}: extension = hxx
+cxx{*}: extension = cxx
+EOI
+
+# Common source files that are symlinked in the test directories if used.
+#
++cat <<EOI >=foo.hxx
+ #ifndef LIBFOO_EXPORT
+ # define LIBFOO_EXPORT
+ #endif
+
+ LIBFOO_EXPORT void f ();
+ EOI
+
++cat <<EOI >=foo.cxx
+ void f () {}
+ EOI
+
++cat <<EOI >=driver.cxx
+ #include <foo.hxx>
+ int main () {f ();}
+ EOI
+
+: members
+:
+: Test building individual libuX{} members.
+:
+ln -s ../foo.hxx ../foo.cxx ../driver.cxx ./;
+$* update clean <<EOI
+ cc.poptions += "-I$src_base"
+
+ # {exe liba libs}{foo}
+ ./: {exe}{foo}
+
+ exe{foo}: cxx{driver} libue{foo}
+ liba{foo}: libua{foo}
+ libs{foo}: libus{foo}
+
+ libu{foo}: cxx{foo}
+ EOI