mirror of
https://github.com/pkgconf/pkgconf.git
synced 2026-01-27 01:44:34 +00:00
tests: basic: port over another set of tests
Signed-off-by: Ariadne Conill <ariadne@ariadne.space>
This commit is contained in:
parent
ecbedee413
commit
7bbdf301e7
@ -27,6 +27,10 @@ EXTRA_DIST = pkg.m4 \
|
||||
t/basic/libs.test \
|
||||
t/basic/libs-cflags.test \
|
||||
t/basic/libs-cflags-version.test \
|
||||
t/basic/libs-cflags-version-multiple.test \
|
||||
t/basic/libs-cflags-version-multiple-comma.test \
|
||||
t/basic/libs-cflags-version-not.test \
|
||||
t/basic/libs-cflags-version-not-provided.test \
|
||||
tests/lib-relocatable/lib/pkgconfig/foo.pc \
|
||||
tests/lib1/argv-parse-2.pc \
|
||||
tests/lib1/billion-laughs.pc \
|
||||
|
||||
5
t/basic/libs-cflags-version-multiple-comma.test
Normal file
5
t/basic/libs-cflags-version-multiple-comma.test
Normal file
@ -0,0 +1,5 @@
|
||||
PackageSearchPath: lib1
|
||||
Query: foo > 1.2,bar >= 1.3
|
||||
WantedFlags: libs cflags
|
||||
ExpectedExitCode: 0
|
||||
ExpectedStdout: -fPIC -I/test/include/foo -L/test/lib -lbar -lfoo
|
||||
5
t/basic/libs-cflags-version-multiple.test
Normal file
5
t/basic/libs-cflags-version-multiple.test
Normal file
@ -0,0 +1,5 @@
|
||||
PackageSearchPath: lib1
|
||||
Query: foo > 1.2 bar >= 1.3
|
||||
WantedFlags: libs cflags
|
||||
ExpectedExitCode: 0
|
||||
ExpectedStdout: -fPIC -I/test/include/foo -L/test/lib -lbar -lfoo
|
||||
6
t/basic/libs-cflags-version-not-provided.test
Normal file
6
t/basic/libs-cflags-version-not-provided.test
Normal file
@ -0,0 +1,6 @@
|
||||
PackageSearchPath: lib1
|
||||
Query: foo != 1.2.3
|
||||
WantedFlags: libs cflags
|
||||
ExpectedExitCode: 1
|
||||
MatchStderr: partial
|
||||
ExpectedStderr: Package 'foo' has version '1.2.3', required version is '!= 1.2.3'
|
||||
5
t/basic/libs-cflags-version-not.test
Normal file
5
t/basic/libs-cflags-version-not.test
Normal file
@ -0,0 +1,5 @@
|
||||
PackageSearchPath: lib1
|
||||
Query: foo != 1.3.0
|
||||
WantedFlags: libs cflags
|
||||
ExpectedExitCode: 0
|
||||
ExpectedStdout: -fPIC -I/test/include/foo -L/test/lib -lfoo
|
||||
@ -3,14 +3,6 @@
|
||||
. $(atf_get_srcdir)/test_env.sh
|
||||
|
||||
tests_init \
|
||||
noargs \
|
||||
libs \
|
||||
libs_cflags \
|
||||
libs_cflags_version \
|
||||
libs_cflags_version_multiple \
|
||||
libs_cflags_version_alt \
|
||||
libs_cflags_version_different \
|
||||
libs_cflags_version_different_bad \
|
||||
libs_env \
|
||||
exists_nonexitent \
|
||||
nonexitent \
|
||||
@ -52,79 +44,6 @@ tests_init \
|
||||
variable_no_recurse \
|
||||
tuple_env
|
||||
|
||||
noargs_body()
|
||||
{
|
||||
export PKG_CONFIG_PATH="${selfdir}/lib1"
|
||||
atf_check -s exit:1 -e ignore pkgconf
|
||||
}
|
||||
|
||||
libs_body()
|
||||
{
|
||||
export PKG_CONFIG_PATH="${selfdir}/lib1"
|
||||
atf_check \
|
||||
-o inline:"-L/test/lib -lfoo\n" \
|
||||
pkgconf --libs foo
|
||||
}
|
||||
|
||||
libs_cflags_body()
|
||||
{
|
||||
export PKG_CONFIG_PATH="${selfdir}/lib1"
|
||||
atf_check \
|
||||
-o inline:"-fPIC -I/test/include/foo -L/test/lib -lfoo\n" \
|
||||
pkgconf --cflags --libs foo
|
||||
}
|
||||
|
||||
atf_test_case basic_libs_cflags_version
|
||||
libs_cflags_version_body()
|
||||
{
|
||||
export PKG_CONFIG_PATH="${selfdir}/lib1"
|
||||
atf_check \
|
||||
-o inline:"-fPIC -I/test/include/foo -L/test/lib -lfoo\n" \
|
||||
pkgconf --cflags --libs 'foo > 1.2'
|
||||
}
|
||||
|
||||
libs_cflags_version_multiple_body()
|
||||
{
|
||||
export PKG_CONFIG_PATH="${selfdir}/lib1"
|
||||
atf_check \
|
||||
-o inline:"-fPIC -I/test/include/foo -L/test/lib -lbar -lfoo\n" \
|
||||
pkgconf --cflags --libs 'foo > 1.2 bar >= 1.3'
|
||||
}
|
||||
|
||||
libs_cflags_version_multiple_coma_body()
|
||||
{
|
||||
export PKG_CONFIG_PATH="${selfdir}/lib1"
|
||||
atf_check \
|
||||
-o inline:"-fPIC -I/test/include/foo -L/test/lib -lbar -lfoo\n" \
|
||||
pkgconf --cflags --libs 'foo > 1.2,bar >= 1.3'
|
||||
}
|
||||
|
||||
libs_cflags_version_alt_body()
|
||||
{
|
||||
export PKG_CONFIG_PATH="${selfdir}/lib1"
|
||||
atf_check \
|
||||
-o inline:"-fPIC -I/test/include/foo -L/test/lib -lfoo\n" \
|
||||
pkgconf --cflags --libs 'foo' '>' '1.2'
|
||||
}
|
||||
|
||||
libs_cflags_version_different_body()
|
||||
{
|
||||
export PKG_CONFIG_PATH="${selfdir}/lib1"
|
||||
atf_check \
|
||||
-o inline:"-fPIC -I/test/include/foo -L/test/lib -lfoo\n" \
|
||||
pkgconf --cflags --libs 'foo' '!=' '1.3.0'
|
||||
}
|
||||
|
||||
atf_test_case basic_libs_cflags_version_different_bad
|
||||
libs_cflags_version_different_bad_body()
|
||||
{
|
||||
export PKG_CONFIG_PATH="${selfdir}/lib1"
|
||||
atf_check \
|
||||
-s exit:1 \
|
||||
-e inline:"Package dependency requirement 'foo != 1.2.3' could not be satisfied.\nPackage 'foo' has version '1.2.3', required version is '!= 1.2.3'\n" \
|
||||
pkgconf --cflags --libs 'foo' '!=' '1.2.3'
|
||||
}
|
||||
|
||||
exists_nonexitent_body()
|
||||
{
|
||||
export PKG_CONFIG_PATH="${selfdir}/lib1"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user