Skip to content

Commit

Permalink
Update semantics preserving CI
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesLee-Jones committed May 28, 2024
1 parent bdbeee8 commit 74e858f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 30 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/c_apps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ case "$(uname)" in
sudo rm -f /swapfile
sudo apt clean
# shellcheck disable=SC2046
docker rmi $(docker image ls -aq)
if [ -n "$(docker image ls -aq)" ]; then
docker rmi $(docker image ls -aq)
fi
df -h
;;

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cxx_apps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,6 @@ jobs:

- name: build_step_nix
run: |
.github/workflows/cxx_apps.sh
.github/workflows/cxx_apps_semantics_preserving.sh
.github/workflows/cxx_apps.sh
shell: bash
31 changes: 3 additions & 28 deletions .github/workflows/cxx_apps_semantics_preserving.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ case "$(uname)" in
sudo rm -f /swapfile
sudo apt clean
# shellcheck disable=SC2046
docker rmi $(docker image ls -aq)
if [ -n "$(docker image ls -aq)" ]; then
docker rmi $(docker image ls -aq)
fi
df -h
;;

Expand Down Expand Up @@ -93,19 +95,6 @@ pushd examples/math
cmake --build build
${DREDD_EXECUTABLE} --semantics-preserving-coverage-instrumentation -p build/compile_commands.json --mutation-info-file mutation-info.json math/src/*.cc
./build/mathtest/mathtest
NUM_MUTANTS=`python3 ${DREDD_ROOT}/scripts/query_mutant_info.py mutation-info.json --largest-mutant-id`
EXPECTED_NUM_MUTANTS=1132
if [ ${NUM_MUTANTS} -ne ${EXPECTED_NUM_MUTANTS} ]
then
echo "Found ${NUM_MUTANTS} mutants when mutating the math library source code. Expected ${EXPECTED_NUM_MUTANTS}. If Dredd changed recently, the expected value may just need to be updated, if it still looks sensible. Otherwise, there is likely a problem."
exit 1
fi

# Display info about every mutant, just to check that the script that displays mutant info does not error.
for mutant in `seq 0 ${NUM_MUTANTS}`
do
python3 ${DREDD_ROOT}/scripts/query_mutant_info.py mutation-info.json --show-info-for-mutant ${mutant} --path-prefix-replacement ${DREDD_ROOT}/examples/math/math ${DREDD_ROOT}/examples/math/math-original > /dev/null
done
popd

echo "examples/threaded: check that a simple concurrent program runs OK after mutation"
Expand Down Expand Up @@ -156,13 +145,6 @@ pushd SPIRV-Tools
./build/test/val/test_val_capability
./build/test/val/test_val_fghijklmnop
./build/test/val/test_val_rstuvw
NUM_MUTANTS=`python3 ${DREDD_ROOT}/scripts/query_mutant_info.py mutation-info.json --largest-mutant-id`
EXPECTED_NUM_MUTANTS=67998
if [ ${NUM_MUTANTS} -ne ${EXPECTED_NUM_MUTANTS} ]
then
echo "Found ${NUM_MUTANTS} mutants when mutating the SPIR-V validator source code. Expected ${EXPECTED_NUM_MUTANTS}. If Dredd changed recently, the expected value may just need to be updated, if it still looks sensible. Otherwise, there is likely a problem."
exit 1
fi
popd

echo "LLVM: check that InstCombine builds after mutation"
Expand All @@ -182,13 +164,6 @@ pushd llvm-project
done
${DREDD_EXECUTABLE} --semantics-preserving-coverage-instrumentation --mutation-info-file mutation-info.json -p "${DREDD_ROOT}/llvm-project/build/compile_commands.json" "${FILES[@]}"
cmake --build build --target LLVMInstCombine
NUM_MUTANTS=`python3 ${DREDD_ROOT}/scripts/query_mutant_info.py mutation-info.json --largest-mutant-id`
EXPECTED_NUM_MUTANTS=97675
if [ ${NUM_MUTANTS} -ne ${EXPECTED_NUM_MUTANTS} ]
then
echo "Found ${NUM_MUTANTS} mutants when mutating the LLVM source code. Expected ${EXPECTED_NUM_MUTANTS}. If Dredd changed recently, the expected value may just need to be updated, if it still looks sensible. Otherwise, there is likely a problem."
exit 1
fi
popd

echo "Finished"
Expand Down

0 comments on commit 74e858f

Please sign in to comment.