Skip to content

Ensure new regression folders work with Make *and* CMake #1392

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 18, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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}