tests: Look for httpcache in ${test_builddir}, not PATH
authorSimon McVittie <smcv@debian.org>
Mon, 20 Aug 2018 14:22:46 +0000 (15:22 +0100)
committerSimon McVittie <smcv@debian.org>
Mon, 20 Aug 2018 20:29:02 +0000 (21:29 +0100)
For installed-tests, the installed test directory is not on the PATH.
To make this easier, put the uninstalled binary in tests/, so that
in both build-time and installed tests, it is in ${test_builddir}.

Signed-off-by: Simon McVittie <smcv@debian.org>
Forwarded: https://github.com/flatpak/flatpak/pull/1989

Gbp-Pq: Name tests-Look-for-httpcache-in-test_builddir-not-PATH.patch

tests/Makefile.am.inc
tests/test-http-utils.sh

index b902a79942f122b102f379a4acbe173cfd0124a1..56fb5dbc150ec8482e455dc0438c5ed5b67cca43 100644 (file)
@@ -22,12 +22,11 @@ testlibrary_LDADD = \
              $(NULL)
 testlibrary_SOURCES = tests/testlibrary.c
 
-httpcache_CFLAGS = $(AM_CFLAGS) $(BASE_CFLAGS) $(OSTREE_CFLAGS) $(SOUP_CFLAGS) $(JSON_CFLAGS) $(APPSTREAM_GLIB_CFLAGS) \
+tests_httpcache_CFLAGS = $(AM_CFLAGS) $(BASE_CFLAGS) $(OSTREE_CFLAGS) $(SOUP_CFLAGS) $(JSON_CFLAGS) $(APPSTREAM_GLIB_CFLAGS) \
        -DFLATPAK_COMPILATION \
         -DLOCALEDIR=\"$(localedir)\"
-httpcache_LDADD = $(AM_LDADD) $(BASE_LIBS) $(OSTREE_LIBS) $(SOUP_LIBS) $(JSON_LIBS) $(APPSTREAM_GLIB_LIBS) \
+tests_httpcache_LDADD = $(AM_LDADD) $(BASE_LIBS) $(OSTREE_LIBS) $(SOUP_LIBS) $(JSON_LIBS) $(APPSTREAM_GLIB_LIBS) \
        libglnx.la libflatpak-common.la
-httpcache_SOURCES = tests/httpcache.c
 
 tests/services/org.freedesktop.Flatpak.service: session-helper/org.freedesktop.Flatpak.service.in
        mkdir -p tests/services
@@ -109,7 +108,7 @@ dist_test_scripts = \
        $(NULL)
 
 test_programs = testlibrary
-test_extra_programs = httpcache
+test_extra_programs = tests/httpcache
 
 @VALGRIND_CHECK_RULES@
 VALGRIND_SUPPRESSIONS_FILES=tests/flatpak.supp tests/glib.supp
index ad7599d3a704ffedbbdc8b6276088922311801d6..1f46cee35bb3492ec2769fa3b97b195addd72249 100755 (executable)
@@ -36,7 +36,7 @@ assert_result() {
     remote=$2
     local=$3
 
-    out=`httpcache $compressed "http://localhost:$port$remote" $local || :`
+    out=`${test_builddir}/httpcache $compressed "http://localhost:$port$remote" $local || :`
 
     case "$out" in
        $test_string*)