1
- .PHONY : all cprover.dir jprover.dir testing-utils.dir java-testing-utils.dir test
1
+ .PHONY : all jprover.dir test java-testing-utils-clean
2
2
3
3
# Source files for test utilities
4
4
SRC = $(CPROVER_DIR ) /unit/unit_tests.cpp \
5
5
# Empty last line
6
6
7
7
# Test source files
8
- SRC += java_bytecode/goto-programs/class_hierarchy_output.cpp \
8
+ SRC += java_bytecode/ci_lazy_methods/lazy_load_lambdas.cpp \
9
+ java_bytecode/expr2java.cpp \
10
+ java_bytecode/goto_program_generics/generic_bases_test.cpp \
11
+ java_bytecode/goto_program_generics/generic_parameters_test.cpp \
12
+ java_bytecode/goto_program_generics/mutually_recursive_generics.cpp \
9
13
java_bytecode/goto-programs/class_hierarchy_graph.cpp \
14
+ java_bytecode/goto-programs/class_hierarchy_output.cpp \
10
15
java_bytecode/goto-programs/remove_virtual_functions_without_fallback.cpp \
16
+ java_bytecode/inherited_static_fields/inherited_static_fields.cpp \
11
17
java_bytecode/java_bytecode_convert_class/convert_abstract_class.cpp \
12
18
java_bytecode/java_bytecode_convert_class/convert_java_annotations.cpp \
19
+ java_bytecode/java_bytecode_convert_method/convert_initalizers.cpp \
13
20
java_bytecode/java_bytecode_convert_method/convert_invoke_dynamic.cpp \
21
+ java_bytecode/java_bytecode_convert_method/convert_method.cpp \
22
+ java_bytecode/java_bytecode_parse_generics/parse_bounded_generic_inner_classes.cpp \
23
+ java_bytecode/java_bytecode_parse_generics/parse_derived_generic_class.cpp \
24
+ java_bytecode/java_bytecode_parse_generics/parse_functions_with_generics.cpp \
25
+ java_bytecode/java_bytecode_parse_generics/parse_generic_array_class.cpp \
14
26
java_bytecode/java_bytecode_parse_generics/parse_generic_class.cpp \
15
- java_bytecode/java_bytecode_parser/parse_java_class.cpp \
27
+ java_bytecode/java_bytecode_parse_generics/parse_generic_class_with_generic_inner_classes.cpp \
28
+ java_bytecode/java_bytecode_parse_generics/parse_generic_class_with_inner_classes.cpp \
29
+ java_bytecode/java_bytecode_parse_generics/parse_generic_fields.cpp \
30
+ java_bytecode/java_bytecode_parse_generics/parse_generic_functions.cpp \
31
+ java_bytecode/java_bytecode_parse_generics/parse_generic_superclasses.cpp \
32
+ java_bytecode/java_bytecode_parse_generics/parse_generic_wildcard_function.cpp \
33
+ java_bytecode/java_bytecode_parse_generics/parse_nested_generics.cpp \
34
+ java_bytecode/java_bytecode_parse_generics/parse_recursive_generic_class.cpp \
35
+ java_bytecode/java_bytecode_parse_generics/parse_signature_descriptor_mismatch.cpp \
36
+ java_bytecode/java_bytecode_parse_lambdas/java_bytecode_convert_class_lambda_method_handles.cpp \
37
+ java_bytecode/java_bytecode_parse_lambdas/java_bytecode_parse_lambda_method_table.cpp \
38
+ java_bytecode/java_bytecode_parser/parse_java_annotations.cpp \
16
39
java_bytecode/java_bytecode_parser/parse_java_attributes.cpp \
40
+ java_bytecode/java_bytecode_parser/parse_java_class.cpp \
17
41
java_bytecode/java_object_factory/gen_nondet_string_init.cpp \
18
- java_bytecode/java_bytecode_parse_lambdas/java_bytecode_parse_lambda_method_table.cpp \
19
- java_bytecode/java_bytecode_parse_lambdas/java_bytecode_convert_class_lambda_method_handles.cpp \
42
+ java_bytecode/java_replace_nondet/replace_nondet.cpp \
20
43
java_bytecode/java_string_library_preprocess/convert_exprt_to_string_exprt.cpp \
21
44
java_bytecode/java_types/erase_type_arguments.cpp \
22
45
java_bytecode/java_types/generic_type_index.cpp \
23
46
java_bytecode/java_types/java_generic_symbol_type.cpp \
24
47
java_bytecode/java_types/java_type_from_string.cpp \
25
48
java_bytecode/java_utils_test.cpp \
49
+ java_bytecode/java_virtual_functions/virtual_functions.cpp \
26
50
java_bytecode/load_method_by_regex.cpp \
27
- java_bytecode/inherited_static_fields/inherited_static_fields.cpp \
28
51
pointer-analysis/custom_value_set_analysis.cpp \
29
52
solvers/refinement/string_constraint_instantiation/instantiate_not_contains.cpp \
30
53
solvers/refinement/string_refinement/dependency_graph.cpp \
@@ -33,9 +56,6 @@ SRC += java_bytecode/goto-programs/class_hierarchy_output.cpp \
33
56
util/has_subtype.cpp \
34
57
util/parameter_indices.cpp \
35
58
util/simplify_expr.cpp \
36
- java_bytecode/java_virtual_functions/virtual_functions.cpp \
37
- java_bytecode/java_bytecode_parse_generics/parse_generic_superclasses.cpp \
38
- java_bytecode/goto_program_generics/mutually_recursive_generics.cpp \
39
59
# Empty last line
40
60
41
61
INCLUDES = -I ../src/ -I. -I $(CPROVER_DIR ) /src -I $(CPROVER_DIR ) /unit
@@ -44,18 +64,18 @@ include ../src/config.inc
44
64
include $(CPROVER_DIR ) /src/config.inc
45
65
include $(CPROVER_DIR ) /src/common
46
66
47
- cprover.dir :
48
- $(MAKE ) $(MAKEARGS ) -C $(CPROVER_DIR ) /src
49
-
50
67
jprover.dir :
51
68
$(MAKE ) $(MAKEARGS ) -C ../src
52
69
53
- cprover- testing-utils.dir:
70
+ $( CPROVER_DIR ) /unit/testing-utils/ testing-utils$( LIBEXT ) : jprover .dir
54
71
$(MAKE ) $(MAKEARGS ) -C $(CPROVER_DIR ) /unit/testing-utils
55
72
56
- java-testing-utils.dir :
73
+ java-testing-utils/java-testing-utils $( LIBEXT ) : jprover .dir
57
74
$(MAKE ) $(MAKEARGS ) -C java-testing-utils
58
75
76
+ java-testing-utils-clean :
77
+ $(MAKE ) $(MAKEARGS ) -C java-testing-utils clean
78
+
59
79
# We need to link bmc.o to the unit test, so here's everything it depends on...
60
80
BMC_DEPS =$(CPROVER_DIR ) /src/cbmc/all_properties$(OBJEXT ) \
61
81
$(CPROVER_DIR ) /src/cbmc/bmc$(OBJEXT ) \
@@ -118,16 +138,25 @@ OBJ += $(CPROVER_LIBS) \
118
138
$(CPROVER_DIR ) /unit/testing-utils/testing-utils$(LIBEXT ) \
119
139
java-testing-utils/java-testing-utils$(LIBEXT )
120
140
121
- TESTS = unit_tests$(EXEEXT ) \
122
- # Empty last line
141
+ CATCH_TEST = unit_tests$(EXEEXT )
142
+ N_CATCH_TESTS = $(shell \
143
+ cat $$(find . -name "*.cpp" ) | \
144
+ grep -c -E "(SCENARIO|TEST_CASE) ")
145
+
146
+ CLEANFILES = $(CATCH_TEST ) java-testing-utils/java-testing-utils$(LIBEXT )
147
+
148
+ # only add a dependency for libraries to avoid triggering implicit rules, which
149
+ # would cause unnecessary rebuilds
150
+ $(filter % $(LIBEXT ) , CPROVER_LIBS) : jprover.dir
123
151
124
- CLEANFILES = $( TESTS )
152
+ all : $( CATCH_TEST )
125
153
126
- all : cprover.dir cprover-testing-utils.dir jprover.dir java-testing-utils.dir
127
- $(MAKE ) $(MAKEARGS ) $(TESTS )
154
+ clean : java-testing-utils-clean
128
155
129
- test : all
130
- $(foreach test,$(TESTS ) , (echo Running: $(test ) ; ./$(test ) ) && ) true
156
+ test : $(CATCH_TEST )
157
+ if ! ./$( CATCH_TEST) -l | grep -q " ^$( N_CATCH_TESTS) test cases" ; then \
158
+ ./$(CATCH_TEST ) -l ; fi
159
+ ./$(CATCH_TEST )
131
160
132
161
133
162
# ##############################################################################
0 commit comments