[build] Refined test_function function

This commit is contained in:
ayakael 2018-05-18 12:42:46 -07:00
parent 9829bc32d0
commit b179b90d83
No known key found for this signature in database
GPG key ID: 575626A4AE5F4026

View file

@ -4,12 +4,9 @@ EXEC=dam
test_function() {
functionList=(${@})
source src/env
for function in ${functionList[@]}; do
echo -e "#!/bin/bash\n" > .test.sh
awk '!/^ *#/ && NF' src/env >> .test.sh
awk '!/^ *#/ && NF' ${function} >> .test.sh
bash .test.sh
rm .test.sh
bash ${function}
done
}
@ -43,7 +40,7 @@ gen_parser() {
awk '!/^ *#/ && NF' src/parser
}
test_function $(find src/ -type f -not -name env -not -name parser) >> ${EXEC}
test_function $(find src/ -type f -not -name env -not -name parser)
gen_env > ${EXEC}
gen_help >> ${EXEC}