From b740417add06a6df0dff65b60fbd92a8c8d95aab Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Fri, 7 Dec 2018 15:29:59 +0300 Subject: Add support for build configuration class inheritance --- tests/buildtab/driver.cxx | 22 +++--- tests/buildtab/testscript | 171 ++++++++++++++++++++++++++++++++-------------- 2 files changed, 132 insertions(+), 61 deletions(-) (limited to 'tests/buildtab') 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 - 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 + $* <>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 - windows*-vc_14* windows-vc_14-32 i686-microsoft-win32-msvc14.0 default - EOF - - : multiple-classes - : - $* <>EOF - windows*-vc_14* windows-vc_14-32 i686-microsoft-win32-msvc14.0 "all default" - EOF } : parse-errors : { - : no-name + : name : - $* <>EOE == 1 - windows*-vc_14* - EOI - cin:1:16: error: no configuration name found - EOE + { + : none + : + $* <>EOE == 1 + windows*-vc_14* + EOI + cin:1:16: error: no configuration name found + EOE - : no-target - : - $* <>EOE == 1 - windows*-vc_14* windows-vc_14-32 - EOI - cin:1:33: error: no target found - EOE + : dup + : + $* <'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 : - $* <>EOE == 1 - windows*-vc_14* windows-vc_14-32 microsoft - EOI - cin:1:34: error: missing cpu - EOE + { + : none + : + $* <>EOE == 1 + windows*-vc_14* windows-vc_14-32 + EOI + cin:1:33: error: no target found + EOE - : invalid-class - : - $* <>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 + : + $* <>EOE == 1 + windows*-vc_14* windows-vc_14-32 microsoft + EOI + cin:1:34: error: missing cpu + EOE + } - : invalid-var + : class : { - : unquoted + : invalid + : + $* <>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 + : + $* <>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 + : + $* <>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 + : + $* <>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 : $* <>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 + : + $* <>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 : - $* <'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 + : + $* <>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 + } + } } -- cgit v1.1