From 364903f9fd79aa8117e8692244b18b10776bec01 Mon Sep 17 00:00:00 2001 From: bloodstalker Date: Tue, 3 Jan 2017 05:28:20 +0330 Subject: fixed the order in which different options are passed to the executble which was preventing it from recognizing the custom options --- mutator.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/mutator.sh b/mutator.sh index 8bb93f1..5c40661 100755 --- a/mutator.sh +++ b/mutator.sh @@ -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 -- cgit v1.2.3