Skip to content

Commit 06a88d6

Browse files
committed
Consolidate symtab2gb regression tests
Use an approach similar to contracts regression tests to extract parameters for multiple tools from a single line in the .desc file. This avoids overly fragmenting regression tests.
1 parent b0156a3 commit 06a88d6

File tree

12 files changed

+24
-48
lines changed

12 files changed

+24
-48
lines changed

regression/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ add_subdirectory(goto-cc-multi-file)
8080
add_subdirectory(goto-cc-regression-gh-issue-5380)
8181
add_subdirectory(linking-goto-binaries)
8282
add_subdirectory(symtab2gb)
83-
add_subdirectory(symtab2gb-cbmc)
8483
add_subdirectory(solver-hardness)
8584
if(NOT WIN32)
8685
add_subdirectory(goto-ld)

regression/Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ DIRS = cbmc-shadow-memory \
5353
goto-cc-regression-gh-issue-5380 \
5454
linking-goto-binaries \
5555
symtab2gb \
56-
symtab2gb-cbmc \
5756
solver-hardness \
5857
goto-ld \
5958
validate-trace-xml-schema \

regression/symtab2gb-cbmc/CMakeLists.txt

Lines changed: 0 additions & 3 deletions
This file was deleted.

regression/symtab2gb-cbmc/Makefile

Lines changed: 0 additions & 20 deletions
This file was deleted.

regression/symtab2gb-cbmc/README.md

Lines changed: 0 additions & 4 deletions
This file was deleted.

regression/symtab2gb-cbmc/chain.sh

Lines changed: 0 additions & 12 deletions
This file was deleted.

regression/symtab2gb/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
This directory contains tests based on converting json symtab files to goto
22
binaries using the symtab2gb binary and then passing the generated goto binary
3-
to cbmc. Additional arguments specified in the `.desc` file will be passed to
4-
the symtab2gb binary.
3+
to cbmc. Additional arguments specified in the `.desc` file up until a possible
4+
`_` will be passed to the symtab2gb binary, any arguments specified after an `_`
5+
are passed to cbmc.

regression/symtab2gb/chain.sh

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,22 @@ set -e
44

55
symtab2gb_exe=$1
66
cbmc_exe=$2
7+
source="${@: -1}"
8+
goto_binary="$source.gb"
79

8-
$symtab2gb_exe "${@:3}"
9-
$cbmc_exe a.out
10+
args=${*:3:$#-3}
11+
if [[ "$args" == *" _ "* ]]
12+
then
13+
args_symtab="${args%%" _ "*}"
14+
args_cbmc="${args#*" _ "}"
15+
elif [[ "$args" == "_ "* ]]
16+
then
17+
args_symtab=""
18+
args_cbmc="${args#"_ "}"
19+
else
20+
args_symtab=$args
21+
args_cbmc=""
22+
fi
23+
24+
$symtab2gb_exe "$source" ${args_symtab} --out "$goto_binary"
25+
$cbmc_exe ${args_cbmc} "$goto_binary"

regression/symtab2gb-cbmc/show_foreign_symbol_table/json-ui.desc renamed to regression/symtab2gb/show_foreign_symbol_table/json-ui.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
rust.json
3-
--json-ui --show-symbol-table
3+
_ --json-ui --show-symbol-table
44
"symbolTable":
55
"mode": "rust",
66
^EXIT=0$

regression/symtab2gb-cbmc/show_foreign_symbol_table/plain_text.desc renamed to regression/symtab2gb/show_foreign_symbol_table/plain_text.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
rust.json
3-
--show-symbol-table
3+
_ --show-symbol-table
44
Symbols:
55
Mode\.+: rust
66
^EXIT=0$

0 commit comments

Comments
 (0)