]> granicus.if.org Git - zziplib/blob - test/Makefile.am
Merge pull request #135 from JackBoosY/dev/jack/export-targets
[zziplib] / test / Makefile.am
1 AUTOMAKE_OPTIONS = 1.4 foreign
2 AUTOTOOL_VERSION=autoconf-2.52 automake-1.5 libtool-1.4.2
3 DEFAULT_INCLUDES = # nothing - no default of -I. -I$(srcdir)
4 DEFS = @DEFS@ -I$(top_builddir) -I$(top_srcdir) # also for automake 1.4
5
6 EXTRA_DIST = test.zip zziptests.py
7 DISTCLEANFILES = test*.dat test0.zip test1.zip test2.zip test3.zip
8
9 zzcat     = ../bins/zzcat$(EXEEXT)
10 zzdir     = ../bins/zzdir$(EXEEXT)
11 zziptest  = ../bins/zziptest$(EXEEXT)
12 zzxorcat  = ../bins/zzxorcat$(EXEEXT)
13 zzxordir  = ../bins/zzxordir$(EXEEXT)
14 zzxorcopy = ../bins/zzxorcopy$(EXEEXT)
15
16 $(zzcat) $(zzdir) $(zziptest) $(zzxorcat) $(zzxordir) $(xorcopy) : \
17         @top_srcdir@/bins/*.c @top_srcdir@/zzip/*.c
18         (cd ../bins && $(MAKE))
19
20 # -------------------------------------------------------------------
21 NULL=/dev/null
22 README = $(top_srcdir)/README
23 testdatadir = $(top_builddir)/testdata.d
24
25 testzip testzips : test.zip test1.zip test2.zip test3.zip 
26
27 test0.zip: $(README)
28         - test -d tmp || mkdir tmp
29         - cp $(README) tmp/README
30         - rm -f $@
31         - cd tmp && $(MKZIP) ../test0.zip README
32         - rm -r tmp
33         test -s test0.zip && cp -v test0.zip $(srcdir)/test.zip
34         
35 test.zip: $(README)
36         - $(MAKE) test0.zip
37         - test -s $@ || cp $(srcdir)/test.zip $@
38
39 # -------------------------------------------------------------------
40
41 sfxtests = @ZIPTESTS@ check-sfx
42 newtests = @ZIPTESTS@ check-tests
43
44 check-local: check-readme $(sfxtests) $(newtests)
45
46 check-tests: tests
47 tests:
48         @ test -f zziptests.py || ln -s -v $(srcdir)/zziptests.py . || cp -v $(srcdir)/zziptests.py .
49         $(PYTHON) zziptests.py     --exeext "$(EXEEXT)" --topsrcdir "$(top_srcdir)"
50 test_%:
51         @ test -f zziptests.py || ln -s -v $(srcdir)/zziptests.py . || cp -v $(srcdir)/zziptests.py .
52         $(PYTHON) zziptests.py $@ -vvvv    --exeext "$(EXEEXT)" --topsrcdir "$(top_srcdir)"
53
54 check-readme : $(zzcat)  test.zip
55         @ test -f test.zip || $(MAKE) test0.zip 
56         test -s test.zip || cp $(srcdir)/test.zip test.zip
57         @ echo :$@: checking $(zzcat) test/README 
58         @ $(zzcat) test/README >test.out
59         @ if diff test.out $(README) >$(NULL) \
60         ; then rm test.out ; echo check OK ; true \
61         ; else rm test.out ; echo check FAIL ; false ; fi
62
63 # -------------------------------------------------------------------
64
65 noinst_PROGRAMS = zzipself zzipsetstub
66
67 zzipself_LDFLAGS = @ZZIPLIB_LDFLAGS@
68 zzipself_LDADD = ../zzip/libzzip.la @RESOLVES@ -lz
69
70 ../zzip/libzzip.la : @top_srcdir@/zzip/*.c
71         (cd ../zzip && $(MAKE) `basename $@`)
72
73 zzshowme$(EXEEXT) : zzipself$(EXEEXT) zzipsetstub$(EXEEXT)
74         $(MKZIP) -0 -j $@ .libs/zzipself$(EXEEXT)
75         $(MKZIP) -9 -j $@ $(README)
76         - test -s $@ || cp test2.zip $@
77         test ! -f $@.zip || mv $@.zip $@
78         ./zzipsetstub $@ .libs/zzipself$(EXEEXT)
79         - chmod +x $@
80
81 check-sfx : zzshowme$(EXEEXT)
82         echo :$@: "./zzshowme readme >readme.out 2>readme.err" 
83         export LD_LIBRARY_PATH="../zzip/.libs:$$LD_LIBRARY_PATH" \
84         ; ./zzshowme readme >readme.out 2>readme.err ; true
85         @ echo 'diff readme.out $(README) || grep "libzzip-" readme.err' \
86         ; if test -s readme.out ; then diff readme.out $(README) \
87         ; else grep "libzzip-" readme.err || echo "readme.out is empty!" ; fi
88         rm readme.out readme.err
89