From 8653a50d55b460c849cf319eda1398bff369d68e Mon Sep 17 00:00:00 2001 From: lche0021 <lche0021@student.monash.edu> Date: Mon, 22 Feb 2021 16:32:11 +1100 Subject: [PATCH] rename default output file --- smoke_test/generate_bin_test | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/smoke_test/generate_bin_test b/smoke_test/generate_bin_test index 4d02d674..dc3d0bb0 100755 --- a/smoke_test/generate_bin_test +++ b/smoke_test/generate_bin_test @@ -1,16 +1,16 @@ #!/bin/bash # NUM_MODULE does not necessarily corresponds to the output of `ls -l $TESTCASE_DIR | wc -l` because -# 1. one folder is created for each software but NUM_MODULE pick combinations of from software/version +# 1. one folder is created for each software but NUM_MODULE pick combinations of from software/version # 2. if a software does not modify PATH variable then there is no bintest generated for them, the number of those softwares are printed at the end NUM_MODULE=${1:-100} TESTCASE_DIR='./tests' - -USAGE_REPORT=software_usage.txt -if [ ! -f $USAGE_REPORT ]; then - software_usage $USAGE_REPORT -fi +APPLICATION_LIST='./application_list.txt' +# USAGE_REPORT=software_usage.txt +# if [ ! -f $USAGE_REPORT ]; then +# software_usage $USAGE_REPORT +# fi echo '#!/bin/bash name=$( realpath $0 | xargs dirname | xargs basename ) ver=${1:-"default"} @@ -18,7 +18,7 @@ bin_dirs=$(module show $name/$ver 2>&1 | sed -n "s/.* PATH \(.*\)/\1/p") NAME_EXEC_EXIST=false for bin in $bin_dirs; do for i in $(find $bin -maxdepth 1 -executable -type f ); do - if [[ $(basename $i) == $name ]]; then + if [[ $(basename $i) == $name ]]; then $i --version; exit $? fi @@ -27,15 +27,15 @@ done ' > $TESTCASE_DIR/bintest -echo "Starting generate bintest for $NUM_MODULE softwares" +echo "Starting generate bintest for $NUM_MODULE softwares" declare -i NUM_LIB=0 declare -i GENERATED_NUM=0 IFS_orig=$IFS IFS=$'\n' -for i in $(head -n $NUM_MODULE $USAGE_REPORT); do - m=$(sed -n 's/\(.*\)\/\(.*\) - \(.*\)/\1 \2/p' <<< $i) +for i in $(head -n $NUM_MODULE $APPLICATION_LIST); do + m=$(sed -n 's/\(.*\)\/\(.*\)/\1 \2/p' <<< $i) name=$(cut -f1 -d' ' <<< $m) ver=$(cut -f2 -d' ' <<< $m) MODIFIED_PATH=$(module show $name/$ver 2>&1 | sed -n 's/.* PATH \(.*\)/\1/p') -- GitLab