aboutsummaryrefslogtreecommitdiff
path: root/tests/common.testscript
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2018-09-03 16:37:32 +0200
committerKaren Arutyunov <karen@codesynthesis.com>2018-09-04 16:29:59 +0300
commit5007870b52aa549971824959a55ad3bb886f09e0 (patch)
treeb0ef7f24c0b9ece2ed23f3c1792f16da324e4171 /tests/common.testscript
parent09d60452a80d14d9b8bf3a9395860b50683fa1e8 (diff)
Rename .test/test{} to .testscript/testscript{}
Diffstat (limited to 'tests/common.testscript')
-rw-r--r--tests/common.testscript45
1 files changed, 45 insertions, 0 deletions
diff --git a/tests/common.testscript b/tests/common.testscript
new file mode 100644
index 0000000..369c798
--- /dev/null
+++ b/tests/common.testscript
@@ -0,0 +1,45 @@
+# file : tests/common.testscript
+# copyright : Copyright (c) 2014-2018 Code Synthesis Ltd
+# license : MIT; see accompanying LICENSE file
+
+# Commonly-used build system test project setup and driver command line.
+#
+
+# If the includer indicated that no cross-testing should be supported, then
+# use the build system driver that is building, not the one being built.
+#
+# In many cases expecting a cross-compiled driver to perform a native build
+# under emulation is pushing things a bit too far. Plus, we have no way of
+# knowing the native compiler name/path.
+#
+# So the idea here is to test cross-compilation with the understanding that
+# the build system driver we are testing is not the one being cross-compiled
+# but rather the one doing the cross-compilation.
+#
+if ($null($crosstest))
+ crosstest = true
+end
+
+if (!$crosstest && $test.target != $build.host)
+ test = $recall($build.path)
+end
+
+# Common bootstrap.build.
+#
++mkdir build
++cat <<EOI >=build/bootstrap.build
+project = test
+amalgamation =
+EOI
+
+test.options += --serial-stop --quiet
+
+if ($null($buildfile) || !$buildfile)
+ test.options += --buildfile -
+end
+
+# By default just load the buildfile.
+#
+if ($null($test.arguments))
+ test.arguments = noop
+end