]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Makefile: fail minigzip test if minigzip aborts
authorDan Kegel <dank@kegel.com>
Wed, 10 Jun 2020 15:41:07 +0000 (08:41 -0700)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Tue, 16 Jun 2020 14:06:44 +0000 (16:06 +0200)
Pipeline exit status ignores all but the last
process in the pipeline, so break up the pipeline
so we can see minigzip's exit status.

Also fix ancient quoting bug; intention was likely to use
shell $$ variable to uniquify temp file name.

test/Makefile.in

index 1a75d69e16f4002441ccf52a91b933669a03df0e..fc1e0c70d523f3aabf136d5e8909a2b81abccfd8 100644 (file)
@@ -46,26 +46,28 @@ fuzzer:
 endif
 
 teststatic: check_cross_dep
-       @TMPST=tmpst_$$; \
-       if echo hello world | ${QEMU_RUN} ../minigzip$(EXE) | ${QEMU_RUN} ../minigzip$(EXE) -d && ${QEMU_RUN} ../example$(EXE) $$TMPST ; then \
+       @TMPST=tmpst_$$$$; \
+       HELLOST=tmphellost_$$$$; \
+       if echo hello world | ${QEMU_RUN} ../minigzip$(EXE) > $$HELLOST && ${QEMU_RUN} ../minigzip$(EXE) -d < $$HELLOST && ${QEMU_RUN} ../example$(EXE) $$TMPST ; then \
          echo '                *** zlib test OK ***'; \
        else \
          echo '                *** zlib test FAILED ***'; exit 1; \
-       fi
-       @rm -f tmpst_$$
+       fi; \
+       rm -f $$TMPST $$HELLOST
 
 testshared: check_cross_dep
        @LD_LIBRARY_PATH=`pwd`/..:$(LD_LIBRARY_PATH) ; export LD_LIBRARY_PATH; \
        LD_LIBRARYN32_PATH=`pwd`/..:$(LD_LIBRARYN32_PATH) ; export LD_LIBRARYN32_PATH; \
        DYLD_LIBRARY_PATH=`pwd`/..:$(DYLD_LIBRARY_PATH) ; export DYLD_LIBRARY_PATH; \
        SHLIB_PATH=`pwd`/..:$(SHLIB_PATH) ; export SHLIB_PATH; \
-       TMPSH=tmpsh_$$; \
-       if echo hello world | ${QEMU_RUN} ../minigzipsh$(EXE) | ${QEMU_RUN} ../minigzipsh$(EXE) -d && ${QEMU_RUN} ../examplesh$(EXE) $$TMPSH; then \
+       TMPSH=tmpsh_$$$$; \
+       HELLOSH=tmphellosh_$$$$; \
+       if echo hello world | ${QEMU_RUN} ../minigzipsh$(EXE) > $$HELLOSH && ${QEMU_RUN} ../minigzipsh$(EXE) -d < $$HELLOSH && ${QEMU_RUN} ../examplesh$(EXE) $$TMPSH; then \
          echo '                *** zlib shared test OK ***'; \
        else \
          echo '                *** zlib shared test FAILED ***'; exit 1; \
-       fi
-       @rm -f tmpsh_$$
+       fi; \
+       rm -f $$TMPSH $$HELLOSH
 
 cvetests: testCVEinputs