mirror of
https://gitlab.freedesktop.org/pkg-config/pkg-config.git
synced 2025-12-20 04:20:04 +01:00
This happened basically by accident before when "pkg-config foo" was run because the code wouldn't find any options set and just fall through to the end after processing the package arguments. However, it would act differently in that Requires.private was only enabled with an explicit --exists.
74 lines
1.9 KiB
Bash
Executable file
74 lines
1.9 KiB
Bash
Executable file
#! /bin/sh
|
|
|
|
set -e
|
|
|
|
. ${srcdir}/common
|
|
|
|
# non-existent package; call should fail and cause no output
|
|
EXPECT_RETURN=1
|
|
RESULT=""
|
|
run_test --exists pkg-non-existent
|
|
|
|
# existing package, but with missing Requires
|
|
EXPECT_RETURN=1
|
|
RESULT=""
|
|
run_test --exists missing-requires
|
|
|
|
# tests below are on an existing package, but with missing Requires.private;
|
|
# when pkg-config outputs error, the actual error text isn't checked
|
|
# package exists, but should fail since deps can't be resolved
|
|
EXPECT_RETURN=1
|
|
RESULT=""
|
|
run_test --exists missing-requires-private
|
|
|
|
# get Libs
|
|
EXPECT_RETURN=0
|
|
RESULT="-L/missing-requires-private/lib -lmissing-requires-private"
|
|
if [ "$list_indirect_deps" = no ]; then
|
|
run_test --libs missing-requires-private
|
|
fi
|
|
|
|
# Libs.private should fail (verbosely, but the output isn't verified)
|
|
EXPECT_RETURN=1
|
|
RESULT=""
|
|
if [ "$list_indirect_deps" = yes ]; then
|
|
run_test --silence-errors --libs missing-requires-private
|
|
fi
|
|
run_test --silence-errors --static --libs missing-requires-private
|
|
|
|
# Cflags.private should fail (verbosely, but the output isn't verified)
|
|
EXPECT_RETURN=1
|
|
RESULT=""
|
|
run_test --silence-errors --static --cflags missing-requires-private
|
|
|
|
# Cflags should fail (verbosely, but the output isn't verified)
|
|
EXPECT_RETURN=1
|
|
RESULT=""
|
|
run_test --silence-errors --cflags missing-requires-private
|
|
|
|
# get includedir var
|
|
EXPECT_RETURN=0
|
|
RESULT="/usr/include/somedir"
|
|
run_test --variable includedir missing-requires-private
|
|
|
|
# tests below are on an existing package, but with missing Requires;
|
|
# when pkg-config outputs error, the actual error text isn't checked
|
|
# package exists
|
|
EXPECT_RETURN=1
|
|
RESULT=""
|
|
run_test missing-requires
|
|
|
|
# Libs should fail
|
|
EXPECT_RETURN=1
|
|
RESULT=""
|
|
run_test --silence-errors --libs missing-requires
|
|
|
|
# Cflags should fail
|
|
EXPECT_RETURN=1
|
|
RESULT=""
|
|
run_test --silence-errors --cflags missing-requires
|
|
|
|
# get includedir var
|
|
EXPECT_RETURN=0
|
|
RESULT="/usr/include/somedir"
|
|
run_test --variable includedir missing-requires
|