Skip to content

Commit 33c3d30

Browse files
authored
Merge pull request #5583 from tautschnig/use-jq
Use jq for checking JSON syntax
2 parents 0218721 + da73e7e commit 33c3d30

File tree

5 files changed

+15
-20
lines changed

5 files changed

+15
-20
lines changed
Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,8 @@
1-
add_test_pl_tests(
2-
"../chain.sh $<TARGET_FILE:cbmc>")
1+
find_program(JQ jq)
2+
if(NOT JQ)
3+
message("Skipping solver-hardness tests: couldn't find jq in your path")
4+
else()
5+
add_test_pl_tests(
6+
"../chain.sh $<TARGET_FILE:cbmc>")
7+
endif()
8+

regression/solver-hardness/Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,13 @@ include ../../src/common
66
CBMC_EXE=../../../src/cbmc/cbmc
77

88
test:
9+
ifeq (, $(shell which jq))
10+
echo "solver-hardness tests skipped (can't find 'jq' in your path)"
11+
else
912
@../test.pl -e -p -c "../chain.sh $(CBMC_EXE)"
13+
endif
1014

11-
tests.log: ../test.pl
12-
@../test.pl -e -p -c "../chain.sh $(CBMC_EXE)"
15+
tests.log: ../test.pl test
1316

1417
show:
1518
@for dir in *; do \

regression/solver-hardness/chain.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ args=${*:2:$#-2}
77

88
$cbmc ${name} ${args}
99
CBMC_RETURN_CODE="$?"
10-
../parse_json.py "solver_hardness.json"
10+
jq -c . "solver_hardness.json"
1111
exit ${CBMC_RETURN_CODE}

regression/solver-hardness/parse_json.py

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

regression/solver-hardness/solver-hardness-simple/test.desc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ main.c
55
^SIGNAL=0$
66
^\[main.assertion.\d+\] line \d+ assertion a \+ b \< 10: FAILURE$
77
^VERIFICATION FAILED$
8-
^Valid JSON File$
9-
\"SAT_hardness\": \{(\"Clauses\": \d+|\"Variables\": \d+|\"Literals\": \d+), (\"Clauses\": \d+|\"Variables\": \d+|\"Literals\": \d+), (\"Clauses\": \d+|\"Variables\": \d+|\"Literals\": \d+)\}
8+
\"SAT_hardness\":\{(\"Clauses\":\d+|\"Variables\":\d+|\"Literals\":\d+),(\"Clauses\":\d+|\"Variables\":\d+|\"Literals\":\d+),(\"Clauses\":\d+|\"Variables\":\d+|\"Literals\":\d+)\}
109
--
1110
^warning: ignoring

0 commit comments

Comments
 (0)