aboutsummaryrefslogtreecommitdiff
path: root/tests/common.testscript
blob: ae54fe2aed12347637d25460699335d87af19621 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# file      : tests/common.testscript
# copyright : Copyright (c) 2014-2019 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 += --no-default-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