From 38182de3077cf27012265a1d272501193c3a79fd Mon Sep 17 00:00:00 2001 From: Artur Meski Date: Fri, 10 Apr 2026 18:13:31 +0100 Subject: [PATCH] CI tests: split --- .github/workflows/tests.yml | 85 +++++++++++++++++++++++++++++++------ 1 file changed, 73 insertions(+), 12 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 56735ef..6f61a61 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -7,9 +7,9 @@ on: branches: [master] jobs: - test: + bdd: + name: BDD tests runs-on: ubuntu-latest - steps: - uses: actions/checkout@v4 @@ -18,14 +18,6 @@ jobs: sudo apt-get update sudo apt-get install -y g++ make bison flex - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: "3.12" - - - name: Install Python dependencies - run: pip install z3-solver pytest - - name: Build CUDD working-directory: reactics-bdd run: ./build_cudd.sh @@ -34,5 +26,74 @@ jobs: working-directory: reactics-bdd run: make - - name: Run all tests - run: ./run_tests.sh + - name: Run BDD tests + run: bash tests/run_tests.sh + + smt: + name: SMT tests + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.12" + + - name: Install Python dependencies + run: pip install z3-solver pytest + + - name: Run SMT tests + run: python3 -m pytest tests/test_smt.py -v + + generators: + name: Generator tests + runs-on: ubuntu-latest + needs: bdd + steps: + - uses: actions/checkout@v4 + + - name: Install system dependencies + run: | + sudo apt-get update + sudo apt-get install -y g++ make bison flex + + - name: Build CUDD + working-directory: reactics-bdd + run: ./build_cudd.sh + + - name: Build ReactICS BDD module + working-directory: reactics-bdd + run: make + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.12" + + - name: Run generator tests + run: | + REACTICS="$PWD/reactics-bdd/reactics" + GENERATORS="$PWD/examples/bdd/generators" + failed=0 + check_gen() { + local name="$1" gen_cmd="$2" property="$3" expected="$4" + local tmpfile=$(mktemp /tmp/reactics_gen_XXXXXX.drs) + eval "$gen_cmd" > "$tmpfile" 2>&1 + local result=$("$REACTICS" -c "$property" "$tmpfile" 2>&1 | grep -oE "(holds|does not hold)" || true) + rm -f "$tmpfile" + if [ "$result" = "$expected" ]; then + echo " PASS: $name" + else + echo " FAIL: $name (expected '$expected', got '$result')" + failed=1 + fi + } + check_gen "tgc(3) f1" "python3 $GENERATORS/gen_tgc.py 3" f1 "holds" + check_gen "tgc(3) f3" "python3 $GENERATORS/gen_tgc.py 3" f3 "holds" + check_gen "tgc(4) f2" "python3 $GENERATORS/gen_tgc.py 4" f2 "holds" + check_gen "asm(3) f1" "python3 $GENERATORS/gen_asm.py 3" f1 "holds" + check_gen "asm(3) f2" "python3 $GENERATORS/gen_asm.py 3" f2 "holds" + check_gen "drs(2,2,2,a) f0" "python3 $GENERATORS/gen_drs.py 2 2 2 a" f0 "does not hold" + check_gen "drs(2,2,2,b) f0" "python3 $GENERATORS/gen_drs.py 2 2 2 b" f0 "holds" + exit $failed