Skip to content
Snippets Groups Projects
Commit 8653a50d authored by lche0021's avatar lche0021
Browse files

rename default output file

parent 3a41aff5
No related branches found
No related tags found
2 merge requests!464Fix listdeps,!442Smoke test
#!/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')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment