diff options
author | bloodstalker <thabogre@gmail.com> | 2016-08-31 00:01:33 +0000 |
---|---|---|
committer | bloodstalker <thabogre@gmail.com> | 2016-08-31 00:01:33 +0000 |
commit | b267569e302cb4d921835a557608ce8a61b4f933 (patch) | |
tree | 98d6fb9e8822fe04157d6c275aa3171ee4309a1a /mutator.sh | |
download | mutator-b267569e302cb4d921835a557608ce8a61b4f933.tar.gz mutator-b267569e302cb4d921835a557608ce8a61b4f933.zip |
a simple c mutator.
Diffstat (limited to '')
-rwxr-xr-x | mutator.sh | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/mutator.sh b/mutator.sh new file mode 100755 index 0000000..1448921 --- /dev/null +++ b/mutator.sh @@ -0,0 +1,54 @@ +#!/bin/bash + +#default args +INPUT="./covtest/testFuncs1.c" +OUTPUT="./mutant.c" +COMMAND="all" + +while [[ $# -gt 0 ]] +do + passarg="$1" + + case $passarg in + -c|--command) + COMMAND="$2" + shift + ;; + -h|--help) + COMMAND="$2" + echo "Currently there is no help for this." + ;; + -v|--version) + echo "Version 1.0.0" + break + ;; + -t|--target) + INPUT="$2" + shift + ;; + *) + #not a valid argument + echo "$2 is not a valid argument." + break + ;; + esac + shift +done + +if [[ "$COMMAND" == clean ]]; then + echo "Running make clean..." + echo "Killing all mutants..." + "make" clean + rm "$OUTPUT" +elif [[ "$COMMAND" == build-all ]]; then + echo "Building all executables..." + "make" all +elif [[ "$COMMAND" == run ]];then + echo "Running executables on target file..." + "$OUTPUT" "$INPUT" -- +elif [[ "$COMMAND" == "default" ]]; then + echo "Building all target executables." + echo "Running all exetubales on target input." + "make" all + "./mutator" "$INPUT" -- > "$OUTPUT" +fi |