Skip to content

Commit eff3900

Browse files
author
Daniel Kroening
committed
split out ccover from cbmc
1 parent 8befd02 commit eff3900

File tree

23 files changed

+1330
-5
lines changed

23 files changed

+1330
-5
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@ src/memory-models/mm_y.tab.h
9595
# binaries
9696
src/cbmc/cbmc
9797
src/cbmc/cbmc.exe
98+
src/ccover/ccover
99+
src/ccover/ccover.exe
98100
src/goto-analyzer/goto-analyzer
99101
src/goto-analyzer/goto-analyzer.exe
100102
src/goto-cc/goto-cc

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ set_target_properties(
5151
big-int
5252
cbmc
5353
cbmc-lib
54+
ccover
55+
ccover-lib
5456
clobber
5557
clobber-lib
5658
cpp

regression/ccover/Makefile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
default: tests.log
2+
3+
test:
4+
@../test.pl -p -c ../../../src/ccover/ccover -X smt-backend
5+
6+
tests.log: ../test.pl
7+
@../test.pl -p -c ../../../src/ccover/ccover -X smt-backend
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+
find -name '*.gb' -execdir $(RM) '{}' \;
19+
$(RM) tests.log

src/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ add_subdirectory(xmllang)
9999
add_subdirectory(clobber)
100100

101101
add_subdirectory(cbmc)
102+
add_subdirectory(ccover)
102103
add_subdirectory(goto-cc)
103104
add_subdirectory(goto-instrument)
104105
add_subdirectory(goto-analyzer)

src/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ DIRS = analyses \
33
assembler \
44
big-int \
55
cbmc \
6+
ccover \
67
clobber \
78
cpp \
89
goto-analyzer \
@@ -23,6 +24,7 @@ DIRS = analyses \
2324
# Empty last line
2425

2526
all: cbmc.dir \
27+
ccover.dir \
2628
goto-analyzer.dir \
2729
goto-cc.dir \
2830
goto-diff.dir \
@@ -55,6 +57,8 @@ cbmc.dir: languages solvers.dir goto-symex.dir analyses.dir \
5557
pointer-analysis.dir goto-programs.dir linking.dir \
5658
goto-instrument.dir
5759

60+
ccover.dir: cbmc.dir
61+
5862
goto-analyzer.dir: languages analyses.dir goto-programs.dir linking.dir \
5963
json.dir goto-instrument.dir
6064

src/ccover/CMakeLists.txt

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Library
2+
file(GLOB_RECURSE sources "*.cpp" "*.h")
3+
list(REMOVE_ITEM sources
4+
${CMAKE_CURRENT_SOURCE_DIR}/ccover_main.cpp
5+
)
6+
add_library(ccover-lib ${sources})
7+
8+
generic_includes(ccover-lib)
9+
10+
target_link_libraries(ccover-lib
11+
analyses
12+
ansi-c
13+
assembler
14+
big-int
15+
cbmc-lib
16+
cpp
17+
goto-instrument-lib
18+
goto-programs
19+
goto-symex
20+
java_bytecode
21+
json
22+
langapi
23+
linking
24+
pointer-analysis
25+
solvers
26+
util
27+
xml
28+
)
29+
30+
add_if_library(ccover-lib bv_refinement)
31+
add_if_library(ccover-lib jsil)
32+
33+
# Executable
34+
add_executable(ccover ccover_main.cpp)
35+
target_link_libraries(ccover ccover-lib)

src/ccover/Makefile

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
SRC = ccover_bmc.cpp \
2+
bmc_cover.cpp \
3+
ccover_main.cpp \
4+
ccover_parse_options.cpp \
5+
# Empty last line
6+
7+
OBJ += ../ansi-c/ansi-c$(LIBEXT) \
8+
../cpp/cpp$(LIBEXT) \
9+
../java_bytecode/java_bytecode$(LIBEXT) \
10+
../linking/linking$(LIBEXT) \
11+
../big-int/big-int$(LIBEXT) \
12+
../goto-programs/goto-programs$(LIBEXT) \
13+
../goto-symex/goto-symex$(LIBEXT) \
14+
../pointer-analysis/value_set$(OBJEXT) \
15+
../pointer-analysis/value_set_analysis_fi$(OBJEXT) \
16+
../pointer-analysis/value_set_domain_fi$(OBJEXT) \
17+
../pointer-analysis/value_set_fi$(OBJEXT) \
18+
../pointer-analysis/value_set_dereference$(OBJEXT) \
19+
../pointer-analysis/dereference_callback$(OBJEXT) \
20+
../pointer-analysis/add_failed_symbols$(OBJEXT) \
21+
../pointer-analysis/rewrite_index$(OBJEXT) \
22+
../pointer-analysis/goto_program_dereference$(OBJEXT) \
23+
../goto-instrument/full_slicer$(OBJEXT) \
24+
../goto-instrument/nondet_static$(OBJEXT) \
25+
../goto-instrument/cover$(OBJEXT) \
26+
../goto-instrument/cover_basic_blocks$(OBJEXT) \
27+
../goto-instrument/cover_filter$(OBJEXT) \
28+
../goto-instrument/cover_instrument_branch$(OBJEXT) \
29+
../goto-instrument/cover_instrument_condition$(OBJEXT) \
30+
../goto-instrument/cover_instrument_decision$(OBJEXT) \
31+
../goto-instrument/cover_instrument_location$(OBJEXT) \
32+
../goto-instrument/cover_instrument_mcdc$(OBJEXT) \
33+
../goto-instrument/cover_instrument_other$(OBJEXT) \
34+
../goto-instrument/cover_util$(OBJEXT) \
35+
../goto-instrument/unwindset$(OBJEXT) \
36+
../analyses/analyses$(LIBEXT) \
37+
../langapi/langapi$(LIBEXT) \
38+
../xmllang/xmllang$(LIBEXT) \
39+
../assembler/assembler$(LIBEXT) \
40+
../solvers/solvers$(LIBEXT) \
41+
../util/util$(LIBEXT) \
42+
../json/json$(LIBEXT) \
43+
../cbmc/bv_cbmc$(OBJEXT) \
44+
../cbmc/cbmc_dimacs$(OBJEXT) \
45+
../cbmc/cbmc_solvers$(OBJEXT) \
46+
../cbmc/symex_bmc$(OBJEXT)
47+
48+
INCLUDES= -I ..
49+
50+
LIBS =
51+
52+
include ../config.inc
53+
include ../common
54+
55+
CLEANFILES = ccover$(EXEEXT)
56+
57+
all: ccover$(EXEEXT)
58+
59+
ifneq ($(wildcard ../bv_refinement/Makefile),)
60+
OBJ += ../bv_refinement/bv_refinement$(LIBEXT)
61+
CP_CXXFLAGS += -DHAVE_BV_REFINEMENT
62+
endif
63+
64+
ifneq ($(wildcard ../jsil/Makefile),)
65+
OBJ += ../jsil/jsil$(LIBEXT)
66+
CP_CXXFLAGS += -DHAVE_JSIL
67+
endif
68+
69+
###############################################################################
70+
71+
ccover$(EXEEXT): $(OBJ)
72+
$(LINKBIN)
73+
74+
.PHONY: ccover-mac-signed
75+
76+
ccover-mac-signed: ccover$(EXEEXT)
77+
strip ccover$(EXEEXT) ; codesign -v -s $(OSX_IDENTITY) ccover$(EXEEXT)

src/cbmc/bmc_cover.cpp renamed to src/ccover/bmc_cover.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Author: Daniel Kroening, kroening@kroening.com
99
/// \file
1010
/// Test-Suite Generation with BMC
1111

12-
#include "bmc.h"
12+
#include "ccover_bmc.h"
1313

1414
#include <chrono>
1515
#include <iomanip>
@@ -29,7 +29,7 @@ Author: Daniel Kroening, kroening@kroening.com
2929

3030
#include <langapi/language_util.h>
3131

32-
#include "bv_cbmc.h"
32+
#include <cbmc/bv_cbmc.h>
3333

3434
class bmc_covert:
3535
public cover_goalst::observert,
@@ -38,7 +38,7 @@ class bmc_covert:
3838
public:
3939
bmc_covert(
4040
const goto_functionst &_goto_functions,
41-
bmct &_bmc):
41+
ccover_bmct &_bmc):
4242
goto_functions(_goto_functions), solver(_bmc.prop_conv), bmc(_bmc)
4343
{
4444
}
@@ -141,7 +141,7 @@ class bmc_covert:
141141
protected:
142142
const goto_functionst &goto_functions;
143143
prop_convt &solver;
144-
bmct &bmc;
144+
ccover_bmct &bmc;
145145
};
146146

147147
void bmc_covert::satisfying_assignment()
@@ -426,7 +426,7 @@ bool bmc_covert::operator()()
426426
}
427427

428428
/// Try to cover all goals
429-
bool bmct::cover(
429+
bool ccover_bmct::cover(
430430
const goto_functionst &goto_functions,
431431
const optionst::value_listt &criteria)
432432
{

0 commit comments

Comments
 (0)