Skip to content

Commit f365afe

Browse files
author
Thomas Kiley
authored
Merge pull request diffblue#1392 from reuk/reuk/fixup-appveyor-regressions
Ensure new regression folders work with Make *and* CMake
2 parents 523f028 + 63fc53b commit f365afe

File tree

8 files changed

+76
-31
lines changed

8 files changed

+76
-31
lines changed

appveyor.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -61,16 +61,6 @@ test_script:
6161
- cmd: |
6262
cd regression
6363
64-
sed -i "s/goto-cc\/goto-cc/goto-cc\/goto-cl/" goto-cc-cbmc/chain.sh || true
65-
sed -i "11s/.*/$GC $NAME.c/" goto-cc-cbmc/chain.sh || true
66-
sed -i "12i mv $NAME.exe $NAME.gb" goto-cc-cbmc/chain.sh || true
67-
cat goto-cc-cbmc/chain.sh || true
68-
69-
sed -i "s/goto-cc\/goto-cc/goto-cc\/goto-cl/" goto-cc-goto-analyzer/chain.sh || true
70-
sed -i "11s/.*/$gc $name.c/" goto-cc-goto-analyzer/chain.sh || true
71-
sed -i "12i mv $name.exe $name.gb" goto-cc-goto-analyzer/chain.sh || true
72-
cat goto-cc-goto-analyzer/chain.sh || true
73-
7464
rem HACK disable failing tests
7565
rmdir /s /q ansi-c\arch_flags_mcpu_bad
7666
rmdir /s /q ansi-c\arch_flags_mcpu_good

regression/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ add_subdirectory(cbmc-java)
2727
add_subdirectory(cbmc-java-inheritance)
2828
add_subdirectory(cpp)
2929
add_subdirectory(goto-analyzer)
30+
add_subdirectory(goto-cc-cbmc)
31+
add_subdirectory(goto-cc-goto-analyzer)
3032
add_subdirectory(goto-diff)
3133
add_subdirectory(goto-instrument)
3234
add_subdirectory(goto-instrument-typedef)
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
if(WIN32)
2+
set(is_windows true)
3+
else()
4+
set(is_windows false)
5+
endif()
6+
7+
add_test_pl_tests(
8+
"goto-cc-cbmc"
9+
"${CMAKE_CURRENT_SOURCE_DIR}/chain.sh $<TARGET_FILE:goto-cc> $<TARGET_FILE:cbmc> ${is_windows}"
10+
)

regression/goto-cc-cbmc/Makefile

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,24 @@
11
default: tests.log
22

3+
include ../../src/config.inc
4+
include ../../src/common
5+
6+
ifeq ($(BUILD_ENV_),MSVC)
7+
exe=../../../src/goto-cc/goto-cl
8+
is_windows="true"
9+
else
10+
exe=../../../src/goto-cc/goto-cc
11+
is_windows="false"
12+
endif
13+
314
test:
4-
@if ! ../test.pl -c ../chain.sh ; then \
15+
@if ! ../test.pl -c '../chain.sh $(exe) ../../../src/cbmc/cbmc $(is_windows)' ; then \
516
../failed-tests-printer.pl ; \
617
exit 1; \
718
fi
819

920
tests.log:
10-
@if ! ../test.pl -c ../chain.sh ; then \
21+
@if ! ../test.pl -c '../chain.sh $(exe) ../../../src/cbmc/cbmc $(is_windows)' ; then \
1122
../failed-tests-printer.pl ; \
1223
exit 1; \
1324
fi

regression/goto-cc-cbmc/chain.sh

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22

3-
SRC=../../../src
3+
goto_cc=$1
4+
cbmc=$2
5+
is_windows=$3
46

5-
GC=$SRC/goto-cc/goto-cc
6-
CBMC=$SRC/cbmc/cbmc
7+
options=${*:4:$#-4}
8+
name=${*:$#}
9+
name=${name%.c}
710

8-
OPTS=$1
9-
NAME=${2%.c}
11+
if [[ "${is_windows}" == "true" ]]; then
12+
"${goto_cc}" "${name}.c"
13+
mv "${name}.exe" "${name}.gb"
14+
else
15+
"${goto_cc}" "${name}.c" -o "${name}.gb"
16+
fi
1017

11-
$GC $NAME.c -o $NAME.gb
12-
$CBMC $NAME.gb $OPTS
18+
"${cbmc}" "${name}.gb" ${options}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
if(WIN32)
2+
set(is_windows true)
3+
else()
4+
set(is_windows false)
5+
endif()
6+
7+
add_test_pl_tests(
8+
"goto-cc-goto-analyzer"
9+
"${CMAKE_CURRENT_SOURCE_DIR}/chain.sh $<TARGET_FILE:goto-cc> $<TARGET_FILE:goto-analyzer> ${is_windows}"
10+
)

regression/goto-cc-goto-analyzer/Makefile

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,25 @@
1-
21
default: tests.log
32

3+
include ../../src/config.inc
4+
include ../../src/common
5+
6+
ifeq ($(BUILD_ENV_),MSVC)
7+
exe=../../../src/goto-cc/goto-cl
8+
is_windows="true"
9+
else
10+
exe=../../../src/goto-cc/goto-cc
11+
is_windows="false"
12+
endif
13+
414
test:
5-
@if ! ../test.pl -c ../chain.sh ; then \
15+
@if ! ../test.pl -c '../chain.sh $(exe) ../../../src/goto-analyzer/goto-analyzer $(is_windows)' ; then \
616
../failed-tests-printer.pl ; \
717
exit 1; \
818
fi
919

1020
tests.log:
1121
pwd
12-
@if ! ../test.pl -c ../chain.sh ; then \
22+
@if ! ../test.pl -c '../chain.sh $(exe) ../../../src/goto-analyzer/goto-analyzer $(is_windows)' ; then \
1323
../failed-tests-printer.pl ; \
1424
exit 1; \
1525
fi
Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22

3-
src=../../../src
3+
goto_cc=$1
4+
goto_analyzer=$2
5+
is_windows=$3
46

5-
gc=$src/goto-cc/goto-cc
6-
goto_analyzer=$src/goto-analyzer/goto-analyzer
7+
options=${*:4:$#-4}
8+
name=${*:$#}
9+
name=${name%.c}
710

8-
options=$1
9-
name=${2%.c}
11+
if [[ "${is_windows}" == "true" ]]; then
12+
"${goto_cc}" "${name}.c"
13+
mv "${name}.exe" "${name}.gb"
14+
else
15+
"${goto_cc}" "${name}.c" -o "${name}.gb"
16+
fi
1017

11-
$gc $name.c -o $name.gb
12-
$goto_analyzer $name.gb $options
18+
"${goto_analyzer}" "${name}.gb" ${options}

0 commit comments

Comments
 (0)