~verifypn-cpn/verifypn/unitTest

35 by Jonas Finnemann Jensen
Support for osx32 and osx64 bit builds, we now have ugly binaries in source tree
1
# Default target
48.1.1 by Jonas Finnemann Jensen
Added support for quoted identifiers in queries
2
all: release
35 by Jonas Finnemann Jensen
Support for osx32 and osx64 bit builds, we now have ugly binaries in source tree
3
4
# Build rules
5
%.o: %.cpp
6
	$(CC) -c $(CFLAGS) -o $@ $<
7
$(TARGET): $(DEPS) $(OBJECTS)
8
	$(CC) $^ $(LDFLAGS) -o $@
9
181.2.26 by Peter G. Jensen
reduced optimization-degree, introduces error
10
release: CFLAGS += -Wall -pedantic-errors -O2 -DNDEBUG
197.3.52 by Peter G. Jensen
fixed compiler flag
11
release: LDFLAGS += -O2 -DNDEBUG
48.1.1 by Jonas Finnemann Jensen
Added support for quoted identifiers in queries
12
release: $(TARGET)
197.3.41 by Peter G. Jensen
merged over over-approximation
13
197.3.42 by Peter G. Jensen
added compile-flags and make-option for mcc-specifics
14
mcc: CFLAGS += -Wall -pedantic-errors -O2 -DNDEBUG -DENABLE_MC_SIMPLIFICATION -DENABLE_TAR
15
mcc: LDFLAGS += -O2 -DNDEBUG -Wl,-Bstatic -lz3 -lgmp -Wl,-Bdynamic -lpthread -DENABLE_MC_SIMPLIFICATION -DENABLE_TAR
16
mcc: $(TARGET)
197.3.41 by Peter G. Jensen
merged over over-approximation
17
197.3.42 by Peter G. Jensen
added compile-flags and make-option for mcc-specifics
18
debug: CFLAGS += -g -DENABLE_MC_SIMPLIFICATION -DENABLE_TAR
19
debug: LDFLAGS += -g -Wl,-Bstatic -lz3 -lgmp -Wl,-Bdynamic -lpthread -DENABLE_MC_SIMPLIFICATION -DENABLE_TAR
48.1.1 by Jonas Finnemann Jensen
Added support for quoted identifiers in queries
20
debug: $(TARGET)
21
35 by Jonas Finnemann Jensen
Support for osx32 and osx64 bit builds, we now have ugly binaries in source tree
22
# Rules for updating lexer and parser
23
%.lexer.cpp: %.l
24
	$(LEX) -o $@ $<
25
%.parser.cpp: %.y
26
	$(YACC) -d -o $@ $<
27
generate: $(BISON_SOURCES:.y=.parser.cpp) $(FLEX_SOURCES:.l=.lexer.cpp)
28
29
# Clean rule
30
clean:
31
	rm -f $(OBJECTS) $(DEPS) $(TARGET)
32
33
# Pattern to replace All with strategies using sed
34
REPLACE_ALL := "s/All/BestFS BFS DFS RDFS/"
35
36
# Check the build
37
check: $(TARGET)
38
	@failed=0; \
39
	for f in Tests/*.xml; do																	\
40
		for s in `echo $$f | cut -d- -f3 | cut -d. -f1 | sed -e $(REPLACE_ALL)`; do 			\
41
			echo "----------------------------------------------------------------------";		\
42
			echo "Testing $$f using $$s";														\
36 by Jonas Finnemann Jensen
Added lpsolve binaries for linux 32 and 64 bit
43
			./$< -s $$s -m 256 $$f $$f.q;												\
35 by Jonas Finnemann Jensen
Support for osx32 and osx64 bit builds, we now have ugly binaries in source tree
44
			if [ $$? -ne `echo $$f | cut -d- -f2` ]; then	 									\
45
				echo " --- Test Failed!"; 														\
46
				failed=$$(($$failed + 1));														\
47
			else																				\
48
				echo " +++ Test Succeeded"; 													\
49
			fi 																					\
50
		done																					\
51
	done; 																						\
52
	if [ "$$failed" -ne "0" ]; then 															\
53
		echo "----------------------------------------------------------------------"; 			\
54
		echo "\033[1m                      $$failed test(s) Failed \033[0m"; 					\
55
		echo "----------------------------------------------------------------------"; 			\
56
	else 																						\
57
		echo "----------------------------------------------------------------------"; 			\
58
		echo "\033[1m                      All tests was successful \033[0m"; 					\
59
		echo "----------------------------------------------------------------------"; 			\
60
	fi
61
62
.PHONY: all generate clean check test