Skip to content

Commit

Permalink
Merge pull request diffblue#1392 from reuk/reuk/fixup-appveyor-regres…
Browse files Browse the repository at this point in the history
…sions

Ensure new regression folders work with Make *and* CMake
  • Loading branch information
Thomas Kiley authored Sep 18, 2017
2 parents 523f028 + 63fc53b commit f365afe
Show file tree
Hide file tree
Showing 8 changed files with 76 additions and 31 deletions.
10 changes: 0 additions & 10 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,6 @@ test_script:
- cmd: |
cd regression
sed -i "s/goto-cc\/goto-cc/goto-cc\/goto-cl/" goto-cc-cbmc/chain.sh || true
sed -i "11s/.*/$GC $NAME.c/" goto-cc-cbmc/chain.sh || true
sed -i "12i mv $NAME.exe $NAME.gb" goto-cc-cbmc/chain.sh || true
cat goto-cc-cbmc/chain.sh || true
sed -i "s/goto-cc\/goto-cc/goto-cc\/goto-cl/" goto-cc-goto-analyzer/chain.sh || true
sed -i "11s/.*/$gc $name.c/" goto-cc-goto-analyzer/chain.sh || true
sed -i "12i mv $name.exe $name.gb" goto-cc-goto-analyzer/chain.sh || true
cat goto-cc-goto-analyzer/chain.sh || true
rem HACK disable failing tests
rmdir /s /q ansi-c\arch_flags_mcpu_bad
rmdir /s /q ansi-c\arch_flags_mcpu_good
Expand Down
2 changes: 2 additions & 0 deletions regression/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ add_subdirectory(cbmc-java)
add_subdirectory(cbmc-java-inheritance)
add_subdirectory(cpp)
add_subdirectory(goto-analyzer)
add_subdirectory(goto-cc-cbmc)
add_subdirectory(goto-cc-goto-analyzer)
add_subdirectory(goto-diff)
add_subdirectory(goto-instrument)
add_subdirectory(goto-instrument-typedef)
Expand Down
10 changes: 10 additions & 0 deletions regression/goto-cc-cbmc/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
if(WIN32)
set(is_windows true)
else()
set(is_windows false)
endif()

add_test_pl_tests(
"goto-cc-cbmc"
"${CMAKE_CURRENT_SOURCE_DIR}/chain.sh $<TARGET_FILE:goto-cc> $<TARGET_FILE:cbmc> ${is_windows}"
)
15 changes: 13 additions & 2 deletions regression/goto-cc-cbmc/Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,24 @@
default: tests.log

include ../../src/config.inc
include ../../src/common

ifeq ($(BUILD_ENV_),MSVC)
exe=../../../src/goto-cc/goto-cl
is_windows="true"
else
exe=../../../src/goto-cc/goto-cc
is_windows="false"
endif

test:
@if ! ../test.pl -c ../chain.sh ; then \
@if ! ../test.pl -c '../chain.sh $(exe) ../../../src/cbmc/cbmc $(is_windows)' ; then \
../failed-tests-printer.pl ; \
exit 1; \
fi

tests.log:
@if ! ../test.pl -c ../chain.sh ; then \
@if ! ../test.pl -c '../chain.sh $(exe) ../../../src/cbmc/cbmc $(is_windows)' ; then \
../failed-tests-printer.pl ; \
exit 1; \
fi
Expand Down
22 changes: 14 additions & 8 deletions regression/goto-cc-cbmc/chain.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
#!/bin/bash
#!/usr/bin/env bash

SRC=../../../src
goto_cc=$1
cbmc=$2
is_windows=$3

GC=$SRC/goto-cc/goto-cc
CBMC=$SRC/cbmc/cbmc
options=${*:4:$#-4}
name=${*:$#}
name=${name%.c}

OPTS=$1
NAME=${2%.c}
if [[ "${is_windows}" == "true" ]]; then
"${goto_cc}" "${name}.c"
mv "${name}.exe" "${name}.gb"
else
"${goto_cc}" "${name}.c" -o "${name}.gb"
fi

$GC $NAME.c -o $NAME.gb
$CBMC $NAME.gb $OPTS
"${cbmc}" "${name}.gb" ${options}
10 changes: 10 additions & 0 deletions regression/goto-cc-goto-analyzer/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
if(WIN32)
set(is_windows true)
else()
set(is_windows false)
endif()

add_test_pl_tests(
"goto-cc-goto-analyzer"
"${CMAKE_CURRENT_SOURCE_DIR}/chain.sh $<TARGET_FILE:goto-cc> $<TARGET_FILE:goto-analyzer> ${is_windows}"
)
16 changes: 13 additions & 3 deletions regression/goto-cc-goto-analyzer/Makefile
Original file line number Diff line number Diff line change
@@ -1,15 +1,25 @@

default: tests.log

include ../../src/config.inc
include ../../src/common

ifeq ($(BUILD_ENV_),MSVC)
exe=../../../src/goto-cc/goto-cl
is_windows="true"
else
exe=../../../src/goto-cc/goto-cc
is_windows="false"
endif

test:
@if ! ../test.pl -c ../chain.sh ; then \
@if ! ../test.pl -c '../chain.sh $(exe) ../../../src/goto-analyzer/goto-analyzer $(is_windows)' ; then \
../failed-tests-printer.pl ; \
exit 1; \
fi

tests.log:
pwd
@if ! ../test.pl -c ../chain.sh ; then \
@if ! ../test.pl -c '../chain.sh $(exe) ../../../src/goto-analyzer/goto-analyzer $(is_windows)' ; then \
../failed-tests-printer.pl ; \
exit 1; \
fi
Expand Down
22 changes: 14 additions & 8 deletions regression/goto-cc-goto-analyzer/chain.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
#!/bin/bash
#!/usr/bin/env bash

src=../../../src
goto_cc=$1
goto_analyzer=$2
is_windows=$3

gc=$src/goto-cc/goto-cc
goto_analyzer=$src/goto-analyzer/goto-analyzer
options=${*:4:$#-4}
name=${*:$#}
name=${name%.c}

options=$1
name=${2%.c}
if [[ "${is_windows}" == "true" ]]; then
"${goto_cc}" "${name}.c"
mv "${name}.exe" "${name}.gb"
else
"${goto_cc}" "${name}.c" -o "${name}.gb"
fi

$gc $name.c -o $name.gb
$goto_analyzer $name.gb $options
"${goto_analyzer}" "${name}.gb" ${options}

0 comments on commit f365afe

Please sign in to comment.