aboutsummaryrefslogtreecommitdiff
path: root/tests/pkg-configure.testscript
diff options
context:
space:
mode:
Diffstat (limited to 'tests/pkg-configure.testscript')
-rw-r--r--tests/pkg-configure.testscript85
1 files changed, 80 insertions, 5 deletions
diff --git a/tests/pkg-configure.testscript b/tests/pkg-configure.testscript
index 841f0ad..8430cec 100644
--- a/tests/pkg-configure.testscript
+++ b/tests/pkg-configure.testscript
@@ -35,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
@@ -63,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>!
@@ -271,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
@@ -280,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';
@@ -288,7 +298,7 @@ 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';
@@ -317,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';
@@ -344,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';
@@ -411,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>!
+ }
+}