test: pass script args to executable binary in function test

This commit is contained in:
kevinnls
2021-04-03 18:43:51 +05:30
parent 7007d59718
commit c1fa11ce1f

View File

@@ -76,14 +76,11 @@ check_compilers(){
echo "found compiler: ${compiler}" echo "found compiler: ${compiler}"
compile(){ compile(){
echo "=== compiling ===" echo "=== compiling ==="
echo
"${compiler_path}" "${compile_args[@]}" "${iname}" "${compiler_path}" "${compile_args[@]}" "${iname}"
if [[ $? -eq 0 ]]; then if [[ $? -eq 0 ]]; then
echo
echo "=== compiled! ===" echo "=== compiled! ==="
return 0 return 0
else else
echo
echo "=== compile failed! ===" echo "=== compile failed! ==="
return 1 return 1
fi fi
@@ -99,7 +96,7 @@ check_compilers(){
test(){ test(){
echo "=== start of test ===" echo "=== start of test ==="
echo echo
"${oname}" "${oname}" "$@"
echo echo
echo echo
echo "=== end of test ===" echo "=== end of test ==="
@@ -112,8 +109,7 @@ if check_compilers; then
fi fi
fi fi
else else
exit_code=$?
>>2 echo "some error occurred" >>2 echo "some error occurred"
exit "${exit_code}" exit 1
fi fi