Don't use a config file in tests.

This commit is contained in:
Nicholas Marriott 2019-04-02 09:48:26 +01:00
parent 79c3fd4f39
commit f03776c262
7 changed files with 13 additions and 9 deletions

View File

@ -7,3 +7,4 @@ all: $(TESTS)
$(TESTS): $(TESTS):
sh $*.sh sh $*.sh
sleep 1

View File

@ -28,7 +28,7 @@ $TMUX kill-server 2>/dev/null
$TMUX -f/dev/null new -d || exit 1 $TMUX -f/dev/null new -d || exit 1
sleep 1 sleep 1
cat <<EOF|$TMUX -C a >$TMP cat <<EOF|$TMUX -f/dev/null -C a >$TMP
ls -F':#{window_width} #{window_height}' ls -F':#{window_width} #{window_height}'
refresh -C 80,24 refresh -C 80,24
ls -F':#{window_width} #{window_height}' ls -F':#{window_width} #{window_height}'
@ -37,7 +37,7 @@ grep ^: $TMP >$OUT
printf ":80 24\n:80 23\n"|cmp -s $OUT - || exit 1 printf ":80 24\n:80 23\n"|cmp -s $OUT - || exit 1
$TMUX kill-server 2>/dev/null $TMUX kill-server 2>/dev/null
cat <<EOF|$TMUX -C new -x 100 -y 50 >$TMP cat <<EOF|$TMUX -f/dev/null -C new -x 100 -y 50 >$TMP
ls -F':#{window_width} #{window_height}' ls -F':#{window_width} #{window_height}'
refresh -C 80,24 refresh -C 80,24
ls -F':#{window_width} #{window_height}' ls -F':#{window_width} #{window_height}'

View File

@ -4,13 +4,14 @@ PATH=/bin:/usr/bin
TERM=screen TERM=screen
[ -z "$TEST_TMUX" ] && TEST_TMUX=$(readlink -f ../tmux) [ -z "$TEST_TMUX" ] && TEST_TMUX=$(readlink -f ../tmux)
TMUX="$TEST_TMUX -Ltest" TMUX="$TEST_TMUX -f/dev/null -Ltest"
$TMUX kill-server 2>/dev/null $TMUX kill-server 2>/dev/null
TMP=$(mktemp) TMP=$(mktemp)
trap "rm -f $TMP" 0 1 15 trap "rm -f $TMP" 0 1 15
$TMUX new -d -x40 -y10 "cat cursor-test.txt; printf '\e[9;15H'; cat" || exit 1 $TMUX -f/dev/null new -d -x40 -y10 \
"cat cursor-test.txt; printf '\e[9;15H'; cat" || exit 1
$TMUX set -g window-size manual || exit 1 $TMUX set -g window-size manual || exit 1
$TMUX display -pF '#{cursor_x} #{cursor_y} #{cursor_character}' >>$TMP $TMUX display -pF '#{cursor_x} #{cursor_y} #{cursor_character}' >>$TMP

View File

@ -10,7 +10,8 @@ $TMUX kill-server 2>/dev/null
TMP=$(mktemp) TMP=$(mktemp)
trap "rm -f $TMP" 0 1 15 trap "rm -f $TMP" 0 1 15
$TMUX new -d -x10 -y10 "cat cursor-test.txt; printf '\e[8;10H'; cat" || exit 1 $TMUX -f/dev/null new -d -x10 -y10 \
"cat cursor-test.txt; printf '\e[8;10H'; cat" || exit 1
$TMUX set -g window-size manual || exit 1 $TMUX set -g window-size manual || exit 1
$TMUX display -pF '#{cursor_x} #{cursor_y} #{cursor_character}' >>$TMP $TMUX display -pF '#{cursor_x} #{cursor_y} #{cursor_character}' >>$TMP

View File

@ -10,7 +10,8 @@ $TMUX kill-server 2>/dev/null
TMP=$(mktemp) TMP=$(mktemp)
trap "rm -f $TMP" 0 1 15 trap "rm -f $TMP" 0 1 15
$TMUX new -d -x7 -y2 "printf 'abcdefabcdefab'; printf '\e[2;7H'; cat" || exit 1 $TMUX -f/dev/null new -d -x7 -y2 \
"printf 'abcdefabcdefab'; printf '\e[2;7H'; cat" || exit 1
$TMUX set -g window-size manual || exit 1 $TMUX set -g window-size manual || exit 1
$TMUX display -pF '#{cursor_x} #{cursor_y} #{cursor_character}' >>$TMP $TMUX display -pF '#{cursor_x} #{cursor_y} #{cursor_character}' >>$TMP

View File

@ -10,7 +10,7 @@ $TMUX kill-server 2>/dev/null
TMP=$(mktemp) TMP=$(mktemp)
trap "rm -f $TMP" 0 1 15 trap "rm -f $TMP" 0 1 15
$TMUX new -d -x10 -y3 "printf 'abcdef\n'; cat" || exit 1 $TMUX -f/dev/null new -d -x10 -y3 "printf 'abcdef\n'; cat" || exit 1
$TMUX set -g window-size manual || exit 1 $TMUX set -g window-size manual || exit 1
$TMUX display -pF '#{cursor_x} #{cursor_y} #{cursor_character}' >>$TMP $TMUX display -pF '#{cursor_x} #{cursor_y} #{cursor_character}' >>$TMP

View File

@ -9,9 +9,9 @@ TERM=screen
TMUX="$TEST_TMUX -Ltest" TMUX="$TEST_TMUX -Ltest"
$TMUX kill-server 2>/dev/null $TMUX kill-server 2>/dev/null
$TMUX new -d 'sleep 1000' || exit 1 $TMUX -f/dev/null new -d 'sleep 1000' || exit 1
P=$($TMUX display -pt0:0.0 '#{pane_pid}') P=$($TMUX display -pt0:0.0 '#{pane_pid}')
$TMUX new -d || exit 1 $TMUX -f/dev/null new -d || exit 1
sleep 1 sleep 1
$TMUX kill-session -t0: $TMUX kill-session -t0:
sleep 1 sleep 1