-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updates and improvements to the scripts and the pre-processor.
See the README on how to use things now.
- Loading branch information
Showing
9 changed files
with
214 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Script fragment for runnin CN tests | ||
|
||
source "$SCRIPT_DIR/config" | ||
|
||
OUT_DIR=$(mktemp -d /tmp/cn-test-XXXXXX) | ||
trap 'rm -rf "$OUT_DIR"' EXIT | ||
|
||
"$PREPROC" $PREPROC_FLAGS <"$CFILE" >"$OUT_DIR/test-file.c" | ||
|
||
pushd "$OUT_DIR" > /dev/null || exit 2 | ||
$CPP "test-file.c" > "test-file.i" | ||
mv "test-file.i" "test-file.c" | ||
"$CN" test "test-file.c" --progress-level=0 --output-dir=./run --seed=0 $CN_TEST_FLAGS | ||
RESULT=$? | ||
popd > /dev/null || exit 2 | ||
exit $RESULT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,18 @@ | ||
#!/bin/bash | ||
# Do property based testing for a specific mutant | ||
################################################# | ||
|
||
if [ $# -ne 2 ]; then | ||
echo "USAGE: $0 CFILE FUN_QUALIFIED_MUTANT_NAME" | ||
echo " Preprocess, and test a single mutant in a single C file." | ||
echo " Run a single mutant in the given C file." | ||
exit 1 | ||
fi | ||
|
||
SCRIPT_DIR="$(dirname $0)" | ||
source "$SCRIPT_DIR/config" | ||
|
||
CFILE="$1" | ||
SCRIPT_DIR=$(dirname "$0") | ||
CFILE=$1 | ||
FUN=$(dirname "$2") | ||
UNIT_TEST=$(basename "$2") | ||
|
||
OUT_DIR=$(mktemp -d /tmp/cn-run-mutant-XXXXXX) | ||
trap "rm -rf $OUT_DIR" EXIT | ||
|
||
cat "$CFILE" | $PREPROC --show-mutant "$UNIT_TEST" > "$OUT_DIR/$UNIT_TEST.c" | ||
|
||
pushd "$OUT_DIR" | ||
$CPP "$UNIT_TEST.c" > "$UNIT_TEST.i" | ||
mv "$UNIT_TEST.i" "$UNIT_TEST.c" | ||
$CN test "$UNIT_TEST.c" --output-dir=. --only="$FUN" --seed=0 > /dev/null | ||
RESULT=$? | ||
popd | ||
exit $RESULT | ||
|
||
|
||
PREPROC_FLAGS="--show-mutant $UNIT_TEST" | ||
CN_TEST_FLAGS="--only=$FUN" | ||
source "$SCRIPT_DIR/run-cn-test" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash | ||
# Do property based testing for a non-mutated file | ||
################################################## | ||
|
||
if [ $# -ne 1 ]; then | ||
echo "USAGE: $0 CFILE" | ||
echo " Run all property based tests in a given C file." | ||
exit 1 | ||
fi | ||
|
||
SCRIPT_DIR=$(dirname "$0") | ||
CFILE=$1 | ||
PREPROC_FLAGS="--no-test" | ||
CN_TEST_FLAGS="" | ||
source "$SCRIPT_DIR/run-cn-test" | ||
|
||
|
Oops, something went wrong.