pkg-config/check/check-print-options
Philip Withnall 2ad16fa7ac pkg: Make ordering of output from print_package_list() deterministic
The iteration order of GHashTable changed in GLib 2.59, which broke the
check-print-options test, as it relied on a fixed output order from the
--list-all argument to pkg-config.

Fix that by making print_package_list() output in alphabetical order by
Package.key; and update the test to match. This should work with older
and newer versions of GLib.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-04-03 13:04:38 +01:00

62 lines
1.6 KiB
Bash
Executable file

#! /bin/sh
set -e
. ${srcdir}/common
# --version
RESULT=$PACKAGE_VERSION
run_test --version
# --modversion
RESULT=1.0.0
run_test --modversion simple
# --print-variables, make sure having no variables doesn't crash
RESULT="pcfiledir"
run_test --print-variables no-variables
RESULT="exec_prefix
includedir
libdir
pcfiledir
prefix"
run_test --print-variables simple
# --print-provides
RESULT="simple = 1.0.0"
run_test --print-provides simple
# --print-requires
RESULT="public-dep >= 1"
run_test --print-requires requires-test
# --print-requires-private
RESULT="private-dep >= 1"
run_test --print-requires-private requires-test
# --list-all, limit to a subdirectory
RESULT="broken Broken package - Module with broken .pc file
sub1 Subdirectory package 1 - Test package 1 for subdirectory
sub2 Subdirectory package 2 - Test package 2 for subdirectory"
PKG_CONFIG_LIBDIR="$srcdir/sub" run_test --list-all
# Check handling when multiple incompatible options are set
RESULT="Ignoring incompatible output option \"--modversion\"
$PACKAGE_VERSION"
run_test --version --modversion simple
RESULT="Ignoring incompatible output option \"--version\"
1.0.0"
run_test --modversion --version simple
# --print-requires/--print-requires-private allowed together
RESULT="public-dep >= 1
private-dep >= 1"
run_test --print-requires --print-requires-private requires-test
run_test --print-requires-private --print-requires requires-test
# --exists and --atleast/exact/max-version can be mixed
RESULT=""
run_test --exists --atleast-version=1.0.0 simple
run_test --exists --exact-version=1.0.0 simple
run_test --exists --max-version=1.0.0 simple