File tree 5 files changed +47
-17
lines changed
regression/goto-harness-multi-file-project
static_symbols_referencing 5 files changed +47
-17
lines changed Original file line number Diff line number Diff line change 1
- if (" ${CMAKE_SYSTEM_NAME} " STREQUAL "Windows" )
2
- set (exclude_win_broken_tests -X winbug )
1
+ if (WIN32 )
2
+ set (is_windows true )
3
3
else ()
4
- set (exclude_win_broken_tests "" )
4
+ set (is_windows false )
5
5
endif ()
6
6
7
7
add_test_pl_tests(
8
- "${CMAKE_CURRENT_LIST_DIR} /chain.sh $<TARGET_FILE:goto-cc> $<TARGET_FILE:goto-harness> $<TARGET_FILE:cbmc>" ${exclude_win_broken_tests} )
8
+ "${CMAKE_CURRENT_LIST_DIR} /chain.sh \
9
+ $<TARGET_FILE:goto-cc> \
10
+ $<TARGET_FILE:goto-harness> \
11
+ $<TARGET_FILE:cbmc> \
12
+ ${is_windows} " )
Original file line number Diff line number Diff line change 1
- default : test
1
+ default : tests.log
2
+
3
+ include ../../src/config.inc
4
+ include ../../src/common
5
+
6
+ GOTO_HARNESS_EXE =../../../src/goto-harness/goto-harness
7
+ CBMC_EXE =../../../src/cbmc/cbmc
8
+
9
+ ifeq ($(BUILD_ENV_ ) ,MSVC)
10
+ GOTO_CC_EXE=../../../src/goto-cc/goto-cl
11
+ is_windows=true
12
+ else
13
+ GOTO_CC_EXE=../../../src/goto-cc/goto-cc
14
+ is_windows=false
15
+ endif
2
16
3
17
test :
4
- @../test.pl -e -p -c " ../chain.sh \
5
- ../../../src/goto-cc/goto-cc \
6
- ../../../src/goto-harness/goto-harness \
7
- ../../../src/cbmc/cbmc"
18
+ @../test.pl -e -p -c " ../chain.sh $( GOTO_CC_EXE) $( GOTO_HARNESS_EXE) $( CBMC_EXE) $( is_windows) "
19
+
20
+ tests.log : ../test.pl
21
+ @../test.pl -e -p -c " ../chain.sh $( GOTO_CC_EXE) $( GOTO_HARNESS_EXE) $( CBMC_EXE) $( is_windows) "
22
+
8
23
clean :
9
24
find -name ' *.out' -execdir $(RM ) ' {}' \;
10
25
$(RM ) tests.log
Original file line number Diff line number Diff line change 5
5
goto_cc=" $1 "
6
6
goto_harness=" $2 "
7
7
cbmc=" $3 "
8
- goto_harness_args=" ${@: 4: $# -4} "
8
+ is_windows=$4
9
+ goto_harness_args=" ${@: 5: $# -5} "
9
10
10
11
cleanup ()
11
12
{
@@ -14,19 +15,29 @@ cleanup()
14
15
15
16
trap cleanup EXIT
16
17
17
- source_dir=" $( pwd) "
18
- target_dir=" $( mktemp -d) "
18
+ # create the temporary directory relative to the current directory, thus
19
+ # avoiding file names that start with a "/", which confuses goto-cl (Windows)
20
+ # when running in git-bash.
21
+ target_dir=" $( TMPDIR=. mktemp -d) "
19
22
20
23
# Compiling
21
- for file in " $source_dir " / * .c; do
24
+ for file in * .c; do
22
25
file_name=" $( basename " $file " ) "
23
- " $goto_cc " -c " $file " -o " $target_dir " /" ${file_name% .c} .o"
26
+ if [[ " ${is_windows} " == " true" ]]; then
27
+ " $goto_cc " " /c" " $file " " /Fo$target_dir /${file_name% .c} .obj"
28
+ else
29
+ " $goto_cc " -c " $file " -o " $target_dir " /" ${file_name% .c} .o"
30
+ fi
24
31
done
25
32
26
33
# Linking
27
34
28
35
main_exe=" $target_dir /main.gb"
29
- " $goto_cc " " $target_dir " /* .o -o " $main_exe "
36
+ if [[ " ${is_windows} " == " true" ]]; then
37
+ " $goto_cc " " $target_dir " /* .obj " /Fe$main_exe "
38
+ else
39
+ " $goto_cc " " $target_dir " /* .o -o " $main_exe "
40
+ fi
30
41
31
42
harness_out_file=" $target_dir /harness.c"
32
43
" $goto_harness " " $main_exe " " $harness_out_file " --harness-function-name harness $goto_harness_args
Original file line number Diff line number Diff line change 1
- CORE winbug
1
+ CORE
2
2
dummy.c
3
3
--function main --harness-type call-function
4
4
\[default_serve\.assertion\.1\] line \d+ assertion 0 && \"default serve should fail so we can see it is being called\": FAILURE
Original file line number Diff line number Diff line change 1
- CORE winbug
1
+ CORE
2
2
dummy.c
3
3
--function another --harness-type call-function
4
4
^EXIT=10$
You can’t perform that action at this time.
0 commit comments