diff options
author | a1346054 <36859588+a1346054@users.noreply.github.com> | 2022-09-13 18:42:15 +0000 |
---|---|---|
committer | a1346054 <36859588+a1346054@users.noreply.github.com> | 2022-09-13 22:37:18 +0000 |
commit | e04d6b7bf58a95105a8fc79fcde7c0e98875e72a (patch) | |
tree | 6e20913ed5d4af3e1b0ef5a31ef80ee42f651376 /test/apps/apps.sh | |
parent | tests: fix unintentional overwriting of array value (diff) | |
download | firejail-e04d6b7bf58a95105a8fc79fcde7c0e98875e72a.tar.gz firejail-e04d6b7bf58a95105a8fc79fcde7c0e98875e72a.tar.zst firejail-e04d6b7bf58a95105a8fc79fcde7c0e98875e72a.zip |
tests: directly test for presence of command
Test directly for presence of command instead of indirectly testing
the return code.
Additionally:
* uses a shell builtin `command -v` instead of external `which`
* `command -v` is the standardized version of `which`
Diffstat (limited to 'test/apps/apps.sh')
-rwxr-xr-x | test/apps/apps.sh | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/test/apps/apps.sh b/test/apps/apps.sh index 83e977ba0..ed4b7604a 100755 --- a/test/apps/apps.sh +++ b/test/apps/apps.sh | |||
@@ -11,8 +11,7 @@ LIST="firefox midori chromium opera transmission-qt qbittorrent uget-gtk filezil | |||
11 | LIST+="vlc fbreader deluge gnome-mplayer xchat wine kcalc ktorrent hexchat" | 11 | LIST+="vlc fbreader deluge gnome-mplayer xchat wine kcalc ktorrent hexchat" |
12 | 12 | ||
13 | for app in $LIST; do | 13 | for app in $LIST; do |
14 | which $app 2>/dev/null | 14 | if command -v "$app" |
15 | if [ "$?" -eq 0 ]; | ||
16 | then | 15 | then |
17 | echo "TESTING: $app" | 16 | echo "TESTING: $app" |
18 | ./$app.exp | 17 | ./$app.exp |