From d6f50b34977cead4bd1e0bd4fe49e5e5b6f2bdd3 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Fri, 25 Nov 2022 21:46:04 +0300 Subject: Add support for package manifest build config group values override --- tests/overrides/driver.cxx | 18 ++++- tests/overrides/testscript | 165 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 180 insertions(+), 3 deletions(-) (limited to 'tests/overrides') diff --git a/tests/overrides/driver.cxx b/tests/overrides/driver.cxx index be3e0ff..62ac7f8 100644 --- a/tests/overrides/driver.cxx +++ b/tests/overrides/driver.cxx @@ -33,7 +33,7 @@ main (int argc, char* argv[]) { vector overrides; - bool name (false); + string name; uint64_t l (1); for (int i (1); i != argc; ++i) @@ -42,7 +42,7 @@ main (int argc, char* argv[]) if (a == "-n") { - name = true; + name = "args"; } else { @@ -78,7 +78,19 @@ main (int argc, char* argv[]) try { package_manifest m (p); - m.override (overrides, name ? "args" : string ()); + m.override (overrides, name); + + // While at it, test validate_overrides(). + // + try + { + package_manifest::validate_overrides (overrides, name); + } + catch (const manifest_parsing& e) + { + assert (false); // Validation must never fail if override succeeds. + } + m.serialize (s); } catch (const manifest_parsing& e) diff --git a/tests/overrides/testscript b/tests/overrides/testscript index babe57d..95a5593 100644 --- a/tests/overrides/testscript +++ b/tests/overrides/testscript @@ -35,6 +35,10 @@ builds: default build-include: linux* build-exclude: *; Only supports Linux. + network-build-config: config.libfoo.network=true + network-builds: default + network-build-include: linux* + network-build-exclude: * EOI : 1 name: libfoo @@ -42,6 +46,7 @@ summary: Modern C++ parser license: LGPLv2 builds: gcc + network-build-config: config.libfoo.network=true EOO : build-include-exclude @@ -54,6 +59,10 @@ license: LGPLv2 builds: default build-exclude: freebsd* + network-build-config: config.libfoo.network=true + network-builds: default + network-build-include: linux* + network-build-exclude: * EOI : 1 name: libfoo @@ -63,6 +72,7 @@ builds: default build-include: linux* build-exclude: *; Only supports Linux. + network-build-config: config.libfoo.network=true EOO : builds-build-include-exclude @@ -86,6 +96,96 @@ build-exclude: *; Only supports Linux. EOO + : build-configs + : + $* 'network-builds: all' 'network-build-include: windows*' 'network-build-exclude: *' \ + 'cache-build-include: freebsd*' 'cache-build-exclude: *' 'cache-builds: legacy' \ + 'sys-build-include: linux*' 'sys-build-exclude: *' \ + 'fancy-builds: gcc' <>EOO + : 1 + name: libfoo + version: 2.0.0 + summary: Modern C++ parser + license: LGPLv2 + builds: all + build-include: linux* + build-include: macos* + build-include: freebsd* + build-exclude: * + network-build-config: config.libfoo.network=true + network-builds: default + network-build-include: linux* + network-build-exclude: * + cache-build-config: config.libfoo.cache=true + cache-builds: default + cache-build-include: macos* + cache-build-exclude: * + sys-build-config: ?sys:libcrypto + sys-builds: default + sys-build-include: freebsd* + sys-build-exclude: * + older-build-config: ?libbar/1.0.0 + older-builds: default + older-build-include: windows* + older-build-exclude: * + fancy-build-config: config.libfoo.fancy=true + fancy-builds: default + fancy-build-include: windows* + fancy-build-exclude: * + EOI + : 1 + name: libfoo + version: 2.0.0 + summary: Modern C++ parser + license: LGPLv2 + builds: all + build-include: linux* + build-include: macos* + build-include: freebsd* + build-exclude: * + default-builds: none + network-build-config: config.libfoo.network=true + network-builds: all + network-build-include: windows* + network-build-exclude: * + cache-build-config: config.libfoo.cache=true + cache-builds: legacy + cache-build-include: freebsd* + cache-build-exclude: * + sys-build-config: ?sys:libcrypto + sys-builds: default + sys-build-include: linux* + sys-build-exclude: * + older-build-config: ?libbar/1.0.0 + older-builds: none + fancy-build-config: config.libfoo.fancy=true + fancy-builds: gcc + EOO + + + : build-config-default + : + $* 'default-builds: all' 'default-build-include: windows*' 'default-build-exclude: *' <>EOO + : 1 + name: libfoo + version: 2.0.0 + summary: Modern C++ parser + license: LGPLv2 + network-build-config: config.libfoo.network=true + network-builds: all + EOI + : 1 + name: libfoo + version: 2.0.0 + summary: Modern C++ parser + license: LGPLv2 + default-builds: all + default-build-include: windows* + default-build-exclude: * + network-build-config: config.libfoo.network=true + network-builds: none + EOO + : none : $* <>EOO @@ -141,4 +241,69 @@ EOI args:2:8: error: invalid package builds: unexpected underlying class set EOE + + + : no-build-config + : + $* 'network-builds: default' <>EOE != 0 + : 1 + name: libfoo + version: 2.0.0 + summary: Modern C++ parser + license: LGPLv2 + EOI + cannot override 'network-builds' value: no build package configuration 'network' + EOE + + : config-builds-after-builds + : + $* 'builds: all' 'network-builds: default' <>EOE != 0 + : 1 + name: libfoo + version: 2.0.0 + summary: Modern C++ parser + license: LGPLv2 + network-build-config: config.libfoo.network=true + EOI + 'network-builds' override specified together with 'builds' override + EOE + + : config-builds-after-build-exclude + : + $* 'build-exclude: *' 'network-builds: default' <>EOE != 0 + : 1 + name: libfoo + version: 2.0.0 + summary: Modern C++ parser + license: LGPLv2 + network-build-config: config.libfoo.network=true + EOI + 'network-builds' override specified together with 'build-exclude' override + EOE + + : builds-after-config-builds + : + $* 'network-builds: default' 'builds: all' <>EOE != 0 + : 1 + name: libfoo + version: 2.0.0 + summary: Modern C++ parser + license: LGPLv2 + network-build-config: config.libfoo.network=true + EOI + 'builds' override specified together with 'network-builds' override + EOE + + : build-exclude-after-config-builds + : + $* 'network-builds: default' 'build-exclude: *' <>EOE != 0 + : 1 + name: libfoo + version: 2.0.0 + summary: Modern C++ parser + license: LGPLv2 + network-build-config: config.libfoo.network=true + EOI + 'build-exclude' override specified together with 'network-builds' override + EOE } -- cgit v1.1