From 5c2bee67f7f06e976bf3e7e03134a7dddc245a3a Mon Sep 17 00:00:00 2001 From: Baptiste Daroussin Date: Sun, 18 Sep 2016 22:48:13 +0200 Subject: [PATCH 1/7] Add Kyua tests --- Kyuafile => Kyuafile.in | 0 Makefile.am | 35 ++++- configure.ac | 4 +- tests/Kyuafile | 5 - tests/Kyuafile.in | 13 ++ tests/basic.sh | 271 ++++++++++++++++++++++++++++++++++++ tests/builtins.sh | 68 +++++++++ tests/conflicts.sh | 23 ++++ tests/framework.sh | 20 +++ tests/parser.sh | 91 ++++++++++++ tests/provides.sh | 298 ++++++++++++++++++++++++++++++++++++++++ tests/regress.sh | 68 +++++++++ tests/requires.sh | 79 +++++++++++ tests/sysroot.sh | 28 ++++ tests/test_env.sh.in | 22 +++ tests/version.sh | 38 +++++ 16 files changed, 1049 insertions(+), 14 deletions(-) rename Kyuafile => Kyuafile.in (100%) delete mode 100644 tests/Kyuafile create mode 100644 tests/Kyuafile.in create mode 100755 tests/basic.sh create mode 100755 tests/builtins.sh create mode 100755 tests/conflicts.sh create mode 100755 tests/framework.sh create mode 100755 tests/parser.sh create mode 100755 tests/provides.sh create mode 100755 tests/regress.sh create mode 100755 tests/requires.sh create mode 100755 tests/sysroot.sh create mode 100644 tests/test_env.sh.in create mode 100755 tests/version.sh diff --git a/Kyuafile b/Kyuafile.in similarity index 100% rename from Kyuafile rename to Kyuafile.in diff --git a/Makefile.am b/Makefile.am index 0c679b2..3d687d2 100644 --- a/Makefile.am +++ b/Makefile.am @@ -11,9 +11,7 @@ AM_CFLAGS = -Wall -Wextra -Wformat=2 -std=gnu99 -DPKG_DEFAULT_PATH=\"$(pkgconfig bin_PROGRAMS = pkgconf lib_LTLIBRARIES = libpkgconf.la -EXTRA_DIST = Kyuafile \ - tests/Kyuafile \ - pkg.m4 \ +EXTRA_DIST = pkg.m4 \ tests/lib1/argv-parse-2.pc \ tests/lib1/dos-lineendings.pc \ tests/lib1/paren-quoting.pc \ @@ -57,7 +55,25 @@ EXTRA_DIST = Kyuafile \ tests/lib1/depgraph-break.pc \ tests/lib1/cflags-whitespace.pc \ tests/lib1/provides.pc \ - tests/lib1/provides-request-simple.pc + tests/lib1/provides-request-simple.pc \ + tests/test_env.sh \ + $(test_scripts) + +test_scripts= \ + tests/basic.sh \ + tests/builtins.sh \ + tests/conflicts.sh \ + tests/framework.sh \ + tests/parser.sh \ + tests/provides.sh \ + tests/regress.sh \ + tests/requires.sh \ + tests/sysroot.sh \ + tests/version.sh + +check_SCRIPTS= $(test_scripts:.sh=) + +SUFFIXES= .sh pkginclude_HEADERS = libpkgconf/bsdstubs.h libpkgconf/iter.h libpkgconf/libpkgconf.h libpkgconf/stdinc.h libpkgconf_la_SOURCES = \ @@ -84,7 +100,12 @@ dist_doc_DATA = README.md AUTHORS m4datadir = $(datadir)/aclocal m4data_DATA = pkg.m4 -CLEANFILES = $(EXTRA_PROGRAMS) +CLEANFILES = $(EXTRA_PROGRAMS) \ + $(check_SCRIPTS) -check: pkgconf - $(SHELL) tests/run.sh ./pkgconf +check: pkgconf $(check_SCRIPTS) + kyua --config=none test --kyuafile='$(top_builddir)/Kyuafile' \ + --build-root='$(top_builddir)' + +.sh: + install -m 755 $< $@ diff --git a/configure.ac b/configure.ac index 68305df..926028b 100644 --- a/configure.ac +++ b/configure.ac @@ -16,7 +16,7 @@ AC_INIT([pkgconf], [1.0.1], [http://github.com/pkgconf/pkgconf/issues]) AC_CONFIG_SRCDIR([main.c]) AC_CONFIG_HEADERS([libpkgconf/config.h]) AC_CHECK_FUNCS([strlcpy strlcat strndup strtok_r]) -AM_INIT_AUTOMAKE([foreign dist-xz subdir-objects]) +AM_INIT_AUTOMAKE([foreign no-dist-gzip dist-xz subdir-objects]) AM_SILENT_RULES([yes]) LT_INIT @@ -62,5 +62,5 @@ AC_PROG_CC AC_PROG_INSTALL AC_PROG_LN_S -AC_CONFIG_FILES([Makefile tests/run.sh]) +AC_CONFIG_FILES([Makefile Kyuafile tests/Kyuafile tests/test_env.sh]) AC_OUTPUT diff --git a/tests/Kyuafile b/tests/Kyuafile deleted file mode 100644 index a8c90c1..0000000 --- a/tests/Kyuafile +++ /dev/null @@ -1,5 +0,0 @@ -syntax(2) - -test_suite('pkgconf') - -plain_test_program{name='run.sh'} diff --git a/tests/Kyuafile.in b/tests/Kyuafile.in new file mode 100644 index 0000000..0b53da7 --- /dev/null +++ b/tests/Kyuafile.in @@ -0,0 +1,13 @@ +syntax(2) + +test_suite('pkgconf') + +atf_test_program{name='basic'} +atf_test_program{name='requires'} +atf_test_program{name='regress'} +atf_test_program{name='parser'} +atf_test_program{name='sysroot'} +atf_test_program{name='conflicts'} +atf_test_program{name='version'} +atf_test_program{name='framework'} +atf_test_program{name='provides'} diff --git a/tests/basic.sh b/tests/basic.sh new file mode 100755 index 0000000..3195b1d --- /dev/null +++ b/tests/basic.sh @@ -0,0 +1,271 @@ +#!/usr/bin/env atf-sh + +. $(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 \ + exists_nonexitent \ + nonexitent \ + exists_version \ + exists_version_bad \ + exists_version_bad2 \ + exists_version_bad3 \ + exists \ + exists2 \ + exists3 \ + exists_version_alt \ + uninstalled_bad \ + uninstalled \ + libs_intermediary \ + libs_circular1 \ + libs_circular2 \ + libs_circular_directpc \ + libs_static \ + pkg_config_path \ + nolibs \ + nocflags \ + arbitary_path + +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:"-I/test/include/foo -fPIC -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:"-I/test/include/foo -fPIC -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" + atf_check \ + -s exit:1 \ + pkgconf --exists nonexistant +} + +nonexitent_body() +{ + export PKG_CONFIG_PATH="${selfdir}/lib1" + atf_check \ + -s exit:1 \ + pkgconf nonexistant +} + +exists_version_body() +{ + export PKG_CONFIG_PATH="${selfdir}/lib1" + atf_check \ + pkgconf --exists 'foo > 1.2' +} + +exists_version_bad_body() +{ + export PKG_CONFIG_PATH="${selfdir}/lib1" + atf_check \ + -s exit:1 \ + pkgconf --exists 'foo > 1.2.3' +} + +exists_version_alt_body() +{ + export PKG_CONFIG_PATH="${selfdir}/lib1" + atf_check \ + pkgconf --exists 'foo' '>' '1.2' +} + +uninstalled_bad_body() +{ + export PKG_CONFIG_PATH="${selfdir}/lib1" + atf_check \ + -s exit:1 \ + pkgconf --uninstalled 'foo' +} + +uninstalled_body() +{ + export PKG_CONFIG_PATH="${selfdir}/lib1" + atf_check \ + pkgconf --uninstalled 'omg' +} + +exists_version_bad2_body() +{ + export PKG_CONFIG_PATH="${selfdir}/lib1" + atf_check \ + -s exit:1 \ + pkgconf --exists 'foo >= ' +} + +exists_version_bad3_body() +{ + export PKG_CONFIG_PATH="${selfdir}/lib1" + atf_check \ + -s exit:1 \ + pkgconf --exists 'tilde <= 1.0.0' +} + +exists_body() +{ + export PKG_CONFIG_PATH="${selfdir}/lib1" + atf_check \ + pkgconf --exists 'tilde = 1.0.0~rc1' +} + +exists2_body() +{ + export PKG_CONFIG_PATH="${selfdir}/lib1" + atf_check \ + pkgconf --exists 'tilde >= 1.0.0' +} + +exists3_body() +{ + export PKG_CONFIG_PATH="${selfdir}/lib1" + atf_check \ + pkgconf --exists '' 'foo' +} + +libs_intermediary_body() +{ + export PKG_CONFIG_PATH="${selfdir}/lib1" + atf_check \ + -o inline:"-lintermediary-1 -lintermediary-2 -lfoo -lbar -lbaz \n" \ + pkgconf --libs intermediary-1 intermediary-2 +} + +libs_circular1_body() +{ + export PKG_CONFIG_PATH="${selfdir}/lib1" + atf_check \ + -o inline:"-lcircular-1 -lcircular-2 -lcircular-3 \n" \ + pkgconf --libs circular-1 +} + +libs_circular2_body() +{ + export PKG_CONFIG_PATH="${selfdir}/lib1" + atf_check \ + -o inline:"-lcircular-3 -lcircular-1 -lcircular-2 \n" \ + pkgconf --libs circular-3 +} + +libs_circular_directpc_body() +{ + atf_check \ + -o inline:"-lcircular-1 -lcircular-2 -lcircular-3 \n" \ + pkgconf --libs ${selfdir}/lib1/circular-3.pc +} + +libs_static_body() +{ + export PKG_CONFIG_PATH="${selfdir}/lib1" + atf_check \ + -o inline:"/libfoo.a -pthread \n" \ + pkgconf --libs static-archive-libs +} + +pkg_config_path_body() +{ + export PKG_CONFIG_PATH="${selfdir}/lib1${PATH_SEP}${selfdir}/lib2" + atf_check \ + -o inline:"-L/test/lib -lfoo \n" \ + pkgconf --libs foo + atf_check \ + -o inline:"-L/test/lib -lbar -lfoo \n" \ + pkgconf --libs bar +} + +nolibs_body() +{ + export PKG_CONFIG_PATH="${selfdir}/lib1" + atf_check \ + -o inline:" \n" \ + pkgconf --libs nolib +} + +nocflags_body() +{ + export PKG_CONFIG_PATH="${selfdir}/lib1" + atf_check \ + -o inline:" \n" \ + pkgconf --cflags nocflag +} + +arbitary_path_body() +{ + cp ${selfdir}/lib1/foo.pc . + atf_check \ + -o inline:"-L/test/lib -lfoo \n" \ + pkgconf --libs foo.pc +} diff --git a/tests/builtins.sh b/tests/builtins.sh new file mode 100755 index 0000000..6c23fb5 --- /dev/null +++ b/tests/builtins.sh @@ -0,0 +1,68 @@ +#!/usr/bin/env atf-sh + +. $(atf_get_srcdir)/test_env.sh + +tests_init \ + modversion \ + variable \ + define_variable \ + global_variable + +modversion_body() +{ + export PKG_CONFIG_PATH="${selfdir}/lib1" + atf_check \ + -o inline:"1.0.1 \n" \ + pkgconf --modversion pkg-config +} + +variable_body() +{ + export PKG_CONFIG_PATH="${selfdir}/lib1" + atf_check \ + -o inline:"/test \n" \ + pkgconf --variable=prefix foo +} + +define_variable_body() +{ + export PKG_CONFIG_PATH="${selfdir}/lib1" + atf_check \ + -o inline:"/test2 \n" \ + pkgconf --define-variable=prefix=/test2 --variable=prefix foo +} + +global_variable_body() +{ + export PKG_CONFIG_PATH="${selfdir}/lib1" + atf_check \ + -o inline:"${selfdir}/lib1 \n" + pkgconf --exists -foo +} + +argv_parse_3_body() +{ + export PKG_CONFIG_PATH="${selfdir}/lib1" + atf_check \ + -o inline:"-llib-1 -pthread /test/lib/lib2.so \n" \ + pkgconf --libs argv-parse-3 +} + +tilde_quoting_body() +{ + export PKG_CONFIG_PATH="${selfdir}/lib1" + atf_check \ + -o inline:"-L~ -ltilde \n" \ + pkgconf --libs tilde-quoting + atf_check \ + -o inline:"-I~ \n" \ + pkgconf --cflags tilde-quoting +} + +paren_quoting_body() +{ + export PKG_CONFIG_PATH="${selfdir}/lib1" + atf_check \ + -o inline:"-L\$(libdir) -ltilde \n" \ + pkgconf --libs paren-quoting +} diff --git a/tests/conflicts.sh b/tests/conflicts.sh new file mode 100755 index 0000000..cd5c5d8 --- /dev/null +++ b/tests/conflicts.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env atf-sh + +. $(atf_get_srcdir)/test_env.sh + +tests_init \ + libs \ + ignore + +libs_body() +{ + export PKG_CONFIG_PATH="${selfdir}/lib1" + atf_check \ + -o inline:"-L/test/lib -lconflicts \n" \ + pkgconf --libs conflicts +} + +ignore_body() +{ + export PKG_CONFIG_PATH="${selfdir}/lib1" + atf_check \ + -o inline:"-L/test/lib -lconflicts \n" \ + pkgconf --ignore-conflicts --libs conflicts +} diff --git a/tests/framework.sh b/tests/framework.sh new file mode 100755 index 0000000..602c6d4 --- /dev/null +++ b/tests/framework.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env atf-sh + +. $(atf_get_srcdir)/test_env.sh + +tests_init \ + libs + +libs_body() +{ + export PKG_CONFIG_PATH="${selfdir}/lib1" + atf_check \ + -o inline:"-F/test/lib -framework framework-1 \n" \ + pkgconf --libs framework-1 + atf_check \ + -o inline:"-F/test/lib -framework framework-2 -F/test/lib -framework framework-1 \n" \ + pkgconf --libs framework-2 + atf_check \ + -o inline:"-F/test/lib -framework framework-1 -F/test/lib -framework framework-2 \n" \ + pkgconf --libs framework-1 framework-2 +} diff --git a/tests/parser.sh b/tests/parser.sh new file mode 100755 index 0000000..1ed0f80 --- /dev/null +++ b/tests/parser.sh @@ -0,0 +1,91 @@ +#!/usr/bin/env atf-sh + +. $(atf_get_srcdir)/test_env.sh + +tests_init \ + dos \ + no_trailing_newline \ + argv_parse \ + bad_option \ + argv_parse_3 \ + tilde_quoting \ + paren_quoting \ + multiline_field \ + quoted + +dos_body() +{ + export PKG_CONFIG_PATH="${selfdir}/lib1" + atf_check \ + -o inline:"-L/test/lib/dos-lineendings -ldos-lineendings \n" \ + pkgconf --libs dos-lineendings +} + +no_trailing_newline_body() +{ + export PKG_CONFIG_PATH="${selfdir}/lib1" + atf_check \ + -o inline:"-I/test/include/no-trailing-newline \n" \ + pkgconf --cflags no-trailing-newline +} + +argv_parse_body() +{ + export PKG_CONFIG_PATH="${selfdir}/lib1" + atf_check \ + -o inline:"-llib-3 -llib-1 -llib-2 -lpthread \n" \ + pkgconf --libs argv-parse +} + +bad_option_body() +{ + export PKG_CONFIG_PATH="${selfdir}/lib1" + atf_check \ + -e ignore \ + -s eq:1 \ + pkgconf --exists -foo +} + +argv_parse_3_body() +{ + export PKG_CONFIG_PATH="${selfdir}/lib1" + atf_check \ + -o inline:"-llib-1 -pthread /test/lib/lib2.so \n" \ + pkgconf --libs argv-parse-3 +} + +tilde_quoting_body() +{ + export PKG_CONFIG_PATH="${selfdir}/lib1" + atf_check \ + -o inline:"-L~ -ltilde \n" \ + pkgconf --libs tilde-quoting + atf_check \ + -o inline:"-I~ \n" \ + pkgconf --cflags tilde-quoting +} + +paren_quoting_body() +{ + export PKG_CONFIG_PATH="${selfdir}/lib1" + atf_check \ + -o inline:"-L\$(libdir) -ltilde \n" \ + pkgconf --libs paren-quoting +} + +multiline_field_body() +{ + export PKG_CONFIG_PATH="${selfdir}/lib1" + atf_check \ + -e ignore \ + -o match:"multiline description" \ + pkgconf --list-all +} + +quoted_body() +{ + export PKG_CONFIG_PATH="${selfdir}/lib1" + atf_check \ + -o inline:"-DQUOTED=\\\"bla\\\" \n" \ + pkgconf --cflags quotes +} diff --git a/tests/provides.sh b/tests/provides.sh new file mode 100755 index 0000000..9a5e108 --- /dev/null +++ b/tests/provides.sh @@ -0,0 +1,298 @@ +#!/usr/bin/env atf-sh + +. $(atf_get_srcdir)/test_env.sh + +tests_init \ + simple \ + foo \ + bar \ + baz \ + quux \ + moo \ + meow + +simple_body() +{ + export PKG_CONFIG_PATH="${selfdir}/lib1" +OUTPUT="provides-test-foo = 1.0.0 +provides-test-bar > 1.1.0 +provides-test-baz >= 1.1.0 +provides-test-quux < 1.2.0 +provides-test-moo <= 1.2.0 +provides-test-meow != 1.3.0 +provides = 1.2.3 +" + atf_check \ + -o inline:"${OUTPUT}" \ + pkgconf --print-provides provides + atf_check \ + -o inline:"-lfoo \n" \ + pkgconf --libs provides-request-simple + atf_check \ + -e ignore \ + -s exit:1 \ + pkgconf --no-provides --libs provides-request-simple +} + +foo_body() +{ + export PKG_CONFIG_PATH="${selfdir}/lib1" + atf_check \ + -o ignore \ + pkgconf --libs provides-test-foo + atf_check \ + -o ignore \ + pkgconf --libs 'provides-test-foo = 1.0.0' + atf_check \ + -o ignore \ + pkgconf --libs 'provides-test-foo >= 1.0.0' + atf_check \ + -o ignore \ + pkgconf --libs 'provides-test-foo <= 1.0.0' + atf_check \ + -s exit:1 \ + -e ignore \ + -o ignore \ + pkgconf --libs 'provides-test-foo != 1.0.0' + atf_check \ + -s exit:1 \ + -e ignore \ + -o ignore \ + pkgconf --libs 'provides-test-foo > 1.0.0' + atf_check \ + -s exit:1 \ + -e ignore \ + -o ignore \ + pkgconf --libs 'provides-test-foo < 1.0.0' +} + +bar_body() +{ + export PKG_CONFIG_PATH="${selfdir}/lib1" + atf_check \ + -o ignore \ + pkgconf --libs provides-test-bar + atf_check \ + -o ignore \ + pkgconf --libs 'provides-test-bar = 1.1.1' + atf_check \ + -o ignore \ + pkgconf --libs 'provides-test-bar >= 1.1.1' + atf_check \ + -o ignore \ + pkgconf --libs 'provides-test-bar <= 1.1.1' + atf_check \ + -o ignore \ + pkgconf --libs 'provides-test-bar != 1.1.0' + atf_check \ + -s exit:1 \ + -e ignore \ + -o ignore \ + pkgconf --libs 'provides-test-bar != 1.1.1' + atf_check \ + -o ignore \ + pkgconf --libs 'provides-test-bar > 1.1.1' + atf_check \ + -s exit:1 \ + -e ignore \ + -o ignore \ + pkgconf --libs 'provides-test-bar <= 1.1.0' + atf_check \ + -o ignore \ + pkgconf --libs 'provides-test-bar <= 1.2.0' +} + +baz_body() +{ + export PKG_CONFIG_PATH="${selfdir}/lib1" + atf_check \ + -o ignore \ + pkgconf --libs provides-test-baz + atf_check \ + -o ignore \ + pkgconf --libs 'provides-test-baz = 1.1.0' + atf_check \ + -o ignore \ + pkgconf --libs 'provides-test-baz >= 1.1.0' + atf_check \ + -o ignore \ + pkgconf --libs 'provides-test-baz <= 1.1.0' + atf_check \ + -s exit:1 \ + -e ignore \ + -o ignore \ + pkgconf --libs 'provides-test-baz != 1.1.0' + atf_check \ + -o ignore \ + pkgconf --libs 'provides-test-baz != 1.0.0' + atf_check \ + -o ignore \ + pkgconf --libs 'provides-test-baz > 1.1.1' + atf_check \ + -o ignore \ + pkgconf --libs 'provides-test-baz > 1.1.0' + atf_check \ + -s exit:1 \ + -e ignore \ + -o ignore \ + pkgconf --libs 'provides-test-baz < 1.1.0' + atf_check \ + -o ignore \ + pkgconf --libs 'provides-test-baz < 1.2.0' +} + +quux_body() +{ + export PKG_CONFIG_PATH="${selfdir}/lib1" + atf_check \ + -o ignore \ + pkgconf --libs provides-test-quux + atf_check \ + -o ignore \ + pkgconf --libs 'provides-test-quux = 1.1.9' + atf_check \ + -o ignore \ + pkgconf --libs 'provides-test-quux >= 1.1.0' + atf_check \ + -o ignore \ + pkgconf --libs 'provides-test-quux >= 1.1.9' + atf_check \ + -s exit:1 \ + -e ignore \ + -o ignore \ + pkgconf --libs 'provides-test-quux >= 1.2.0' + atf_check \ + -s exit:1 \ + -e ignore \ + -o ignore \ + pkgconf --libs 'provides-test-quux <= 1.2.0' + atf_check \ + -o ignore \ + pkgconf --libs 'provides-test-quux <= 1.1.9' + atf_check \ + -o ignore \ + pkgconf --libs 'provides-test-quux != 1.2.0' + atf_check \ + -s exit:1 \ + -e ignore \ + -o ignore \ + pkgconf --libs 'provides-test-quux != 1.1.0' + atf_check \ + -s exit:1 \ + -e ignore \ + -o ignore \ + pkgconf --libs 'provides-test-quux != 1.0.0' + atf_check \ + -o ignore \ + pkgconf --libs 'provides-test-quux > 1.1.9' + atf_check \ + -s exit:1 \ + -e ignore \ + -o ignore \ + pkgconf --libs 'provides-test-quux > 1.2.0' + atf_check \ + -o ignore \ + pkgconf --libs 'provides-test-quux < 1.1.0' + atf_check \ + -s exit:1 \ + -e ignore \ + -o ignore \ + pkgconf --libs 'provides-test-quux > 1.2.0' +} + +moo_body() +{ + export PKG_CONFIG_PATH="${selfdir}/lib1" + atf_check \ + -o ignore \ + pkgconf --libs provides-test-moo + atf_check \ + -o ignore \ + pkgconf --libs 'provides-test-moo = 1.2.0' + atf_check \ + -o ignore \ + pkgconf --libs 'provides-test-moo >= 1.1.0' + atf_check \ + -o ignore \ + pkgconf --libs 'provides-test-moo >= 1.2.0' + atf_check \ + -s exit:1 \ + -e ignore \ + -o ignore \ + pkgconf --libs 'provides-test-moo >= 1.2.1' + atf_check \ + -o ignore \ + pkgconf --libs 'provides-test-moo <= 1.2.0' + atf_check \ + -s exit:1 \ + -e ignore \ + -o ignore \ + pkgconf --libs 'provides-test-moo != 1.1.0' + atf_check \ + -s exit:1 \ + -e ignore \ + -o ignore \ + pkgconf --libs 'provides-test-moo != 1.0.0' + atf_check \ + -o ignore \ + pkgconf --libs 'provides-test-moo > 1.1.9' + atf_check \ + -s exit:1 \ + -e ignore \ + -o ignore \ + pkgconf --libs 'provides-test-moo > 1.2.0' + atf_check \ + -o ignore \ + pkgconf --libs 'provides-test-moo < 1.1.0' + atf_check \ + -o ignore \ + pkgconf --libs 'provides-test-moo < 1.2.0' +} + +meow_body() +{ + export PKG_CONFIG_PATH="${selfdir}/lib1" + atf_check \ + -o ignore \ + pkgconf --libs provides-test-meow + atf_check \ + -s exit:1 \ + -e ignore \ + -o ignore \ + pkgconf --libs 'provides-test-meow = 1.3.0' + atf_check \ + -o ignore \ + pkgconf --libs 'provides-test-meow != 1.3.0' + atf_check \ + -s exit:1 \ + -e ignore \ + -o ignore \ + pkgconf --libs 'provides-test-meow > 1.2.9' + atf_check \ + -s exit:1 \ + -e ignore \ + -o ignore \ + pkgconf --libs 'provides-test-meow < 1.3.1' + atf_check \ + -o ignore \ + pkgconf --libs 'provides-test-meow < 1.3.0' + atf_check \ + -o ignore \ + pkgconf --libs 'provides-test-meow > 1.3.0' + atf_check \ + -s exit:1 \ + -e ignore \ + -o ignore \ + pkgconf --libs 'provides-test-meow >= 1.3.0' + atf_check \ + -o ignore \ + pkgconf --libs 'provides-test-meow >= 1.3.1' + atf_check \ + -s exit:1 \ + -e ignore \ + -o ignore \ + pkgconf --libs 'provides-test-meow <= 1.3.0' + atf_check \ + -o ignore \ + pkgconf --libs 'provides-test-meow < 1.2.9' +} diff --git a/tests/regress.sh b/tests/regress.sh new file mode 100755 index 0000000..ac53e0d --- /dev/null +++ b/tests/regress.sh @@ -0,0 +1,68 @@ +#!/usr/bin/env atf-sh + +. $(atf_get_srcdir)/test_env.sh + +tests_init \ + variable \ + keep_system_libs \ + libs \ + libs_only \ + cflags_only \ + incomplete_libs \ + incomplete_cflags + +variable_body() +{ + export PKG_CONFIG_PATH="${selfdir}/lib1" + atf_check \ + -o inline:"/test/include\n" \ + pkgconf --variable=includedir foo +} + +keep_system_libs_body() +{ + export PKG_CONFIG_PATH="${selfdir}/lib1" + atf_check \ + -o inline:"-L/test/local/lib \n" \ + pkgconf --libs-only-L --keep-system-libs cflags-libs-only +} + +libs_body() +{ + export PKG_CONFIG_PATH="${selfdir}/lib1" + atf_check \ + -o inline:"-L/test/local/lib -lfoo \n" \ + pkgconf --libs cflags-libs-only +} + +libs_only_body() +{ + export PKG_CONFIG_PATH="${selfdir}/lib1" + atf_check \ + -o inline:"-L/test/local/lib -lfoo \n" \ + pkgconf --libs-only-L --libs-only-l cflags-libs-only +} + +cflags_only_body() +{ + export PKG_CONFIG_PATH="${selfdir}/lib1" + atf_check \ + -o inline:"-I/test/local/include/foo \n" \ + pkgconf --cflags-only-I --cflags-only-other cflags-libs-only +} + +incomplete_libs_body() +{ + export PKG_CONFIG_PATH="${selfdir}/lib1" + atf_check \ + -o inline:" \n" \ + pkgconf --libs incomplete +} + +incomplete_cflags_body() +{ + export PKG_CONFIG_PATH="${selfdir}/lib1" + atf_check \ + -o inline:" \n" \ + pkgconf --cflags incomplete +} diff --git a/tests/requires.sh b/tests/requires.sh new file mode 100755 index 0000000..c45c814 --- /dev/null +++ b/tests/requires.sh @@ -0,0 +1,79 @@ +#!/usr/bin/env atf-sh + +. $(atf_get_srcdir)/test_env.sh + +tests_init \ + libs \ + libs_cflags \ + libs_static \ + argv_parse2 \ + static_cflags \ + private_duplication \ + libs_static2 \ + missing + +libs_body() +{ + export PKG_CONFIG_PATH="${selfdir}/lib1" + atf_check \ + -o inline:"-L/test/lib -lbar -lfoo \n" \ + pkgconf --libs bar +} + +libs_cflags_body() +{ + export PKG_CONFIG_PATH="${selfdir}/lib1" + atf_check \ + -o inline:"-fPIC -I/test/include/foo -L/test/lib -lbaz \n" \ + pkgconf --libs --cflags baz +} + +libs_static_body() +{ + export PKG_CONFIG_PATH="${selfdir}/lib1" + atf_check \ + -o inline:"-L/test/lib -lbaz -L/test/lib -lzee -L/test/lib -lfoo \n" \ + pkgconf --static --libs baz +} + +argv_parse2_body() +{ + export PKG_CONFIG_PATH="${selfdir}/lib1" + atf_check \ + -o inline:"-llib-1 -pthread /test/lib/lib2.so \n" \ + pkgconf --static --libs argv-parse-2 +} + +static_cflags_body() +{ + export PKG_CONFIG_PATH="${selfdir}/lib1" + atf_check \ + -o inline:"-fPIC -I/test/include/foo -DFOO_STATIC \n" \ + pkgconf --static --cflags baz +} + +private_duplication_body() +{ + export PKG_CONFIG_PATH="${selfdir}/lib1" + atf_check \ + -o inline:"-lprivate -lfoo -lbaz -lzee -lbar -lfoo \n" \ + pkgconf --static --libs-only-l private-libs-duplication +} + +libs_static2_body() +{ + export PKG_CONFIG_PATH="${selfdir}/lib1" + atf_check \ + -o inline:"-lbar -lbar-private -L/test/lib -lfoo \n" \ + pkgconf --static --libs static-libs +} + +missing_body() +{ + export PKG_CONFIG_PATH="${selfdir}/lib1" + atf_check \ + -s exit:1 \ + -e ignore \ + -o inline:" \n" \ + pkgconf --cflags missing-require +} diff --git a/tests/sysroot.sh b/tests/sysroot.sh new file mode 100755 index 0000000..670d84c --- /dev/null +++ b/tests/sysroot.sh @@ -0,0 +1,28 @@ +#!/usr/bin/env atf-sh + +. $(atf_get_srcdir)/test_env.sh + +tests_init \ + cflags \ + variable + +cflags_body() +{ + export PKG_CONFIG_PATH="${selfdir}/lib1" + export PKG_CONFIG_SYSROOT_DIR="${SYSROOT_DIR}" + atf_check \ + -o inline:"-fPIC -I${SYSROOT_DIR}/test/include/foo \n" \ + pkgconf --cflags baz +} + +variable_body() +{ + export PKG_CONFIG_PATH="${selfdir}/lib1" + export PKG_CONFIG_SYSROOT_DIR="${SYSROOT_DIR}" + atf_check \ + -o inline:"${SYSROOT_DIR}/test\n" \ + pkgconf --variable=prefix foo + atf_check \ + -o inline:"${SYSROOT_DIR}/test/include\n" \ + pkgconf --variable=includedir foo +} diff --git a/tests/test_env.sh.in b/tests/test_env.sh.in new file mode 100644 index 0000000..a1508e0 --- /dev/null +++ b/tests/test_env.sh.in @@ -0,0 +1,22 @@ +export PATH="$(atf_get_srcdir)/../:${PATH}" +selfdir="@abs_top_srcdir@/tests" +PATH_SEP=":" +SYSROOT_DIR="${selfdir}/test" +if [ "$(uname -o)" = "Msys" ]; then + PATH_SEP=";" +fi + +tests_init() +{ + TESTS="$@" + export TESTS + for t ; do + atf_test_case $t + done +} + +atf_init_test_cases() { + for t in ${TESTS}; do + atf_add_test_case $t + done +} diff --git a/tests/version.sh b/tests/version.sh new file mode 100755 index 0000000..0172c04 --- /dev/null +++ b/tests/version.sh @@ -0,0 +1,38 @@ +#!/usr/bin/env atf-sh + +. $(atf_get_srcdir)/test_env.sh + +tests_init \ + atleast \ + exact \ + max + +atleast_body() +{ + export PKG_CONFIG_PATH="${selfdir}/lib1" + atf_check \ + pkgconf --atleast-version 1.0 foo + atf_check \ + -s exit:1 \ + pkgconf --atleast-version 2.0 foo +} + +exact_body() +{ + export PKG_CONFIG_PATH="${selfdir}/lib1" + atf_check \ + -s exit:1 \ + pkgconf --exact-version 1.0 foo + atf_check \ + pkgconf --exact-version 1.2.3 foo +} + +max_body() +{ + export PKG_CONFIG_PATH="${selfdir}/lib1" + atf_check \ + -s exit:1 \ + pkgconf --max-version 1.0 foo + atf_check \ + pkgconf --max-version 2.0 foo +} From 4d7d3e54bf3a743f334fbcd6ab38a789d62176ab Mon Sep 17 00:00:00 2001 From: Baptiste Daroussin Date: Sun, 18 Sep 2016 23:38:11 +0200 Subject: [PATCH 2/7] Add travis hacks to get kyua --- .travis.yml | 10 +++++++ scripts/install_deps.sh | 65 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 75 insertions(+) create mode 100755 scripts/install_deps.sh diff --git a/.travis.yml b/.travis.yml index 447d74e..d5d5c96 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,6 +4,16 @@ compiler: - clang - gcc +addons: + apt: + packages: + - liblua5.2-dev + +sudo: required + +before_install: + scripts/install_deps.sh + script: - sh ./autogen.sh - ./configure diff --git a/scripts/install_deps.sh b/scripts/install_deps.sh new file mode 100755 index 0000000..3538a53 --- /dev/null +++ b/scripts/install_deps.sh @@ -0,0 +1,65 @@ +#! /bin/sh +# Copyright (c) 2012 Bryan Drewery +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer +# in this position and unchanged. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +# Install build dependencies for pkg on Mac or Linux (Debiaun/Ubuntu) systems. +# +# This script is primarily intended for travis CI to be able to setup the +# build environment. + +install_from_github() { + local name="${1}" + local ver="${2}" + local distname="${name}-${ver}" + + # https://github.com/jmmv/kyua/releases/download/kyua-0.12/kyua-0.12.tar.gz + local url="https://github.com/jmmv/${name}" + wget "${url}/releases/download/${distname}/${distname}.tar.gz" + tar -xzvf "${distname}.tar.gz" + + cd "${distname}" + ./configure \ + --disable-developer \ + --without-atf \ + --without-doxygen \ + CPPFLAGS="-I/usr/local/include" \ + LDFLAGS="-L/usr/local/lib -Wl,-R/usr/local/lib" \ + PKG_CONFIG_PATH="/usr/local/lib/pkgconfig" + make + sudo make install + cd - + + rm -rf "${distname}" "${distname}.tar.gz" +} + +if [ $(uname -s) = "Darwin" ]; then + brew update + brew install libarchive --with-xz + brew install openssl + brew install kyua +elif [ $(uname -s) = "Linux" ]; then + install_from_github atf 0.21 + install_from_github lutok 0.4 + install_from_github kyua 0.12 +fi From 0ea956e300f5f0339c37b6854b0b99d4a60420a9 Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Fri, 4 Nov 2016 22:44:00 -0500 Subject: [PATCH 3/7] testsuite: use uname -s instead of uname -o for system name --- tests/test_env.sh.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_env.sh.in b/tests/test_env.sh.in index a1508e0..2ea190e 100644 --- a/tests/test_env.sh.in +++ b/tests/test_env.sh.in @@ -2,7 +2,7 @@ export PATH="$(atf_get_srcdir)/../:${PATH}" selfdir="@abs_top_srcdir@/tests" PATH_SEP=":" SYSROOT_DIR="${selfdir}/test" -if [ "$(uname -o)" = "Msys" ]; then +if [ "$(uname -s)" = "Msys" ]; then PATH_SEP=";" fi From 8075de1416ee54190f752817a72dec2a3d06bb9c Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Fri, 4 Nov 2016 23:07:18 -0500 Subject: [PATCH 4/7] testsuite: regress: add the remaining tests that were in the old testsuite --- tests/regress.sh | 65 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 64 insertions(+), 1 deletion(-) diff --git a/tests/regress.sh b/tests/regress.sh index ac53e0d..261383f 100755 --- a/tests/regress.sh +++ b/tests/regress.sh @@ -3,13 +3,52 @@ . $(atf_get_srcdir)/test_env.sh tests_init \ + case_sensitivity \ + depgraph_break_1 \ + depgraph_break_2 \ + depgraph_break_3 \ variable \ keep_system_libs \ libs \ libs_only \ cflags_only \ incomplete_libs \ - incomplete_cflags + incomplete_cflags \ + isystem_munge_order \ + isystem_munge_sysroot \ + pcpath + +case_sensitivity_body() +{ + export PKG_CONFIG_PATH="${selfdir}/lib1" + atf_check \ + -o inline:"3\n" \ + pkgconf --variable=foo case-sensitivity + atf_check \ + -o inline:"4\n" \ + pkgconf --variable=Foo case-sensitivity +} + +depgraph_break_1_body() +{ + export PKG_CONFIG_PATH="${selfdir}/lib1" + atf_check -s exit:1 -e ignore \ + pkgconf --exists --print-errors 'foo > 0.6.0 foo < 0.8.0' +} + +depgraph_break_2_body() +{ + export PKG_CONFIG_PATH="${selfdir}/lib1" + atf_check -s exit:1 -e ignore \ + pkgconf --exists --print-errors 'nonexisting foo <= 3' +} + +depgraph_break_3_body() +{ + export PKG_CONFIG_PATH="${selfdir}/lib1" + atf_check -s exit:1 -e ignore \ + pkgconf --exists --print-errors 'depgraph-break' +} variable_body() { @@ -66,3 +105,27 @@ incomplete_cflags_body() -o inline:" \n" \ pkgconf --cflags incomplete } + +isystem_munge_order_body() +{ + export PKG_CONFIG_PATH="${selfdir}/lib1" + atf_check \ + -o inline:"-isystem /opt/bad/include -isystem /opt/bad2/include \n" \ + pkgconf --cflags isystem +} + +isystem_munge_sysroot_body() +{ + export PKG_CONFIG_PATH="${selfdir}/lib1" PKG_CONFIG_SYSROOT_DIR='/test' + atf_check \ + -o match:"-isystem /test/opt/bad/include" \ + pkgconf --cflags isystem +} + +pcpath_body() +{ + export PKG_CONFIG_PATH="${selfdir}/lib2" + atf_check \ + -o inline:"-fPIC -I/test/include/foo \n" \ + pkgconf --cflags ${selfdir}/lib3/bar.pc +} From 20f4a7fcc71109b740695db44d39154a1f29a063 Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Fri, 4 Nov 2016 23:14:22 -0500 Subject: [PATCH 5/7] testsuite: parser: add remaining test cases --- tests/parser.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/parser.sh b/tests/parser.sh index 1ed0f80..f718bc7 100755 --- a/tests/parser.sh +++ b/tests/parser.sh @@ -3,6 +3,8 @@ . $(atf_get_srcdir)/test_env.sh tests_init \ + comments \ + comments_in_fields \ dos \ no_trailing_newline \ argv_parse \ @@ -13,6 +15,22 @@ tests_init \ multiline_field \ quoted +comments_body() +{ + export PKG_CONFIG_PATH="${selfdir}/lib1" + atf_check \ + -o inline:"-lfoo \n" \ + pkgconf --libs comments +} + +comments_in_fields_body() +{ + export PKG_CONFIG_PATH="${selfdir}/lib1" + atf_check \ + -o inline:"-lfoo \n" \ + pkgconf --libs comments-in-fields +} + dos_body() { export PKG_CONFIG_PATH="${selfdir}/lib1" From 63a61b7c9fa05c3228a4829b0b858c166d6fca57 Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Fri, 4 Nov 2016 23:30:21 -0500 Subject: [PATCH 6/7] testsuite: regress: really add the last few tests this time --- tests/regress.sh | 45 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/tests/regress.sh b/tests/regress.sh index 261383f..542f18d 100755 --- a/tests/regress.sh +++ b/tests/regress.sh @@ -7,16 +7,20 @@ tests_init \ depgraph_break_1 \ depgraph_break_2 \ depgraph_break_3 \ + define_variable \ variable \ keep_system_libs \ libs \ libs_only \ + libs_never_mergeback \ cflags_only \ + cflags_never_mergeback \ incomplete_libs \ incomplete_cflags \ isystem_munge_order \ isystem_munge_sysroot \ - pcpath + pcpath \ + sysroot_munge case_sensitivity_body() { @@ -50,6 +54,13 @@ depgraph_break_3_body() pkgconf --exists --print-errors 'depgraph-break' } +define_variable_body() +{ + export PKG_CONFIG_PATH="${selfdir}/lib1" + atf_check -o inline:"\\\${libdir}/typelibdir\n" \ + pkgconf --variable=typelibdir --define-variable='libdir=\${libdir}' typelibdir +} + variable_body() { export PKG_CONFIG_PATH="${selfdir}/lib1" @@ -82,6 +93,17 @@ libs_only_body() pkgconf --libs-only-L --libs-only-l cflags-libs-only } +libs_never_mergeback_body() +{ + export PKG_CONFIG_PATH="${selfdir}/lib1" + atf_check \ + -o inline:"-L/test/bar/lib -lfoo1 \n" \ + pkgconf --libs prefix-foo1 + atf_check \ + -o inline:"-L/test/bar/lib -lfoo1 -lfoo2 \n" \ + pkgconf --libs prefix-foo1 prefix-foo2 +} + cflags_only_body() { export PKG_CONFIG_PATH="${selfdir}/lib1" @@ -90,6 +112,14 @@ cflags_only_body() pkgconf --cflags-only-I --cflags-only-other cflags-libs-only } +cflags_never_mergeback_body() +{ + export PKG_CONFIG_PATH="${selfdir}/lib1" + atf_check \ + -o inline:"-I/test/bar/include/foo -DBAR -fPIC -DFOO \n" \ + pkgconf --cflags prefix-foo1 prefix-foo2 +} + incomplete_libs_body() { export PKG_CONFIG_PATH="${selfdir}/lib1" @@ -129,3 +159,16 @@ pcpath_body() -o inline:"-fPIC -I/test/include/foo \n" \ pkgconf --cflags ${selfdir}/lib3/bar.pc } + +sysroot_munge_body() +{ + export PKG_CONFIG_PATH="${selfdir}/lib1" PKG_CONFIG_SYSROOT_DIR="/sysroot" + atf_check \ + -o inline:"-L/sysroot/lib -lfoo \n" \ + pkgconf --libs sysroot-dir + + export PKG_CONFIG_SYSROOT_DIR="/sysroot2" + atf_check \ + -o inline:"-L/sysroot2/sysroot/lib -lfoo \n" \ + pkgconf --libs sysroot-dir +} From cbd14e91180a1c423fde45e6fdca39dcfe901974 Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Fri, 4 Nov 2016 23:31:02 -0500 Subject: [PATCH 7/7] testsuite: delete legacy testsuite --- tests/run.sh.in | 454 ------------------------------------------------ 1 file changed, 454 deletions(-) delete mode 100644 tests/run.sh.in diff --git a/tests/run.sh.in b/tests/run.sh.in deleted file mode 100644 index 0b55c91..0000000 --- a/tests/run.sh.in +++ /dev/null @@ -1,454 +0,0 @@ -#!/bin/sh -# Tests for pkg-config compliance. -# * Copyright (c) 2012 Michał Górny . - -done=0 -failed=0 - -run_test() { - local res t_ret 2>/dev/null || true - local cmdline 2>/dev/null || true - - cmdline="${1}" - - eval res="\$(${1})" 2>/dev/null - - t_ret=0 - while [ ${#} -gt 1 ]; do - shift - - case "${res}" in - *"${1}"*) - ;; - *) - echo - echo "***********************" - echo "!!! Test $done failed." - echo "!!! $ ${cmdline}" - echo "!!! ${res}" - echo "!!! expected '${1}' in output" - echo "***********************" - t_ret=1 - ;; - esac - done - - if [ ${t_ret} -eq 0 ]; then - printf "." - else - failed=$(( failed + 1 )) - fi - done=$(( done + 1 )) -} - -selfdir="@abs_srcdir@" - -PATH_SEP=":" -SYSROOT_DIR="${selfdir}/test" -if [ "$(uname -o)" = "Msys" ]; then - PATH_SEP=";" -fi - -# 1) overall 'is it working?' test -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1}; echo \$?" \ - '1' -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs foo" \ - '-lfoo' -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --cflags --libs foo" \ - '-lfoo' '-I/test/include/foo' '-fPIC' -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --cflags --libs 'foo > 1.2'" \ - '-lfoo' '-I/test/include/foo' '-fPIC' -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --cflags --libs 'foo > 1.2 bar >= 1.3'" \ - '-lfoo' '-I/test/include/foo' '-fPIC' -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --cflags --libs 'foo > 1.2,bar >= 1.3'" \ - '-lbar' '-I/test/include/foo' '-fPIC' -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --cflags --libs 'foo' '>' '1.2'" \ - '-lfoo' '-I/test/include/foo' '-fPIC' -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --cflags --libs 'foo' '!=' '1.3.0'" \ - '-lfoo' '-I/test/include/foo' '-fPIC' -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --cflags --libs 'foo' '!=' '1.2.3'; echo \$?" \ - '1' -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --exists nonexistant; echo \$?" \ - '1' -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} nonexistant; echo \$?" \ - '1' -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --exists 'foo > 1.2'; echo \$?" \ - '0' -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --exists 'foo > 1.2.3'; echo \$?" \ - '1' -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --exists 'foo' '>' '1.2'; echo \$?" \ - '0' -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --uninstalled 'foo'; echo \$?" \ - '1' -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --uninstalled 'omg'; echo \$?" \ - '0' -run_test "${1} --modversion ${selfdir}/lib1/foo.pc" \ - '1.2.3' -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --exists 'foo >= '; echo \$?" \ - '1' -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --exists 'tilde <= 1.0.0'; echo \$?" \ - '1' -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --exists 'tilde = 1.0.0~rc1'; echo \$?" \ - '0' -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --exists 'tilde >= 1.0.0'; echo \$?" \ - '0' -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --exists '' 'foo'; echo \$?" \ - '0' -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs intermediary-1 intermediary-2" \ - '-lintermediary-1 -lintermediary-2 -lfoo -lbar -lbaz' -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs circular-1" \ - '-lcircular-1 -lcircular-2 -lcircular-3' -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs circular-3" \ - '-lcircular-3 -lcircular-1 -lcircular-2' -run_test "${1} --libs ${selfdir}/lib1/circular-3.pc" \ - '-lcircular-1 -lcircular-2 -lcircular-3' -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs static-archive-libs" \ - '/libfoo.a -pthread' - -# 2) tests for PKG_CONFIG_PATH order -run_test "PKG_CONFIG_PATH='${selfdir}/lib1${PATH_SEP}${selfdir}/lib2' ${1} --libs foo" \ - '-lfoo' -run_test "PKG_CONFIG_PATH='${selfdir}/lib1${PATH_SEP}${selfdir}/lib2' ${1} --libs bar" \ - '-lbar' - -# 3) tests for 'Requires' and 'Requires.private' -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs bar" \ - '-lfoo' '-lbar' -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs --cflags baz" \ - '-lbaz' '-fPIC' '-I/test/include/foo' -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --static --libs baz" \ - '-lfoo' '-lbaz' '-lzee' -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --static --libs argv-parse-2" \ - '-pthread ' -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --static --cflags baz" \ - '-fPIC' '-I/test/include/foo' '-DFOO_STATIC' -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --static --libs-only-l private-libs-duplication" \ - '-lprivate -lfoo -lbaz -lzee -lbar -lfoo' -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --static --libs static-libs" \ - '-lbar -lbar-private -L/test/lib -lfoo' - -# 4) tests for parser bugs -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs dos-lineendings" \ - '-L/test/lib/dos-lineendings -ldos-lineendings' -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --cflags no-trailing-newline" \ - '-I/test/include/no-trailing-newline' -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs argv-parse" \ - '-llib-2 -lpthread' -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --exists -foo; echo \$?" \ - '1' -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs argv-parse-3" \ - '-llib-1' -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs tilde-quoting" \ - '-L~' -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --cflags tilde-quoting" \ - '-I~' -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs paren-quoting" \ - '-L$(libdir)' - -# 5) tests for other regressions -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --variable=includedir foo" \ - '/test/include' -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs-only-L --keep-system-libs cflags-libs-only" \ - '-L/test/local/lib' -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs cflags-libs-only" \ - '-L/test/local/lib -lfoo' -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs-only-L --libs-only-l cflags-libs-only" \ - '-L/test/local/lib -lfoo' -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --cflags-only-I --cflags-only-other cflags-libs-only" \ - '-I/test/local/include' -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs incomplete; echo \$?" \ - '0' -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --cflags incomplete" \ - ' ' -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs incomplete" \ - ' ' - -# 6) tests for builtins -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --modversion pkg-config" \ - '@PACKAGE_VERSION@' -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --variable=prefix foo" \ - '/test' -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --define-variable=prefix=/test2 --variable=prefix foo" \ - '/test2' -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --variable=pcfiledir foo" \ - "${selfdir}/lib1" - -# 7) tests for env modifiers -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' PKG_CONFIG_SYSROOT_DIR='${SYSROOT_DIR}' ${1} --cflags baz" \ - "-I${SYSROOT_DIR}/test/include/foo" -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' PKG_CONFIG_SYSROOT_DIR='${SYSROOT_DIR}' ${1} --variable=prefix baz" \ - "${SYSROOT_DIR}/test" -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' PKG_CONFIG_SYSROOT_DIR='${SYSROOT_DIR}' ${1} --variable=includedir baz" \ - "${SYSROOT_DIR}/test/include" - -# 8) tests for 'Conflicts' -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs conflicts; echo \$?" \ - '0' -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --ignore-conflicts --libs conflicts; echo \$?" \ - '-lconflicts' '0' - -# 9) tests for --atleast-version (with and without trailing space) -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --atleast-version 1.0 foo; echo \$?" \ - '0' -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --atleast-version 2.0 foo; echo \$?" \ - '1' -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --exact-version 1.0 foo; echo \$?" \ - '1' -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --exact-version 1.2.3 foo; echo \$?" \ - '0' -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --max-version 1.0 foo; echo \$?" \ - '1' -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --max-version 2.0 foo; echo \$?" \ - '0' - -# tests for issue #20 -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --atleast-version 1.0 'foo '; echo \$?" \ - '0' -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --atleast-version 2.0 'foo '; echo \$?" \ - '1' -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --exact-version 1.0 'foo '; echo \$?" \ - '1' -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --exact-version 1.2.3 'foo '; echo \$?" \ - '0' -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --max-version 1.0 'foo '; echo \$?" \ - '1' -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --max-version 2.0 'foo '; echo \$?" \ - '0' - -# test missing requires -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --cflags missing-require; echo \$?" \ - '1' - -# test the multiline description field -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --list-all | grep -q 'multiline description'; echo \$?" \ - '0' - -# test quoted #35 -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --cflags quotes" \ - "-DQUOTED=\\\"bla\\\"" - -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs nolib; echo \$?" \ - '0' - -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs nocflag; echo \$?" \ - '0' - -# test 36 - running against file in CWD with no path -# File moved to CWD to allow arbitrary path to pkgconf and keep pc file in CWD -run_test "cp ${selfdir}/lib1/foo.pc . && ${1} --libs foo.pc; rm -f foo.pc" \ - '-lfoo' - -# test 47 - framework flags -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs framework-1" \ - "-F/test/lib -framework framework-1" -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs framework-2" \ - "-F/test/lib -framework framework-2 -F/test/lib -framework framework-1" -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs framework-1 framework-2" \ - "-F/test/lib -framework framework-1 -F/test/lib -framework framework-2" - -# test 87 - -isystem munging -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --cflags isystem" \ - "-isystem /opt/bad/include -isystem /opt/bad2/include" - -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --exists --print-errors 'foo > 0.6.0 foo < 0.8.0'; echo \$?" \ - '1' - -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --exists --print-errors 'nonexisting foo <= 3'; echo \$?" \ - '1' - -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --exists --print-errors 'depgraph-break'; echo \$?" \ - '1' - -run_test "PKG_CONFIG_PATH='${selfdir}/lib2' ${1} ${selfdir}/lib3/bar.pc --cflags" \ - '-fPIC -I/test/include/foo' - -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --variable=foo case-sensitivity" \ - "3" -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --variable=Foo case-sensitivity" \ - "4" - -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs comments-in-fields" \ - "-lfoo" - -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs comments" \ - "-lfoo" - -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' PKG_CONFIG_SYSROOT_DIR='/sysroot' ${1} --libs sysroot-dir" \ - '-L/sysroot/lib -lfoo' -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' PKG_CONFIG_SYSROOT_DIR='/sysroot2' ${1} --libs sysroot-dir" \ - '-L/sysroot2/sysroot/lib -lfoo' -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs prefix-foo1" \ - '-L/test/bar/lib -lfoo1' -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs prefix-foo1 prefix-foo2" \ - '-L/test/bar/lib -lfoo1 -lfoo2' -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --cflags prefix-foo1 prefix-foo2" \ - '-I/test/bar/include/foo -DBAR -fPIC -DFOO' -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --variable=typelibdir --define-variable='libdir=\${libdir}' typelibdir" \ - "\${libdir}/typelibdir" - -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' PKG_CONFIG_SYSROOT_DIR='/test' ${1} --cflags isystem" \ - "-isystem /test/opt/bad/include" - -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' PKG_CONFIG_SYSROOT_DIR='/test' ${1} --cflags cflags-whitespace" \ - "-I /test/opt/bad/include" -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' PKG_CONFIG_SYSTEM_INCLUDE_PATH='/usr/include' ${1} --cflags cflags-whitespace-trailing" \ - "-I/usr/include/foo" - -# 10) tests for Provides system -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --print-provides provides" \ - "provides = 1.2.3" "provides-test-foo = 1.0.0" "provides-test-baz >= 1.1.0" "provides-test-moo <= 1.2.0" -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs provides-request-simple" \ - "-lfoo" -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --no-provides --libs provides-request-simple; echo \$?" \ - "1" - -# provides-test-foo = 1.0.0 -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs 'provides-test-foo'; echo \$?" \ - "0" -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs 'provides-test-foo = 1.0.0'; echo \$?" \ - "0" -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs 'provides-test-foo >= 1.0.0'; echo \$?" \ - "0" -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs 'provides-test-foo <= 1.0.0'; echo \$?" \ - "0" -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs 'provides-test-foo != 1.0.0'; echo \$?" \ - "1" -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs 'provides-test-foo > 1.0.0'; echo \$?" \ - "1" -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs 'provides-test-foo < 1.0.0'; echo \$?" \ - "1" - -# provides-test-bar > 1.1.0 -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs 'provides-test-bar'; echo \$?" \ - "0" -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs 'provides-test-bar = 1.1.1'; echo \$?" \ - "0" -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs 'provides-test-bar >= 1.1.1'; echo \$?" \ - "0" -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs 'provides-test-bar <= 1.1.1'; echo \$?" \ - "0" -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs 'provides-test-bar != 1.1.0'; echo \$?" \ - "0" -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs 'provides-test-bar != 1.1.1'; echo \$?" \ - "1" -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs 'provides-test-bar > 1.1.1'; echo \$?" \ - "0" -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs 'provides-test-bar <= 1.1.0'; echo \$?" \ - "1" -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs 'provides-test-bar < 1.2.0'; echo \$?" \ - "0" -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs 'provides-test-bar > 1.2.0'; echo \$?" \ - "0" - -# provides-test-baz >= 1.1.0 -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs 'provides-test-baz'; echo \$?" \ - "0" -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs 'provides-test-baz = 1.1.0'; echo \$?" \ - "0" -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs 'provides-test-baz >= 1.1.0'; echo \$?" \ - "0" -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs 'provides-test-baz <= 1.1.0'; echo \$?" \ - "0" -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs 'provides-test-baz != 1.1.0'; echo \$?" \ - "1" -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs 'provides-test-baz != 1.0.0'; echo \$?" \ - "0" -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs 'provides-test-baz > 1.1.0'; echo \$?" \ - "0" -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs 'provides-test-baz < 1.1.0'; echo \$?" \ - "1" -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs 'provides-test-baz < 1.2.0'; echo \$?" \ - "0" - -# provides-test-quux < 1.2.0 -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs 'provides-test-quux'; echo \$?" \ - "0" -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs 'provides-test-quux = 1.1.9'; echo \$?" \ - "0" -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs 'provides-test-quux >= 1.1.0'; echo \$?" \ - "0" -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs 'provides-test-quux >= 1.1.9'; echo \$?" \ - "0" -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs 'provides-test-quux >= 1.2.0'; echo \$?" \ - "1" -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs 'provides-test-quux <= 1.2.0'; echo \$?" \ - "1" -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs 'provides-test-quux <= 1.1.9'; echo \$?" \ - "0" -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs 'provides-test-quux != 1.2.0'; echo \$?" \ - "0" -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs 'provides-test-quux != 1.1.0'; echo \$?" \ - "1" -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs 'provides-test-quux != 1.0.0'; echo \$?" \ - "1" -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs 'provides-test-quux > 1.1.9'; echo \$?" \ - "0" -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs 'provides-test-quux > 1.2.0'; echo \$?" \ - "1" -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs 'provides-test-quux < 1.1.0'; echo \$?" \ - "0" -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs 'provides-test-quux < 1.2.0'; echo \$?" \ - "1" - -# provides-test-moo <= 1.2.0 -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs 'provides-test-moo'; echo \$?" \ - "0" -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs 'provides-test-moo = 1.2.0'; echo \$?" \ - "0" -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs 'provides-test-moo >= 1.1.0'; echo \$?" \ - "0" -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs 'provides-test-moo >= 1.2.0'; echo \$?" \ - "0" -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs 'provides-test-moo >= 1.2.1'; echo \$?" \ - "1" -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs 'provides-test-moo <= 1.2.0'; echo \$?" \ - "0" -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs 'provides-test-moo != 1.1.0'; echo \$?" \ - "1" -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs 'provides-test-moo != 1.0.0'; echo \$?" \ - "1" -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs 'provides-test-moo > 1.1.9'; echo \$?" \ - "0" -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs 'provides-test-moo > 1.2.0'; echo \$?" \ - "1" -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs 'provides-test-moo < 1.1.0'; echo \$?" \ - "0" -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs 'provides-test-moo < 1.2.0'; echo \$?" \ - "0" - -# provides-test-meow != 1.3.0 -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs 'provides-test-meow'; echo \$?" \ - "0" -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs 'provides-test-meow = 1.3.0'; echo \$?" \ - "1" -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs 'provides-test-meow != 1.3.0'; echo \$?" \ - "0" -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs 'provides-test-meow > 1.2.9'; echo \$?" \ - "1" -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs 'provides-test-meow < 1.3.1'; echo \$?" \ - "1" -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs 'provides-test-meow > 1.3.0'; echo \$?" \ - "0" -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs 'provides-test-meow < 1.3.0'; echo \$?" \ - "0" -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs 'provides-test-meow >= 1.3.0'; echo \$?" \ - "1" -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs 'provides-test-meow >= 1.3.1'; echo \$?" \ - "0" -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs 'provides-test-meow <= 1.3.0'; echo \$?" \ - "1" -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs 'provides-test-meow <= 1.2.9'; echo \$?" \ - "0" - -run_test "${1} --blah; echo \$?" \ - '1' - -echo - -if [ ${failed} -gt 0 ]; then - echo "${failed} of ${done} tests failed. See output for details." >&2 - exit 1 -else - echo "${done} tests done. All succeeded." >&2 - exit 0 -fi