Skip to content

Commit d12f030

Browse files
Seperate Java regression and unit tests from non-Java tests
This is a rather blunt change which could probably be done in a more elegant way, but I'm trying to keep this patch as small as possible with the view to later patches making bigger changes.
1 parent 784b6dd commit d12f030

File tree

187 files changed

+320
-145
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

187 files changed

+320
-145
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ set_target_properties(
7777
solvers
7878
test-bigint
7979
testing-utils
80+
java-testing-utils
8081
unit
8182
util
8283
xml

regression/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ add_subdirectory(cbmc-cover)
3535
add_subdirectory(goto-instrument-typedef)
3636
add_subdirectory(strings)
3737
add_subdirectory(invariants)
38-
add_subdirectory(goto-diff)
38+
add_subdirectory(goto-diff-java)
3939
add_subdirectory(test-script)
4040
add_subdirectory(goto-analyzer-taint)
4141
add_subdirectory(cbmc-java-inheritance)
@@ -45,4 +45,5 @@ endif()
4545
add_subdirectory(goto-cc-cbmc)
4646
add_subdirectory(cbmc-cpp)
4747
add_subdirectory(goto-cc-goto-analyzer)
48+
add_subdirectory(goto-diff)
4849

regression/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,15 @@ DIRS = cbmc \
1414
smt2_solver \
1515
strings \
1616
invariants \
17-
goto-diff \
17+
goto-diff-java \
1818
test-script \
1919
goto-analyzer-taint \
2020
cbmc-java-inheritance \
2121
goto-gcc \
2222
goto-cc-cbmc \
2323
cbmc-cpp \
2424
goto-cc-goto-analyzer \
25+
goto-diff \
2526
# Empty last line
2627

2728
# Tests under goto-gcc cannot be run on Windows, so appveyor.yml unlinks
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
add_test_pl_tests(
2+
"$<TARGET_FILE:goto-diff>"
3+
)

regression/goto-diff-java/Makefile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
default: tests.log
2+
3+
test:
4+
@../test.pl -p -c ../../../src/goto-diff/goto-diff
5+
6+
tests.log: ../test.pl
7+
@../test.pl -p -c ../../../src/goto-diff/goto-diff
8+
9+
show:
10+
@for dir in *; do \
11+
if [ -d "$$dir" ]; then \
12+
vim -o "$$dir/*.c" "$$dir/*.out"; \
13+
fi; \
14+
done;
15+
16+
clean:
17+
find -name '*.out' -execdir $(RM) '{}' \;
18+
$(RM) tests.log

unit/CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ file(GLOB_RECURSE sources "*.cpp" "*.h")
22

33
file(GLOB_RECURSE testing_utils "testing-utils/*.cpp" "testing-utils/*.h")
44

5+
file(GLOB_RECURSE java_testing_utils
6+
"java_bytecode/testing-utils/*.cpp"
7+
"java_bytecode/testing-utils/*.h")
8+
59
list(REMOVE_ITEM sources
610
# Used in executables
711
${CMAKE_CURRENT_SOURCE_DIR}/miniBDD.cpp
@@ -21,12 +25,14 @@ list(REMOVE_ITEM sources
2125

2226
# Will be built into a separate library and linked
2327
${testing_utils}
28+
${java_testing_utils}
2429

2530
# Intended to fail to compile
2631
${CMAKE_CURRENT_SOURCE_DIR}/util/expr_cast/expr_undefined_casts.cpp
2732
)
2833

2934
add_subdirectory(testing-utils)
35+
add_subdirectory(java_bytecode/testing-utils)
3036

3137
add_executable(unit ${sources})
3238
target_include_directories(unit
@@ -38,6 +44,7 @@ target_include_directories(unit
3844
target_link_libraries(
3945
unit
4046
testing-utils
47+
java-testing-utils
4148
ansi-c
4249
solvers
4350
java_bytecode

unit/Makefile

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ SRC += unit_tests.cpp \
1313
analyses/does_remove_const/does_type_preserve_const_correctness.cpp \
1414
analyses/does_remove_const/is_type_at_least_as_const_as.cpp \
1515
goto-programs/goto_trace_output.cpp \
16-
goto-programs/class_hierarchy_output.cpp \
17-
goto-programs/class_hierarchy_graph.cpp \
18-
goto-programs/remove_virtual_functions_without_fallback.cpp \
16+
java_bytecode/goto-programs/class_hierarchy_output.cpp \
17+
java_bytecode/goto-programs/class_hierarchy_graph.cpp \
18+
java_bytecode/goto-programs/remove_virtual_functions_without_fallback.cpp \
1919
java_bytecode/java_bytecode_convert_class/convert_abstract_class.cpp \
2020
java_bytecode/java_bytecode_convert_method/convert_invoke_dynamic.cpp \
2121
java_bytecode/java_bytecode_parse_generics/parse_generic_class.cpp \
@@ -31,26 +31,28 @@ SRC += unit_tests.cpp \
3131
java_bytecode/java_utils_test.cpp \
3232
java_bytecode/inherited_static_fields/inherited_static_fields.cpp \
3333
path_strategies.cpp \
34-
pointer-analysis/custom_value_set_analysis.cpp \
34+
java_bytecode/pointer-analysis/custom_value_set_analysis.cpp \
3535
sharing_node.cpp \
3636
solvers/refinement/string_constraint_generator_valueof/calculate_max_string_length.cpp \
3737
solvers/refinement/string_constraint_generator_valueof/get_numeric_value_from_character.cpp \
3838
solvers/refinement/string_constraint_generator_valueof/is_digit_with_radix.cpp \
39-
solvers/refinement/string_constraint_instantiation/instantiate_not_contains.cpp \
39+
java_bytecode/solvers_instantiate_not_contains.cpp \
4040
solvers/refinement/string_refinement/concretize_array.cpp \
41-
solvers/refinement/string_refinement/dependency_graph.cpp \
41+
java_bytecode/solvers_dependency_graph.cpp \
4242
solvers/refinement/string_refinement/substitute_array_list.cpp \
43-
solvers/refinement/string_refinement/string_symbol_resolution.cpp \
43+
java_bytecode/solvers_string_symbol_resolution.cpp \
4444
solvers/refinement/string_refinement/sparse_array.cpp \
4545
solvers/refinement/string_refinement/union_find_replace.cpp \
4646
util/expr_cast/expr_cast.cpp \
4747
util/expr_iterator.cpp \
4848
util/has_subtype.cpp \
49+
java_bytecode/util/has_subtype.cpp \
4950
util/irep.cpp \
5051
util/irep_sharing.cpp \
5152
util/message.cpp \
5253
util/optional.cpp \
53-
util/parameter_indices.cpp \
54+
java_bytecode/util/parameter_indices.cpp \
55+
java_bytecode/util/simplify_expr.cpp \
5456
util/simplify_expr.cpp \
5557
util/small_shared_two_way_ptr.cpp \
5658
util/string_utils/split_string.cpp \
@@ -62,6 +64,7 @@ SRC += unit_tests.cpp \
6264
# Empty last line
6365

6466
INCLUDES= -I ../src/ -I.
67+
INCLUDES+= -I ./java_bytecode
6568

6669
include ../src/config.inc
6770
include ../src/common
@@ -72,6 +75,9 @@ cprover.dir:
7275
testing-utils.dir:
7376
$(MAKE) $(MAKEARGS) -C testing-utils
7477

78+
java-testing-utils.dir:
79+
$(MAKE) $(MAKEARGS) -C java_bytecode/testing-utils
80+
7581
# We need to link bmc.o to the unit test, so here's everything it depends on...
7682
BMC_DEPS =../src/cbmc/all_properties$(OBJEXT) \
7783
../src/cbmc/bmc$(OBJEXT) \
@@ -118,15 +124,17 @@ CPROVER_LIBS =../src/java_bytecode/java_bytecode$(LIBEXT) \
118124
$(BMC_DEPS)
119125
# Empty last line
120126

121-
OBJ += $(CPROVER_LIBS) testing-utils/testing-utils$(LIBEXT)
127+
OBJ += $(CPROVER_LIBS) \
128+
testing-utils/testing-utils$(LIBEXT) \
129+
java_bytecode/testing-utils/java-testing-utils$(LIBEXT)
122130

123131
TESTS = unit_tests$(EXEEXT) \
124132
miniBDD$(EXEEXT) \
125133
# Empty last line
126134

127135
CLEANFILES = $(TESTS)
128136

129-
all: cprover.dir testing-utils.dir
137+
all: cprover.dir testing-utils.dir java-testing-utils.dir
130138
$(MAKE) $(MAKEARGS) $(TESTS)
131139

132140
test: all

unit/goto-programs/class_hierarchy_graph.cpp renamed to unit/java_bytecode/goto-programs/class_hierarchy_graph.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ void require_parent_child_relationship(
2828

2929
SCENARIO(
3030
"Output a simple class hierarchy"
31-
"[core][goto-programs][class_hierarchy_graph]")
31+
"[core][java_bytecode][goto-programs][class_hierarchy_graph]")
3232
{
3333
symbol_tablet symbol_table =
34-
load_java_class("HierarchyTest", "goto-programs/");
34+
load_java_class("HierarchyTest", "java_bytecode/goto-programs/");
3535
class_hierarchy_grapht hierarchy;
3636
hierarchy.populate(symbol_table);
3737

unit/goto-programs/class_hierarchy_output.cpp renamed to unit/java_bytecode/goto-programs/class_hierarchy_output.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ void require_parent_child_relationship(
3737

3838
SCENARIO(
3939
"Output a simple class hierarchy"
40-
"[core][goto-programs][class_hierarchy]")
40+
"[core][java_bytecode][goto-programs][class_hierarchy]")
4141
{
4242
symbol_tablet symbol_table =
43-
load_java_class("HierarchyTest", "goto-programs/");
43+
load_java_class("HierarchyTest", "java_bytecode/goto-programs/");
4444
class_hierarchyt hierarchy;
4545

4646
std::stringstream output_stream;

unit/goto-programs/goto_program_generics/generic_bases_test.cpp renamed to unit/java_bytecode/goto-programs/goto_program_generics/generic_bases_test.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@
1919

2020
SCENARIO(
2121
"Instantiate generic parameters of superclasses",
22-
"[core][goto_program_generics][generic_bases_test]")
22+
"[core][java_bytecode][goto_program_generics][generic_bases_test]")
2323
{
2424
GIVEN(
2525
"A class extending a generic class instantiated with a standard library "
2626
"class")
2727
{
2828
const symbol_tablet &symbol_table = load_java_class(
2929
"SuperclassInst",
30-
"./goto-programs/goto_program_generics",
30+
"./java_bytecode/goto-programs/goto_program_generics",
3131
"SuperclassInst.foo");
3232

3333
WHEN("The method input argument is created in the entry point function")
@@ -68,7 +68,7 @@ SCENARIO(
6868
{
6969
const symbol_tablet &symbol_table = load_java_class(
7070
"SuperclassInst2",
71-
"./goto-programs/goto_program_generics",
71+
"./java_bytecode/goto-programs/goto_program_generics",
7272
"SuperclassInst2.foo");
7373

7474
WHEN("The method input argument is created in the entry point function")
@@ -99,7 +99,7 @@ SCENARIO(
9999
{
100100
const symbol_tablet &symbol_table = load_java_class(
101101
"SuperclassInst3",
102-
"./goto-programs/goto_program_generics",
102+
"./java_bytecode/goto-programs/goto_program_generics",
103103
"SuperclassInst3.foo");
104104

105105
WHEN("The method input argument is created in the entry point function")
@@ -142,7 +142,7 @@ SCENARIO(
142142
{
143143
const symbol_tablet &symbol_table = load_java_class(
144144
"SuperclassUninstTest",
145-
"./goto-programs/goto_program_generics",
145+
"./java_bytecode/goto-programs/goto_program_generics",
146146
"SuperclassUninstTest.foo");
147147

148148
WHEN("The method input argument is created in the entry point function")
@@ -187,7 +187,7 @@ SCENARIO(
187187
{
188188
const symbol_tablet &symbol_table = load_java_class(
189189
"SuperclassMixedTest",
190-
"./goto-programs/goto_program_generics",
190+
"./java_bytecode/goto-programs/goto_program_generics",
191191
"SuperclassMixedTest.foo");
192192

193193
WHEN("The method input argument is created in the entry point function")
@@ -240,7 +240,7 @@ SCENARIO(
240240
{
241241
const symbol_tablet &symbol_table = load_java_class(
242242
"SuperclassInnerInst",
243-
"./goto-programs/goto_program_generics",
243+
"./java_bytecode/goto-programs/goto_program_generics",
244244
"SuperclassInnerInst.foo");
245245

246246
WHEN("The method input argument is created in the entry point function")
@@ -309,7 +309,7 @@ SCENARIO(
309309
{
310310
const symbol_tablet &symbol_table = load_java_class(
311311
"SuperclassInnerUninstTest",
312-
"./goto-programs/goto_program_generics",
312+
"./java_bytecode/goto-programs/goto_program_generics",
313313
"SuperclassInnerUninstTest.foo");
314314

315315
WHEN("The method input argument is created in the entry point function")
@@ -417,15 +417,15 @@ SCENARIO(
417417

418418
SCENARIO(
419419
"Ignore generics for incomplete and non-generic bases",
420-
"[core][goto_program_generics][generic_bases_test]")
420+
"[core][java_bytecode][goto_program_generics][generic_bases_test]")
421421
{
422422
GIVEN(
423423
"A class extending a generic class with unsupported class signature (thus"
424424
" not marked as generic)")
425425
{
426426
const symbol_tablet &symbol_table = load_java_class(
427427
"SuperclassUnsupported",
428-
"./goto-programs/goto_program_generics",
428+
"./java_bytecode/goto-programs/goto_program_generics",
429429
"SuperclassUnsupported.foo");
430430

431431
THEN("The struct for UnsupportedWrapper1 is complete and non-generic")
@@ -474,7 +474,7 @@ SCENARIO(
474474
{
475475
const symbol_tablet &symbol_table = load_java_class(
476476
"SuperclassOpaque",
477-
"./goto-programs/goto_program_generics",
477+
"./java_bytecode/goto-programs/goto_program_generics",
478478
"SuperclassOpaque.foo");
479479

480480
THEN("The struct for OpaqueWrapper is incomplete and not-generic")

0 commit comments

Comments
 (0)