mirror of
https://github.com/openembedded/meta-openembedded.git
synced 2026-05-30 00:50:00 +00:00
libtoml11/files/run-ptest: cleanup
Shellcheck -oall warnings fixed:
- exit 1 if `cd tests` failes (SC2164)
- Double quote `./${atest}` to prevent globbing and word splitting. (SC2086)
- Check the test exit code directly intead of using $? (SC2181)
Other fixes:
- The shebang sould traditionally be /usr/bin/env sh in case
sh is not located in /bin.
- Do not remove tests.log for every test.
Signed-off-by: Adam Duskett <adam.duskett@amarulasolutions.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
@@ -1,10 +1,11 @@
|
|||||||
#!/bin/sh
|
#!/usr/bin/env sh
|
||||||
|
|
||||||
|
cd tests || exit 1
|
||||||
|
|
||||||
|
rm -rf tests.log
|
||||||
|
|
||||||
cd tests
|
|
||||||
for atest in test_* ; do
|
for atest in test_* ; do
|
||||||
rm -rf tests.log
|
if ./"${atest}" >> tests.log 2>&1; then
|
||||||
./${atest} > tests.log 2>&1
|
|
||||||
if [ $? = 0 ] ; then
|
|
||||||
echo "PASS: ${atest}"
|
echo "PASS: ${atest}"
|
||||||
else
|
else
|
||||||
echo "FAIL: ${atest}"
|
echo "FAIL: ${atest}"
|
||||||
|
|||||||
Reference in New Issue
Block a user