aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libbbot/build-config.cxx16
-rw-r--r--libbbot/build-config.hxx3
-rw-r--r--tests/buildtab/testscript20
3 files changed, 23 insertions, 16 deletions
diff --git a/libbbot/build-config.cxx b/libbbot/build-config.cxx
index c46cffd..01ce57e 100644
--- a/libbbot/build-config.cxx
+++ b/libbbot/build-config.cxx
@@ -75,14 +75,6 @@ namespace bbot
config.name = move (tl[i].value);
- // Make sure the name is unique.
- //
- for (const auto& c: r)
- {
- if (c.name == config.name)
- bad_line ("duplicate configuration name");
- }
-
if (++i == n)
bad_line ("no target found");
@@ -116,6 +108,14 @@ namespace bbot
bad_line (e.what ());
}
+ // Make sure the name/target combination is unique.
+ //
+ for (const auto& c: r)
+ {
+ if (c.name == config.name && c.target == config.target)
+ bad_line ("duplicate configuration name/target");
+ }
+
if (++i == n)
bad_line ("no classes found");
diff --git a/libbbot/build-config.hxx b/libbbot/build-config.hxx
index e4bb5cb..473e5d8 100644
--- a/libbbot/build-config.hxx
+++ b/libbbot/build-config.hxx
@@ -55,6 +55,9 @@ namespace bbot
//
// <machine-pattern> <config> <target>[/<environment>] <classes> [<config-arg>]* [<warning-regex>]*
//
+ // Note that each <config>/<target> pair is expected to be unique in the
+ // buildtab.
+ //
using butl::tab_parsing;
LIBBBOT_EXPORT build_configs
diff --git a/tests/buildtab/testscript b/tests/buildtab/testscript
index c9b5389..5631527 100644
--- a/tests/buildtab/testscript
+++ b/tests/buildtab/testscript
@@ -6,11 +6,13 @@
: Roundtrip buildtab.
:
{
- : all-fileds-combinations
+ : all-fields-combinations
:
$* <<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}: "
+ windows*-vc_14* windows-vc_14 i686-microsoft-win32-msvc14.0 all
+ windows*-vc_14* windows-vc_14-debug i686-microsoft-win32-msvc14.0 "" config.cc.coptions=/Z7 config.cc.loptions=/DEBUG ~"warning C4\d{3}: "
+
+ windows*-vc_14* windows-vc_14 x86_64-microsoft-win32-msvc14.0 all
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+
@@ -21,8 +23,9 @@
windows_10*-clang_9.0_msvc_16.3 windows_10-clang_9.0_msvc_16.3_lld x86_64-microsoft-win32-msvc14.2/lld "all default windows clang"
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}: "
+ windows*-vc_14* windows-vc_14 i686-microsoft-win32-msvc14.0 all
+ windows*-vc_14* windows-vc_14-debug i686-microsoft-win32-msvc14.0 "" config.cc.coptions=/Z7 config.cc.loptions=/DEBUG ~"warning C4\d{3}: "
+ windows*-vc_14* windows-vc_14 x86_64-microsoft-win32-msvc14.0 all
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
@@ -57,9 +60,10 @@
: 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 2>'cin:3:31: error: duplicate configuration name/target' == 1
+ windows*-vc_14* windows-vc_14 i686-microsoft-win32-msvc14.0 default
+ windows*-vc_14* windows-vc_14 x86_64-microsoft-win32-msvc14.0 default
+ windows*-vc_14* windows-vc_14 i686-microsoft-win32-msvc14.0 default
EOI
}