aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2018-12-07 15:29:59 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2018-12-11 14:03:09 +0300
commitb740417add06a6df0dff65b60fbd92a8c8d95aab (patch)
treee07e9a6e7c2f39164ff8bba7b6ee933679bf99aa /tests
parent1d977345398584ff774990cf436289ddd64d2b42 (diff)
Add support for build configuration class inheritance
Diffstat (limited to 'tests')
-rw-r--r--tests/buildtab/driver.cxx22
-rw-r--r--tests/buildtab/testscript171
2 files changed, 132 insertions, 61 deletions
diff --git a/tests/buildtab/driver.cxx b/tests/buildtab/driver.cxx
index 5242fe4..604aaa9 100644
--- a/tests/buildtab/driver.cxx
+++ b/tests/buildtab/driver.cxx
@@ -26,26 +26,32 @@ try
cin.exceptions (ios::failbit | ios::badbit);
cout.exceptions (ios::failbit | ios::badbit);
- for (const build_config& c: parse_buildtab (cin, "cin"))
+ const build_configs& configs (parse_buildtab (cin, "cin"));
+
+ for (const build_config& c: configs)
{
cout << c.machine_pattern << ' ' << c.name << ' ' << c.target;
string classes;
- for (const string& cs: c.classes)
+ for (const string& cls: c.classes)
{
if (!classes.empty ())
classes += ' ';
- classes += cs;
+ classes += cls;
+
+ auto i (configs.class_inheritance_map.find (cls));
+ if (i != configs.class_inheritance_map.end ())
+ classes += ':' + i->second;
}
- if (c.classes.size () > 1)
- cout << " \"" << classes << '"';
- else
+ if (c.classes.size () == 1)
cout << ' ' << classes;
+ else
+ cout << " \"" << classes << '"';
- for (const string& v: c.vars)
- cout << ' ' << v;
+ for (const string& a: c.args)
+ cout << ' ' << a;
for (const string& r: c.warning_regexes)
cout << " ~" << r;
diff --git a/tests/buildtab/testscript b/tests/buildtab/testscript
index 511d284..e029d47 100644
--- a/tests/buildtab/testscript
+++ b/tests/buildtab/testscript
@@ -9,10 +9,24 @@
{
: all-fileds-combinations
:
- $* <<EOF >>EOF
- windows*-vc_14* windows-vc_14-32 i686-microsoft-win32-msvc14.0 default
- windows*-vc_14* windows-vc_14-32-debug i686-microsoft-win32-msvc14.0 default config.cc.coptions=/Z7 config.cc.loptions=/DEBUG ~"warning C4\d{3}: "
- EOF
+ $* <<EOI >>EOO
+ windows*-vc_14* windows-vc_14-32 i686-microsoft-win32-msvc14.0 all
+ windows*-vc_14* windows-vc_14-32-debug i686-microsoft-win32-msvc14.0 "" config.cc.coptions=/Z7 config.cc.loptions=/DEBUG ~"warning C4\d{3}: "
+
+ linux_debian_8*-gcc_4.9 linux_debian_8-gcc_4.9 x86_64-linux-gnu "all default linux gcc gcc-4+:gcc-3+"
+ - - - gcc-5+:gcc-4+
+ - - - gcc-6+:gcc-5+
+ linux_debian_9*-gcc_7.3 linux_debian_9-gcc_7.3 x86_64-linux-gnu "all default linux gcc gcc-7+:gcc-6+"
+ linux_debian_9*-gcc_7.3 linux_debian_9-gcc_7.3-O3 x86_64-linux-gnu "all default linux gcc optimized gcc-7+" config.cc.coptions=-O3
+ linux_debian_9*-gcc_8.1 linux_debian_9-gcc_8.1 x86_64-linux-gnu "all default linux gcc gcc-8+:gcc-7+"
+ EOI
+ windows*-vc_14* windows-vc_14-32 i686-microsoft-win32-msvc14.0 all
+ windows*-vc_14* windows-vc_14-32-debug i686-microsoft-win32-msvc14.0 "" config.cc.coptions=/Z7 config.cc.loptions=/DEBUG ~"warning C4\d{3}: "
+ linux_debian_8*-gcc_4.9 linux_debian_8-gcc_4.9 x86_64-linux-gnu "all default linux gcc gcc-4+:gcc-3+"
+ linux_debian_9*-gcc_7.3 linux_debian_9-gcc_7.3 x86_64-linux-gnu "all default linux gcc gcc-7+:gcc-6+"
+ linux_debian_9*-gcc_7.3 linux_debian_9-gcc_7.3-O3 x86_64-linux-gnu "all default linux gcc optimized gcc-7+:gcc-6+" config.cc.coptions=-O3
+ linux_debian_9*-gcc_8.1 linux_debian_9-gcc_8.1 x86_64-linux-gnu "all default linux gcc gcc-8+:gcc-7+"
+ EOO
: empty-lines
:
@@ -23,71 +37,122 @@
EOI
windows*-vc_14* windows-vc_14-32-debug i686-microsoft-win32-msvc14.0 default
EOO
-
- : single-class
- :
- $* <<EOF >>EOF
- windows*-vc_14* windows-vc_14-32 i686-microsoft-win32-msvc14.0 default
- EOF
-
- : multiple-classes
- :
- $* <<EOF >>EOF
- windows*-vc_14* windows-vc_14-32 i686-microsoft-win32-msvc14.0 "all default"
- EOF
}
: parse-errors
:
{
- : no-name
+ : name
:
- $* <<EOI 2>>EOE == 1
- windows*-vc_14*
- EOI
- cin:1:16: error: no configuration name found
- EOE
+ {
+ : none
+ :
+ $* <<EOI 2>>EOE == 1
+ windows*-vc_14*
+ EOI
+ cin:1:16: error: no configuration name found
+ EOE
- : no-target
- :
- $* <<EOI 2>>EOE == 1
- windows*-vc_14* windows-vc_14-32
- EOI
- cin:1:33: error: no target found
- EOE
+ : dup
+ :
+ $* <<EOI 2>'cin:2:17: error: duplicate configuration name' == 1
+ windows*-vc_14* windows-vc_14-32 i686-microsoft-win32-msvc14.0 default
+ windows*-vc_14* windows-vc_14-32 i686-microsoft-win32-msvc14.0 default
+ EOI
+ }
- : invalid-target
+ : target
:
- $* <<EOI 2>>EOE == 1
- windows*-vc_14* windows-vc_14-32 microsoft
- EOI
- cin:1:34: error: missing cpu
- EOE
+ {
+ : none
+ :
+ $* <<EOI 2>>EOE == 1
+ windows*-vc_14* windows-vc_14-32
+ EOI
+ cin:1:33: error: no target found
+ EOE
- : invalid-class
- :
- $* <<EOI 2>>EOE == 1
- windows*-vc_14* windows-vc_14-32 i686-microsoft-win32-msvc14.0 a=b
- EOI
- cin:1:64: error: class name 'a=b' contains '='
- EOE
+ : invalid
+ :
+ $* <<EOI 2>>EOE == 1
+ windows*-vc_14* windows-vc_14-32 microsoft
+ EOI
+ cin:1:34: error: missing cpu
+ EOE
+ }
- : invalid-var
+ : class
:
{
- : unquoted
+ : invalid
+ :
+ $* <<EOI 2>>EOE == 1
+ windows*-vc_14* windows-vc_14-32 i686-microsoft-win32-msvc14.0 a=b
+ EOI
+ cin:1:64: error: class name 'a=b' contains '='
+ EOE
+
+ : none
+ :
+ $* <<EOI 2>>EOE == 1
+ windows*-vc_14* windows-vc_14-32 i686-microsoft-win32-msvc14.0 none
+ EOI
+ cin:1:64: error: class 'none' is reserved
+ EOE
+
+ : self-inheritance
+ :
+ $* <<EOI 2>>EOE == 1
+ windows*-vc_14* windows-vc_14-O i686-microsoft-win32-msvc14.0 "msvc-14+:msvc-14+"
+ EOI
+ cin:1:63: error: inheritance cycle in 'msvc-14+' class inheritance
+ EOE
+
+ : inheritance-cycle
+ :
+ $* <<EOI 2>>EOE == 1
+ windows*-vc_14* windows-vc_14-32 i686-microsoft-win32-msvc14.0 msvc-14+:msvc-13+
+ windows*-vc_13* windows-vc_13-32 i686-microsoft-win32-msvc13.0 msvc-13+:msvc-14+
+ EOI
+ cin:2:64: error: inheritance cycle in 'msvc-13+' class inheritance
+ EOE
+
+ : base-mismatch
:
$* <<EOI 2>>EOE == 1
- windows*-vc_14* windows-vc_14-32 i686-microsoft-win32-msvc14.0 default config.cc.coptions="/Z7
- EOI
- cin:1:95: error: unterminated quoted string
- EOE
+ windows*-vc_12* windows-vc_12 i686-microsoft-win32-msvc12.0 msvc-12+
+ windows*-vc_13* windows-vc_13 i686-microsoft-win32-msvc13.0 msvc-13+:msvc-12+
+ windows*-vc_14* windows-vc_14 i686-microsoft-win32-msvc14.0 msvc-14+:msvc-13+
+ windows*-vc_14* windows-vc_14-O i686-microsoft-win32-msvc14.0 "msvc-14+:msvc-12+ optimized"
+ EOI
+ cin:4:63: error: 'msvc-14+' new base 'msvc-12+' does not match existing 'msvc-13+'
+ EOE
+
+ : base-mismatch-nobase
+ :
+ $* <<EOI 2>>EOE == 1
+ windows*-vc_12* windows-vc_12 i686-microsoft-win32-msvc12.0 msvc-12+
+ windows*-vc_13* windows-vc_13 i686-microsoft-win32-msvc13.0 msvc-13+:msvc-12+
+ windows*-vc_14* windows-vc_14 i686-microsoft-win32-msvc14.0 msvc-14+
+ windows*-vc_14* windows-vc_14-O i686-microsoft-win32-msvc14.0 "msvc-14+:msvc-13+ optimized"
+ EOI
+ cin:4:63: error: 'msvc-14+' new base 'msvc-13+' does not match existing ''
+ EOE
}
- : dup-config-name
+ : var
:
- $* <<EOI 2>'cin:2:17: error: duplicate configuration name' == 1
- windows*-vc_14* windows-vc_14-32 i686-microsoft-win32-msvc14.0 default
- windows*-vc_14* windows-vc_14-32 i686-microsoft-win32-msvc14.0 default
- EOI
+ {
+ : invalid
+ :
+ {
+ : unquoted
+ :
+ $* <<EOI 2>>EOE == 1
+ windows*-vc_14* windows-vc_14-32 i686-microsoft-win32-msvc14.0 default config.cc.coptions="/Z7
+ EOI
+ cin:1:95: error: unterminated quoted string
+ EOE
+ }
+ }
}