mirror of
https://github.com/kevinnlsamuel/stdouterr.git
synced 2025-12-06 09:55:58 +05:30
test: pass script args to executable binary in function test
This commit is contained in:
8
dev/test
8
dev/test
@@ -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
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user