aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2018-06-20 13:10:42 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2018-06-20 13:10:42 +0200
commit8dd0d1d048cc7ed073b6eeb5b5cba442142125ad (patch)
treeec8757d15331e19be435b424d24011b646292586
parentc91a6abc0d9c84c94e44a8f64de5485601b970ea (diff)
Add few basic tests
-rw-r--r--build/export.build10
-rw-r--r--buildfile3
-rw-r--r--tests/.gitignore2
-rw-r--r--tests/build/.gitignore3
-rw-r--r--tests/build/bootstrap.build9
-rw-r--r--tests/build/root.build12
-rw-r--r--tests/buildfile5
-rw-r--r--tests/testscript22
8 files changed, 65 insertions, 1 deletions
diff --git a/build/export.build b/build/export.build
new file mode 100644
index 0000000..1a79cb1
--- /dev/null
+++ b/build/export.build
@@ -0,0 +1,10 @@
+# file : build/export.build
+# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC
+# license : GNU GPL v3; see accompanying LICENSE file
+
+$out_root/
+{
+ include odb/
+}
+
+export $out_root/odb/exe{odb}
diff --git a/buildfile b/buildfile
index a2ec726..5a541d2 100644
--- a/buildfile
+++ b/buildfile
@@ -4,6 +4,7 @@
./: {*/ -build/ -m4/} doc{GPLv3 INSTALL LICENSE NEWS README} manifest
-# Don't install the INSTALL file.
+# Don't install tests or the INSTALL file.
#
+tests/: install = false
doc{INSTALL}@./: install = false
diff --git a/tests/.gitignore b/tests/.gitignore
new file mode 100644
index 0000000..35ec43f
--- /dev/null
+++ b/tests/.gitignore
@@ -0,0 +1,2 @@
+test/
+test-*/
diff --git a/tests/build/.gitignore b/tests/build/.gitignore
new file mode 100644
index 0000000..4a730a3
--- /dev/null
+++ b/tests/build/.gitignore
@@ -0,0 +1,3 @@
+config.build
+root/
+bootstrap/
diff --git a/tests/build/bootstrap.build b/tests/build/bootstrap.build
new file mode 100644
index 0000000..65ab7b7
--- /dev/null
+++ b/tests/build/bootstrap.build
@@ -0,0 +1,9 @@
+# file : tests/build/bootstrap.build
+# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC
+# license : GNU GPL v3; 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..3c04aa5
--- /dev/null
+++ b/tests/build/root.build
@@ -0,0 +1,12 @@
+# file : tests/build/root.build
+# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC
+# license : GNU GPL v3; see accompanying LICENSE file
+
+# Import the ODB compiler we will be testing.
+#
+import odb = odb%exe{odb}
+test{*}: test = $odb
+
+# Specify the test target for cross-testing.
+#
+test.target = $cxx.target
diff --git a/tests/buildfile b/tests/buildfile
new file mode 100644
index 0000000..524c399
--- /dev/null
+++ b/tests/buildfile
@@ -0,0 +1,5 @@
+# file : tests/buildfile
+# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC
+# license : GNU GPL v3; see accompanying LICENSE file
+
+./: testscript $odb
diff --git a/tests/testscript b/tests/testscript
new file mode 100644
index 0000000..516aa5b
--- /dev/null
+++ b/tests/testscript
@@ -0,0 +1,22 @@
+# file : tests/testscript
+# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC
+# license : GNU GPL v3; see accompanying LICENSE file
+
+: version
+:
+$* --version >>~/EOO/
+/ODB object-relational mapping \(ORM\) compiler for C\+\+ .+/
+/.*/*
+EOO
+
+: plugin
+:
+: To actually compile anything we need libodb. However, we can smoke-test the
+: plugin loading and invocation using the --trace option that suppresses the
+: standard prologue/epilogue (which includes the libodb headers).
+:
+touch empty.hxx;
+$* -d sqlite --trace empty.hxx 2>>~/EOE/ != 0
+/.*/*
+empty.hxx: error: unable to resolve odb namespace
+EOE