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:
parent
3552a2bafd
commit
b6b8b522a7
13 changed files with 53 additions and 48 deletions
|
|
@ -283,18 +283,18 @@ then float s=$SECONDS
|
|||
(( SECONDS-s < 4 )) && err_exit 'parent completes early'
|
||||
fi
|
||||
|
||||
yes=$(whence -p yes)
|
||||
if [[ $yes ]]
|
||||
then for exp in TERM VTALRM PIPE
|
||||
yes() for ((;;)); do print y; done
|
||||
|
||||
for exp in TERM VTALRM PIPE
|
||||
do if [[ ${SIG[$exp]} ]]
|
||||
then {
|
||||
$SHELL <<- EOF
|
||||
bindate=$(whence -p date) "$SHELL" <<- EOF
|
||||
foo() { return 0; }
|
||||
trap foo EXIT
|
||||
{ sleep 2; kill -$exp \$\$; sleep 3; kill -0 \$\$ && kill -KILL \$\$; } &
|
||||
$yes |
|
||||
yes |
|
||||
while read yes
|
||||
do (/bin/date; sleep .1)
|
||||
do ("\$bindate"; sleep .1)
|
||||
done > /dev/null
|
||||
EOF
|
||||
} 2>> /dev/null
|
||||
|
|
@ -302,7 +302,6 @@ then for exp in TERM VTALRM PIPE
|
|||
[[ $exp == $got ]] || err_exit "kill -$exp \$\$ failed, required termination by signal '$got'"
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
SECONDS=0
|
||||
$SHELL 2> /dev/null -c 'sleep 2 && kill $$ & trap "print done; exit 3" EXIT; (sleep 5); print finished' > $tmp/sig
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue