3 # This is a simple implementation of a test suite for XML validity
4 # (where possible) or well-formedness (if no schema is available)
5 # to ensure that our sample XML configuration files are reasonably
8 TESTIDL := $(shell xmllint --noout --schema fm_IDL.xsd fm_IDL.xml 2>&1 | wc -l)
9 TESTOSRF := $(shell xmllint --noout opensrf.xml 2>&1 | wc -l)
10 TESTOSRFCORE := $(shell xmllint --noout opensrf_core.xml 2>&1 | wc -l)
15 SUCCESS := $(SUCCESS).
17 $(warning fm_IDL.xml does not validate)
23 SUCCESS := $(SUCCESS).
25 $(warning opensrf.xml is not well-formed)
30 ifeq ($(TESTOSRFCORE), 1)
31 SUCCESS := $(SUCCESS).
33 $(warning opensrf_core.xml is not well-formed)
36 test: test_idl test_osrf test_osrf_core
37 # First we count the number of characters returned
38 SUCCESSES ?= $(shell echo $(SUCCESS) | wc -m )
39 FAILED ?= $(shell echo $(FAILURE) | wc -m )
40 TOTALED ?= $(shell echo $(TOTAL) | wc -m )
41 # Then we subtract one from the count to make it accurate
42 SUCCESSTESTS ?= $(shell echo $(SUCCESSES) - 1 | bc )
43 FAILEDTESTS ?= $(shell echo $(FAILED) -1 | bc )
44 TOTALTESTS ?= $(shell echo $(TOTALED) -1 | bc )
45 $(info Succesful tests: $(SUCCESSTESTS)/$(TOTALTESTS))
46 $(info Failed tests: $(FAILEDTESTS)/$(TOTALTESTS))