1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00

regress tests: remove use of unportable direct paths to commands

Many tests used direct paths to some commands, mostly /bin/echo and
/bin/cat. This is unportable (breaks on e.g. NixOS).
The correct way is to obtain the direct path using 'whence -p'.

There was also one use of '/usr/bin/pstack' in tests/comvario.sh
that seemed bogus. Apparently this was supposed to analyse a core
file after a crash. Even on Solaris and Linux, where that command
exists, the argument is documented to be a PID, not a core file. If
this ever worked anywhere, then it was system-specific enough to be
useless here, so I've removed it.

(cherry picked from commit 4563b8bc651cd9cb18dc73f56a041f7ac5534395)
This commit is contained in:
Martijn Dekker 2020-06-04 22:49:37 +02:00
parent 3552a2bafd
commit b6b8b522a7
13 changed files with 53 additions and 48 deletions

View file

@ -41,6 +41,7 @@ tmp=$(
exit 1
}
trap 'cd / && rm -rf "$tmp"' EXIT
binecho=$(whence -p echo)
integer foo=33
bar=bye
@ -141,7 +142,7 @@ fi
if [[ $PWD != "$dir" ]]
then err_exit 'cd inside nested subshell changes $PWD'
fi
fun() /bin/echo hello
fun() "$binecho" hello
if [[ $(fun) != hello ]]
then err_exit one line functions not working
fi