autfilt: return with exit code 1 if there is no match
* src/bin/autfilt.cc: Return with exit code 1 if no match found. * src/tgbaalgos/are_isomorphic.cc,src/tgbatest/degenlskip.test src/tgbatest/explpro2.test,src/tgbatest/explpro3.test src/tgbatest/explpro4.test,src/tgbatest/explprod.test src/tgbatest/neverclaimread.test, src/tgbatest/readsave.test src/tgbatest/tripprod.test: Use exit status to check for output emptiness instead of 'test -n'. * src/tgbatest/isomorph.test: Simplify test.
This commit is contained in:
parent
68adcc70fa
commit
b54fe4c035
11 changed files with 48 additions and 140 deletions
|
|
@ -78,5 +78,5 @@ State: 2
|
|||
--END--
|
||||
EOF
|
||||
|
||||
test -n "`../../bin/autfilt -F out2 --isomorph expected2`"
|
||||
test -n "`../../bin/autfilt -F out3 --isomorph expected3`"
|
||||
run 0 ../../bin/autfilt -F out2 --isomorph expected2
|
||||
run 0 ../../bin/autfilt -F out3 --isomorph expected3
|
||||
|
|
|
|||
|
|
@ -78,6 +78,6 @@ State: 2
|
|||
EOF
|
||||
|
||||
run 0 ../../bin/autfilt input1 --product input2 --hoa | tee stdout
|
||||
test -n "`../../bin/autfilt -F stdout --isomorph expected`"
|
||||
run 0 ../../bin/autfilt -F stdout --isomorph expected
|
||||
|
||||
rm input1 input2 stdout expected
|
||||
|
|
|
|||
|
|
@ -78,5 +78,5 @@ State: 2
|
|||
EOF
|
||||
|
||||
run 0 ../../bin/autfilt input1 --product input2 --hoa | tee stdout
|
||||
test -n "`../../bin/autfilt -F stdout --isomorph expected`"
|
||||
run 0 ../../bin/autfilt -F stdout --isomorph expected
|
||||
rm input1 input2 stdout expected
|
||||
|
|
|
|||
|
|
@ -72,6 +72,6 @@ State: 0
|
|||
EOF
|
||||
|
||||
run 0 ../../bin/autfilt input1 --product input2 --hoa | tee stdout
|
||||
test -n "`../../bin/autfilt -F stdout --isomorph expected`"
|
||||
run 0 ../../bin/autfilt -F stdout --isomorph expected
|
||||
|
||||
rm input1 input2 stdout expected
|
||||
|
|
|
|||
|
|
@ -97,6 +97,6 @@ State: 0
|
|||
EOF
|
||||
|
||||
run 0 ../../bin/autfilt input1 --product input2 --hoa --small | tee stdout
|
||||
test -n "`../../bin/autfilt -F stdout --isomorph expected`"
|
||||
run 0 ../../bin/autfilt -F stdout --isomorph expected
|
||||
|
||||
rm input1 input2 stdout expected
|
||||
|
|
|
|||
|
|
@ -21,116 +21,14 @@
|
|||
|
||||
. ./defs
|
||||
|
||||
set -e
|
||||
for i in `seq 0 4`; do
|
||||
../../bin/randaut a --seed=$i -S4 --hoa >iso$i
|
||||
../../bin/autfilt -F iso$i --randomize --hoa >aut$i
|
||||
done
|
||||
|
||||
../../bin/randaut a b -S10 --hoa >filt
|
||||
|
||||
randomize()
|
||||
{
|
||||
for i in `seq 1 5`
|
||||
do
|
||||
../../bin/autfilt --seed=$i --randomize=$1 -F filt --hoa >> autiso
|
||||
for i in `seq 0 4`; do
|
||||
for j in `seq 0 4`; do
|
||||
exp=$(test $i -eq $j; echo $?)
|
||||
run $exp ../../bin/autfilt -F aut$i -I iso$j
|
||||
done
|
||||
}
|
||||
|
||||
randomize s
|
||||
randomize t
|
||||
randomize
|
||||
|
||||
run 0 ../../bin/autfilt -F autiso --isomorph filt --hoa >out
|
||||
test `grep HOA out | wc -l` -eq 15
|
||||
|
||||
cat >notiso <<EOF
|
||||
HOA: v1
|
||||
States: 10
|
||||
Start: 0
|
||||
AP: 2 "a" "b"
|
||||
acc-name: all
|
||||
Acceptance: 0 t
|
||||
properties: trans-labels explicit-labels state-acc
|
||||
--BODY--
|
||||
State: 0
|
||||
[!0&1] 1
|
||||
[0&1] 2
|
||||
State: 1
|
||||
[!0&!1] 2
|
||||
[0&!1] 3
|
||||
[!0&1] 4
|
||||
State: 2
|
||||
[0&1] 5
|
||||
[0&!1] 1
|
||||
State: 3
|
||||
[!0&!1] 5
|
||||
[!0&!1] 1
|
||||
[!0&1] 0
|
||||
[0&!1] 6
|
||||
State: 4
|
||||
[0&1] 5
|
||||
[0&1] 0
|
||||
[!0&1] 7
|
||||
State: 5
|
||||
[0&1] 5
|
||||
[!0&1] 8
|
||||
State: 6
|
||||
[0&1] 9
|
||||
State: 7
|
||||
[0&!1] 9
|
||||
[0&1] 1
|
||||
State: 8
|
||||
[!0&1] 8
|
||||
[0&!1] 5
|
||||
State: 9
|
||||
[!0&!1] 5
|
||||
[!0&1] 8
|
||||
--END--
|
||||
EOF
|
||||
|
||||
cat >>notiso <<EOF
|
||||
HOA: v1
|
||||
States: 10
|
||||
Start: 0
|
||||
AP: 2 "a" "b"
|
||||
acc-name: all
|
||||
Acceptance: 0 t
|
||||
properties: trans-labels explicit-labels state-acc
|
||||
--BODY--
|
||||
State: 0
|
||||
[!0&1] 1
|
||||
State: 1
|
||||
[!0&1] 2
|
||||
[!0&1] 3
|
||||
[!0&1] 4
|
||||
[!0&1] 5
|
||||
[!0&1] 6
|
||||
State: 2
|
||||
[0&1] 7
|
||||
[!0&1] 0
|
||||
State: 3
|
||||
[!0&!1] 0
|
||||
[!0&1] 6
|
||||
[0&!1] 8
|
||||
State: 4
|
||||
[!0&1] 3
|
||||
[!0&!1] 9
|
||||
[!0&!1] 0
|
||||
State: 5
|
||||
[0&1] 0
|
||||
State: 6
|
||||
[!0&!1] 9
|
||||
State: 7
|
||||
[0&!1] 0
|
||||
[!0&1] 7
|
||||
[!0&!1] 6
|
||||
State: 8
|
||||
[0&1] 6
|
||||
[!0&!1] 1
|
||||
[!0&!1] 0
|
||||
State: 9
|
||||
[0&!1] 7
|
||||
[!0&1] 2
|
||||
[0&1] 1
|
||||
--END--
|
||||
EOF
|
||||
|
||||
run 0 ../../bin/autfilt -F notiso --isomorph filt --hoa >out
|
||||
test `grep HOA out | wc -l` -eq 0 || exit 1
|
||||
done
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ State: 2 {0}
|
|||
--END--
|
||||
EOF
|
||||
|
||||
test -n "`../../bin/autfilt -F stdout --isomorph expected`"
|
||||
run 0 ../../bin/autfilt -F stdout --isomorph expected
|
||||
|
||||
rm input stdout expected
|
||||
|
||||
|
|
@ -112,7 +112,7 @@ State: 2 {0}
|
|||
--END--
|
||||
EOF
|
||||
|
||||
test -n "`../../bin/autfilt -F stdout --isomorph expected`"
|
||||
run 0 ../../bin/autfilt -F stdout --isomorph expected
|
||||
|
||||
rm input stdout expected
|
||||
|
||||
|
|
|
|||
|
|
@ -90,14 +90,14 @@ EOF
|
|||
|
||||
run 0 ../../bin/autfilt --merge-transitions --hoa input > stdout
|
||||
cat stdout
|
||||
test -n "`../../bin/autfilt -F stdout --isomorph expected`"
|
||||
run 0 ../../bin/autfilt -F stdout --isomorph expected
|
||||
|
||||
# Likewise, with a randomly generated TGBA.
|
||||
run 0 ../../bin/randaut -S 20 a b -d 0.2 -a 0.2 -A 2 --hoa | tee input
|
||||
|
||||
# the first read-write can renumber the states
|
||||
run 0 $autfilt --hoa --merge-transitions input > stdout
|
||||
test -n "`../../bin/autfilt -F input --isomorph stdout`"
|
||||
run 0 ../../bin/autfilt -F input --isomorph stdout
|
||||
|
||||
# But this second output should be the same as the first
|
||||
run 0 $autfilt --hoa stdout > stdout2
|
||||
|
|
|
|||
|
|
@ -107,6 +107,6 @@ EOF
|
|||
run 0 ../../bin/autfilt input1 --product input2 --product input3 --hoa |
|
||||
tee stdout
|
||||
|
||||
test -n "`../../bin/autfilt -F stdout --isomorph expected`"
|
||||
run 0 ../../bin/autfilt -F stdout --isomorph expected
|
||||
|
||||
rm input1 input2 input3 stdout expected
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue