@@ -11,7 +11,9 @@ WWW_FILES = $(JARFILE) javadocs index.html cdflist.html cdfdump.html
1111WWW_DIR = /homeb/mbt/public_html/jcdf
1212
1313TEST_JARFILE = jcdf_test.jar
14- TEST_CDFS = data/*.cdf
14+ TEST_CDFS = data/example1.cdf data/example2.cdf data/test.cdf data/local/*.cdf
15+ TEST_BADLEAP = data/test_badleap.cdf
16+ LEAPSECONDS = data/CDFLeapSeconds.txt
1517CDFLIBDIR = /mbt/local/lib
1618CDFJARDIR = /mbt/local/jars
1719
@@ -110,9 +112,9 @@ updatewww: $(WWW_DIR)/index.html
110112$(WWW_DIR ) /index.html : index.html
111113 cp index.html $@
112114
113- test : extest othertest convtest
115+ test : extest othertest badleaptest convtest
114116
115- convtest : $(JARFILE ) $(TEST_JARFILE ) $( TEST_CDFS )
117+ convtest : $(JARFILE ) $(TEST_JARFILE )
116118 rm -rf tmp; \
117119 mkdir tmp; \
118120 for f in $( TEST_CDFS) ; \
@@ -132,11 +134,29 @@ extest: $(JARFILE) $(TEST_JARFILE)
132134 data/example1.cdf data/example2.cdf data/test.cdf
133135
134136othertest : $(JARFILE ) $(TEST_JARFILE )
137+ # There is an error in the NASA java implementation at v3.6.0.3:
138+ # it doesn't have the 2015 leap year in it, which means this test
139+ # would fail. So import the updated leap seconds table with the
140+ # environment variable so it works. When the NASA lib is fixed
141+ # this can be removed.
135142 env LD_LIBRARY_PATH=$(CDFLIBDIR ) \
143+ CDF_LEAPSECONDSTABLE =$(LEAPSECONDS ) \
136144 java -ea \
137145 -classpath $(JARFILE ) :$(TEST_JARFILE ) :$(CDFJARDIR ) /cdfjava.jar \
138146 uk.ac.bristol.star.cdf.test.OtherTest
139147
148+ badleaptest : $(JARFILE ) data/test_badleap.cdf
149+ # This one should run OK
150+ java -classpath $(JARFILE ) uk.ac.bristol.star.cdf.util.CdfDump \
151+ $(TEST_BADLEAP) >/dev/null
152+ # but this one should report that the file's leap seconds table
153+ # is out of date and exit with a RuntimeException
154+ if java -classpath $(JARFILE) \
155+ uk.ac.bristol.star.cdf.util.CdfList -data \
156+ $(TEST_BADLEAP) >/dev/null 2>&1; then \
157+ should_have_failed; \
158+ fi
159+
140160clean :
141161 rm -rf $(JARFILE ) $(TEST_JARFILE ) tmp \
142162 index.html javadocs cdflist.html cdfdump.html
0 commit comments