diff options
| author | Adam Duskett <adam.duskett@amarulasolutions.com> | 2026-02-17 16:41:37 +0100 |
|---|---|---|
| committer | Khem Raj <raj.khem@gmail.com> | 2026-02-17 22:42:41 -0800 |
| commit | e1d3b9598e3a149f6f5ca323503b6e745dedf66d (patch) | |
| tree | 9605c33246a53c7fe3c9e3dbea917312ea1473f7 /meta-oe/recipes-devtools | |
| parent | fddb6013208ceb8d8a08b0c37ab5c41eb535ed04 (diff) | |
| download | meta-openembedded-e1d3b9598e3a149f6f5ca323503b6e745dedf66d.tar.gz | |
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>
Diffstat (limited to 'meta-oe/recipes-devtools')
| -rwxr-xr-x | meta-oe/recipes-devtools/libtoml11/files/run-ptest | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/meta-oe/recipes-devtools/libtoml11/files/run-ptest b/meta-oe/recipes-devtools/libtoml11/files/run-ptest index 9bc480aa7f..4da9e68cc5 100755 --- a/meta-oe/recipes-devtools/libtoml11/files/run-ptest +++ b/meta-oe/recipes-devtools/libtoml11/files/run-ptest | |||
| @@ -1,10 +1,11 @@ | |||
| 1 | #!/bin/sh | 1 | #!/usr/bin/env sh |
| 2 | |||
| 3 | cd tests || exit 1 | ||
| 4 | |||
| 5 | rm -rf tests.log | ||
| 2 | 6 | ||
| 3 | cd tests | ||
| 4 | for atest in test_* ; do | 7 | for atest in test_* ; do |
| 5 | rm -rf tests.log | 8 | if ./"${atest}" >> tests.log 2>&1; then |
| 6 | ./${atest} > tests.log 2>&1 | ||
| 7 | if [ $? = 0 ] ; then | ||
| 8 | echo "PASS: ${atest}" | 9 | echo "PASS: ${atest}" |
| 9 | else | 10 | else |
| 10 | echo "FAIL: ${atest}" | 11 | echo "FAIL: ${atest}" |
