Make test_shells/test.sh compatible with dash
This commit is contained in:
parent
9b7052bf3e
commit
ebc98977ae
|
@ -1,4 +1,4 @@
|
||||||
#!/bin/bash
|
#!/bin/sh
|
||||||
: ${PYTHON:=python}
|
: ${PYTHON:=python}
|
||||||
FAILED=0
|
FAILED=0
|
||||||
if test "x$1" = "x--fast" ; then
|
if test "x$1" = "x--fast" ; then
|
||||||
|
@ -84,11 +84,10 @@ run_test() {
|
||||||
shift
|
shift
|
||||||
SH="$1"
|
SH="$1"
|
||||||
SESNAME="powerline-shell-test-${SH}-$$"
|
SESNAME="powerline-shell-test-${SH}-$$"
|
||||||
ARGS=( "$@" )
|
|
||||||
|
|
||||||
run "${TEST_TYPE}" "${TEST_CLIENT}" "${SH}" \
|
run "${TEST_TYPE}" "${TEST_CLIENT}" "${SH}" \
|
||||||
screen -L -c tests/test_shells/screenrc -d -m -S "$SESNAME" \
|
screen -L -c tests/test_shells/screenrc -d -m -S "$SESNAME" \
|
||||||
env LANG=en_US.UTF-8 BINDFILE="$BINDFILE" "${ARGS[@]}"
|
env LANG=en_US.UTF-8 BINDFILE="$BINDFILE" "$@"
|
||||||
while ! screen -S "$SESNAME" -X readreg a tests/test_shells/input.$SH ; do
|
while ! screen -S "$SESNAME" -X readreg a tests/test_shells/input.$SH ; do
|
||||||
sleep 0.1s
|
sleep 0.1s
|
||||||
done
|
done
|
||||||
|
@ -105,7 +104,7 @@ run_test() {
|
||||||
# …
|
# …
|
||||||
# prompt1> prompt2> …
|
# prompt1> prompt2> …
|
||||||
while read -r line ; do
|
while read -r line ; do
|
||||||
screen -S "$SESNAME" -p 0 -X stuff "$line"$'\n'
|
screen -S "$SESNAME" -p 0 -X stuff "$line"$(printf '\r')
|
||||||
sleep 1
|
sleep 1
|
||||||
done < tests/test_shells/input.$SH
|
done < tests/test_shells/input.$SH
|
||||||
else
|
else
|
||||||
|
@ -222,7 +221,7 @@ done
|
||||||
|
|
||||||
unset ENV
|
unset ENV
|
||||||
|
|
||||||
export ADDRESS="powerline-ipc-test-$RANDOM"
|
export ADDRESS="powerline-ipc-test-$$"
|
||||||
export PYTHON
|
export PYTHON
|
||||||
echo "Powerline address: $ADDRESS"
|
echo "Powerline address: $ADDRESS"
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue