diff options
author | bloodstalker <thabogre@gmail.com> | 2017-01-03 01:58:20 +0000 |
---|---|---|
committer | bloodstalker <thabogre@gmail.com> | 2017-01-03 01:58:20 +0000 |
commit | 364903f9fd79aa8117e8692244b18b10776bec01 (patch) | |
tree | e3f1472bc1a643038a07aed72b8d3219f8d8862b | |
parent | added some more sugar to the custom options, only implemented for 19.7 (diff) | |
download | mutator-364903f9fd79aa8117e8692244b18b10776bec01.tar.gz mutator-364903f9fd79aa8117e8692244b18b10776bec01.zip |
fixed the order in which different options are passed to the executble which was preventing it from recognizing the custom options
-rwxr-xr-x | mutator.sh | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -9,6 +9,7 @@ OUTPUT="./mutant.c" OUTPUT_FORMAT="./mutant_format.c" COMMAND="jack" OPTIONS="" +COPTIONS="" while [[ $# -gt 0 ]] do @@ -34,6 +35,7 @@ do echo "-o, --output, -output lets you choose where to put the mutant." echo "-opts --options, pass options to the executable(s). The executables support all the clang options. please enclose all the options in double quatation." echo " for example: -opts \"-Wall std=c89\"" + echo "-copts --customoptions, same as opts, but only used for custom options defined for the executable. for example: -copts \"-SysHeader=false -MainOnly=true\"" exit 0 ;; -NDEBUG) @@ -56,6 +58,10 @@ do OPTIONS="$2" shift ;; + -copts|--customoptions) + COPTIONS="$2" + shift + ;; -o|--output|-output) OUTPUT="$2" shift @@ -97,8 +103,9 @@ elif [[ "$COMMAND" == "misrac" ]]; then echo "Removing previous JSON report..." "rm" ./test/misrareport.json echo "checking input file(s) against Misra-C 2004..." - echo "Options to pass to executable: "${OPTIONS:0:$((${#OPTIONS}))} - "./mutator-lvl0" $INPUT -- ${OPTIONS:0:$((${#OPTIONS}))} > ./test/misra-log + echo "Command to run:" + echo "./mutator-lvl0 ${COPTIONS:0:$((${#COPTIONS}))} $INPUT -- ${OPTIONS:0:$((${#OPTIONS}))} > ./test/misra-log" + "./mutator-lvl0" ${COPTIONS:0:$((${#COPTIONS}))} $INPUT -- ${OPTIONS:0:$((${#OPTIONS}))} > ./test/misra-log elif [[ "$COMMAND" == "default" ]]; then echo "Building all target executables..." "make" all |