proxy/tests: fix to work when neither proxy module is available
authorDan Winship <danw@gnome.org>
Mon, 20 May 2013 13:11:47 +0000 (10:11 -0300)
committerDan Winship <danw@gnome.org>
Mon, 20 May 2013 13:11:47 +0000 (10:11 -0300)
automake ends up setting TEST_PROGS to " " in this case, but
Makefile.decl was assuming that if TEST_PROGS is not empty then it
contains actual tests, and then ended up bailing out by passing an no
tests to gtester. Fix it to use $(strip) to get the right result.

Also, drive-by automake warning fix in proxy/tests/Makefile.am

https://bugzilla.gnome.org/show_bug.cgi?id=700628

Makefile.decl
proxy/tests/Makefile.am

index b999c4a..2e654ad 100644 (file)
@@ -33,13 +33,13 @@ test: test-nonrecursive
 
 # test-nonrecursive: run tests only in cwd
 test-nonrecursive: ${TEST_PROGS}
-       @test -z "${TEST_PROGS}" || ${TEST_ENVIRONMENT} ${GTESTER} --verbose ${TEST_PROGS}
+       @test -z "$(strip ${TEST_PROGS})" || ${TEST_ENVIRONMENT} ${GTESTER} --verbose ${TEST_PROGS}
 
 # test-report: run tests in subdirs and generate report
 # perf-report: run tests in subdirs with -m perf and generate report
 # full-report: like test-report: with -m perf and -m slow
 test-report perf-report full-report:   ${TEST_PROGS}
-       @test -z "${TEST_PROGS}" || { \
+       @test -z "$(strip ${TEST_PROGS})" || { \
          case $@ in \
          test-report) test_options="-k";; \
          perf-report) test_options="-k -m=perf";; \
@@ -47,7 +47,7 @@ test-report perf-report full-report:  ${TEST_PROGS}
          esac ; \
          if test -z "$$GTESTER_LOGDIR" ; then  \
            ${GTESTER} --verbose $$test_options -o test-report.xml ${TEST_PROGS} ; \
-         elif test -n "${TEST_PROGS}" ; then \
+         elif test -n "$(strip ${TEST_PROGS})" ; then \
            ${GTESTER} --verbose $$test_options -o `mktemp "$$GTESTER_LOGDIR/log-XXXXXX"` ${TEST_PROGS} ; \
          fi ; \
        }
index ad5dd3c..9ed9454 100644 (file)
@@ -19,4 +19,4 @@ if HAVE_LIBPROXY
 TEST_PROGS += libproxy
 endif
 
-EXTRA_DIST = common.c
+EXTRA_DIST += common.c