diff options
Diffstat (limited to 'tests/pkg-configure.testscript')
-rw-r--r-- | tests/pkg-configure.testscript | 92 |
1 files changed, 83 insertions, 9 deletions
diff --git a/tests/pkg-configure.testscript b/tests/pkg-configure.testscript index cab52fa..8430cec 100644 --- a/tests/pkg-configure.testscript +++ b/tests/pkg-configure.testscript @@ -1,5 +1,4 @@ # file : tests/pkg-configure.testscript -# copyright : Copyright (c) 2014-2019 Code Synthesis Ltd # license : MIT; see accompanying LICENSE file # Here we test both pkg-configure and pkg-disfigure commands. @@ -36,6 +35,9 @@ # | | |-- driver.cxx # | | `-- test.out # | `-- version +# | +# |-- t8a (see pkg-build for details) +# | # `-- stable # |-- libbar-1.0.0.tar.gz -> libfoo # |-- libbar-1.1.0.tar.gz -> libfoo >= 1.1.0 @@ -49,7 +51,7 @@ # Prepare repositories used by tests if running in the local mode. # -+if ($remote != true) ++if! $remote rep_create += 2>! # Create the signed 'hello' repository. @@ -64,9 +66,11 @@ # cp -r $src/stable $out/stable $rep_create $out/stable &$out/stable/packages.manifest + + cp -r $src/t8a $out/t8a && $rep_create $out/t8a &$out/t8a/packages.manifest end -test.arguments += config.cxx=$quote($recall($cxx.path) $cxx.mode, true) +test.arguments += config.cxx=$quote($recall($cxx.path) $cxx.config.mode) pkg_disfigure += -d cfg pkg_fetch += -d cfg 2>! @@ -272,6 +276,11 @@ if ($posix && "$uid" != '0') : dependency-management : { + # Remove the config.cxx variable override to avoid the 'dropping no longer + # used variable' warning. + # + test.arguments = $regex.filter_out_match($test.arguments, 'config.cxx=.*') + +$clone_cfg && $rep_add $rep/stable && $rep_fetch --trust-yes : still-has-deps @@ -281,7 +290,7 @@ if ($posix && "$uid" != '0') $pkg_fetch libbar/1.0.0 && $pkg_unpack libbar; $* libbar 2>>EOE != 0; - error: no configured package satisfies dependency on libfoo + error: unable to satisfy dependency on libfoo EOE $pkg_status libbar/1.0.0 1>'libbar unpacked 1.0.0'; @@ -289,14 +298,14 @@ if ($posix && "$uid" != '0') $pkg_unpack libfoo; $* libbar 2>>EOE != 0; - error: no configured package satisfies dependency on libfoo + error: unable to satisfy dependency on libfoo EOE $* libfoo 2>'configured libfoo/1.0.0'; $* libbar 2>'configured libbar/1.0.0'; $pkg_disfigure libfoo 2>>EOE != 0; - error: package libfoo still has dependencies: + error: package libfoo still has dependents: info: package libbar EOE @@ -318,7 +327,7 @@ if ($posix && "$uid" != '0') $pkg_unpack libbar; $* libbar 2>>EOE != 0; - error: no configured package satisfies dependency on libfoo >= 1.1.0 + error: unable to satisfy dependency on libfoo >= 1.1.0 EOE $pkg_disfigure libfoo 2>'disfigured libfoo/1.0.0'; @@ -345,7 +354,7 @@ if ($posix && "$uid" != '0') $pkg_unpack libbar; $* libbar 2>>EOE != 0; - error: no configured package satisfies dependency on libfox | libfoo >= 1.2.0 + error: unable to satisfy dependency on libfox | libfoo >= 1.2.0 EOE $pkg_disfigure libfoo 2>'disfigured libfoo/1.1.0'; @@ -356,7 +365,7 @@ if ($posix && "$uid" != '0') $* libbar 2>'configured libbar/1.2.0'; $pkg_disfigure libfoo 2>>EOE != 0; - error: package libfoo still has dependencies: + error: package libfoo still has dependents: info: package libbar on libfoo >= 1.2.0 EOE @@ -412,3 +421,68 @@ if ($posix && "$uid" != '0') test -d cfg/libhello != 0 } } + +: dependency-alternatives +: +{ + # Remove the config.cxx variable override to avoid the 'dropping no longer + # used variable' warning. + # + test.arguments = $regex.filter_out_match($test.arguments, 'config.cxx=.*') + + +$clone_root_cfg && $rep_add $rep/t8a && $rep_fetch --trust-yes + + : multiple-dependencies + : + { + $clone_cfg; + + $pkg_fetch foo/1.0.0 && $pkg_unpack foo; + + $pkg_fetch libbar/1.0.0 && $pkg_unpack libbar; + $* libbar 2>!; + + # Make sure that dependent configuration fails if some of the alternative + # dependencies is not configured. + # + $* foo 2>>EOE != 0; + error: unable to satisfy dependency on {libbar ^1.0.0 libbaz ^1.0.0} + EOE + + $pkg_fetch libbaz/1.0.0 && $pkg_unpack libbaz; + $* libbaz 2>!; + + $* foo 2>'configured foo/1.0.0'; + + $pkg_disfigure foo 2>!; + $pkg_purge foo 2>!; + $pkg_disfigure libbaz 2>!; + $pkg_purge libbaz 2>!; + $pkg_disfigure libbar 2>!; + $pkg_purge libbar 2>! + } + + : reflect + : + { + $clone_cfg; + + $pkg_fetch fox/1.0.0 && $pkg_unpack fox; + $pkg_fetch libbaz/1.0.0 && $pkg_unpack libbaz; + + $* libbaz 2>!; + + $* fox 2>'configured fox/1.0.0'; + + cat cfg/fox-1.0.0/build/config.build >>~%EOO%; + %.* + config.fox.backend = libbaz + %.* + EOO + + $pkg_disfigure fox 2>!; + $pkg_purge fox 2>!; + $pkg_disfigure libbaz 2>!; + $pkg_purge libbaz 2>! + } +} |