Skip to content
This repository
Browse code

Avoid race condition for parallel make (-j) running example.

  • Loading branch information...
commit 1be117908397b0ce065c07c60fa2b4ae778ff112 1 parent cc538eb
Mark Adler authored

Showing 1 changed file with 12 additions and 9 deletions. Show diff stats Hide diff stats

  1. +12 9 Makefile.in
21 Makefile.in
@@ -83,32 +83,35 @@ check: test
83 83 test: all teststatic testshared
84 84
85 85 teststatic: static
86   - @if echo hello world | ./minigzip | ./minigzip -d && ./example; then \
  86 + @TMPST=`mktemp fooXXXXXX`; \
  87 + if echo hello world | ./minigzip | ./minigzip -d && ./example $$TMPST ; then \
87 88 echo ' *** zlib test OK ***'; \
88 89 else \
89 90 echo ' *** zlib test FAILED ***'; false; \
90   - fi
91   - -@rm -f foo.gz
  91 + fi; \
  92 + rm -f $$TMPST
92 93
93 94 testshared: shared
94 95 @LD_LIBRARY_PATH=`pwd`:$(LD_LIBRARY_PATH) ; export LD_LIBRARY_PATH; \
95 96 LD_LIBRARYN32_PATH=`pwd`:$(LD_LIBRARYN32_PATH) ; export LD_LIBRARYN32_PATH; \
96 97 DYLD_LIBRARY_PATH=`pwd`:$(DYLD_LIBRARY_PATH) ; export DYLD_LIBRARY_PATH; \
97 98 SHLIB_PATH=`pwd`:$(SHLIB_PATH) ; export SHLIB_PATH; \
98   - if echo hello world | ./minigzipsh | ./minigzipsh -d && ./examplesh; then \
  99 + TMPSH=`mktemp fooXXXXXX`; \
  100 + if echo hello world | ./minigzipsh | ./minigzipsh -d && ./examplesh $$TMPSH; then \
99 101 echo ' *** zlib shared test OK ***'; \
100 102 else \
101 103 echo ' *** zlib shared test FAILED ***'; false; \
102   - fi
103   - -@rm -f foo.gz
  104 + fi; \
  105 + rm -f $$TMPSH
104 106
105 107 test64: all64
106   - @if echo hello world | ./minigzip64 | ./minigzip64 -d && ./example64; then \
  108 + @TMP64=`mktemp fooXXXXXX`; \
  109 + if echo hello world | ./minigzip64 | ./minigzip64 -d && ./example64 $$TMP64; then \
107 110 echo ' *** zlib 64-bit test OK ***'; \
108 111 else \
109 112 echo ' *** zlib 64-bit test FAILED ***'; false; \
110   - fi
111   - -@rm -f foo.gz
  113 + fi; \
  114 + rm -f $$TMP64
112 115
113 116 infcover.o: test/infcover.c zlib.h zconf.h
114 117 $(CC) $(CFLAGS) -I. -c -o $@ test/infcover.c

0 comments on commit 1be1179

Please sign in to comment.
Something went wrong with that request. Please try again.