mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-12 04:58:57 +00:00
tests: Specifically #require fish_test_helper when needed
This commit is contained in:
parent
63e705a778
commit
b531cc8b43
13 changed files with 27 additions and 1 deletions
|
@ -1,4 +1,5 @@
|
||||||
# RUN: env fish_test_helper=%fish_test_helper %fish %s
|
# RUN: env fish_test_helper=%fish_test_helper %fish %s
|
||||||
|
#REQUIRES: command -v %fish_test_helper
|
||||||
|
|
||||||
# Ensure that a job which attempts to disown itself does not explode.
|
# Ensure that a job which attempts to disown itself does not explode.
|
||||||
# Here fish_test_helper is the process group leader; we attempt to disown
|
# Here fish_test_helper is the process group leader; we attempt to disown
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
# RUN: %fish -C "set helper %fish_test_helper" %s
|
# RUN: %fish -C "set helper %fish_test_helper" %s
|
||||||
|
#REQUIRES: command -v %fish_test_helper
|
||||||
|
|
||||||
# Check that we don't leave stray FDs.
|
# Check that we don't leave stray FDs.
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
#RUN: env fth=%fish_test_helper fish=%fish %fish %s
|
#RUN: env fth=%fish_test_helper fish=%fish %fish %s
|
||||||
|
#REQUIRES: command -v %fish_test_helper
|
||||||
|
|
||||||
# Ensure job control works in non-interactive environments.
|
# Ensure job control works in non-interactive environments.
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
# RUN: env fth=%fish_test_helper fish=%fish %fish %s
|
# RUN: env fth=%fish_test_helper fish=%fish %fish %s
|
||||||
|
#REQUIRES: command -v %fish_test_helper
|
||||||
|
|
||||||
status job-control full
|
status job-control full
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
#RUN: %fish -C "set -g helper %fish_test_helper; set -g fish %fish" %s
|
#RUN: %fish -C "set -g helper %fish_test_helper; set -g fish %fish" %s
|
||||||
|
#REQUIRES: command -v %fish_test_helper
|
||||||
|
|
||||||
# Check that nohup is propagated.
|
# Check that nohup is propagated.
|
||||||
set output_path (mktemp)
|
set output_path (mktemp)
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#RUN: %fish -C "set helper %fish_test_helper" %s
|
#RUN: %fish -C "set helper %fish_test_helper" %s
|
||||||
# This hangs on OpenBSD
|
# This hangs on OpenBSD
|
||||||
#REQUIRES: test "$(uname)" != OpenBSD
|
#REQUIRES: test "$(uname)" != OpenBSD
|
||||||
|
#REQUIRES: command -v %fish_test_helper
|
||||||
|
|
||||||
# Command subs run in same pgroup as fish, even if job control is 'all'.
|
# Command subs run in same pgroup as fish, even if job control is 'all'.
|
||||||
# Verify that they get the same pgroup across runs (presumably fish's).
|
# Verify that they get the same pgroup across runs (presumably fish's).
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
# RUN: env fish_test_helper=%fish_test_helper %fish -C 'set -l fish %fish' %s
|
# RUN: env fish_test_helper=%fish_test_helper %fish -C 'set -l fish %fish' %s
|
||||||
|
#REQUIRES: command -v %fish_test_helper
|
||||||
|
|
||||||
$fish -c 'function main; exit 4; true; end; main'
|
$fish -c 'function main; exit 4; true; end; main'
|
||||||
echo $status
|
echo $status
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
# RUN: env fth=%fish_test_helper %fish %s
|
# RUN: env fth=%fish_test_helper %fish %s
|
||||||
|
#REQUIRES: command -v %fish_test_helper
|
||||||
|
|
||||||
set -g SIGUSR1_COUNT 0
|
set -g SIGUSR1_COUNT 0
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,8 @@ function test_pexpect_file
|
||||||
set -lx --prepend PYTHONPATH (realpath $PWD)
|
set -lx --prepend PYTHONPATH (realpath $PWD)
|
||||||
set -lx fish $FISHDIR/fish
|
set -lx fish $FISHDIR/fish
|
||||||
set -lx fish_key_reader $FISHDIR/fish_key_reader
|
set -lx fish_key_reader $FISHDIR/fish_key_reader
|
||||||
set -lx fish_test_helper $FISHDIR/fish_test_helper
|
path is -fx -- $FISHDIR/fish_test_helper
|
||||||
|
and set -lx fish_test_helper $FISHDIR/fish_test_helper
|
||||||
|
|
||||||
# Note we require Python3.
|
# Note we require Python3.
|
||||||
python3 $file
|
python3 $file
|
||||||
|
|
|
@ -26,6 +26,9 @@ fish_pid = sp.spawn.pid
|
||||||
# Launch fish_test_helper.
|
# Launch fish_test_helper.
|
||||||
expect_prompt()
|
expect_prompt()
|
||||||
exe_path = os.environ.get("fish_test_helper")
|
exe_path = os.environ.get("fish_test_helper")
|
||||||
|
if not exe_path:
|
||||||
|
sys.exit(127)
|
||||||
|
|
||||||
sp.sendline(exe_path + " nohup_wait")
|
sp.sendline(exe_path + " nohup_wait")
|
||||||
|
|
||||||
# We expect it to transfer tty ownership to fish_test_helper.
|
# We expect it to transfer tty ownership to fish_test_helper.
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
from pexpect_helper import SpawnedProc
|
from pexpect_helper import SpawnedProc
|
||||||
import platform
|
import platform
|
||||||
import subprocess
|
import subprocess
|
||||||
|
import os
|
||||||
|
|
||||||
sp = SpawnedProc()
|
sp = SpawnedProc()
|
||||||
send, sendline, sleep, expect_prompt, expect_re, expect_str = (
|
send, sendline, sleep, expect_prompt, expect_re, expect_str = (
|
||||||
|
@ -75,6 +76,10 @@ expect_prompt()
|
||||||
sendline("jobs")
|
sendline("jobs")
|
||||||
expect_prompt("jobs: There are no jobs")
|
expect_prompt("jobs: There are no jobs")
|
||||||
|
|
||||||
|
if not os.environ.get("fish_test_helper", ""):
|
||||||
|
import sys
|
||||||
|
sys.exit(127)
|
||||||
|
|
||||||
# Regression test for #2214: foregrounding from a key binding works!
|
# Regression test for #2214: foregrounding from a key binding works!
|
||||||
sendline(r"bind ctrl-r 'fg >/dev/null 2>/dev/null'")
|
sendline(r"bind ctrl-r 'fg >/dev/null 2>/dev/null'")
|
||||||
expect_prompt()
|
expect_prompt()
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
from pexpect_helper import SpawnedProc
|
from pexpect_helper import SpawnedProc
|
||||||
|
import os
|
||||||
|
|
||||||
sp = SpawnedProc()
|
sp = SpawnedProc()
|
||||||
send, sendline, expect_prompt, expect_str = (
|
send, sendline, expect_prompt, expect_str = (
|
||||||
|
@ -13,6 +14,10 @@ expect_prompt()
|
||||||
sendline("function echo_wrap ; /bin/echo $argv ; sleep 0.1; end")
|
sendline("function echo_wrap ; /bin/echo $argv ; sleep 0.1; end")
|
||||||
expect_prompt()
|
expect_prompt()
|
||||||
|
|
||||||
|
if not os.environ.get("fish_test_helper", ""):
|
||||||
|
import sys
|
||||||
|
sys.exit(127)
|
||||||
|
|
||||||
for i in range(5):
|
for i in range(5):
|
||||||
sendline(
|
sendline(
|
||||||
"echo_wrap 1 2 3 4 | $fish_test_helper become_foreground_then_print_stderr ; or exit 1"
|
"echo_wrap 1 2 3 4 | $fish_test_helper become_foreground_then_print_stderr ; or exit 1"
|
||||||
|
|
|
@ -12,6 +12,10 @@ send, sendline, expect_prompt, expect_str, sleep = (
|
||||||
sp.sleep,
|
sp.sleep,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if not os.environ.get("fish_test_helper", ""):
|
||||||
|
import sys
|
||||||
|
sys.exit(127)
|
||||||
|
|
||||||
# Launch fish_test_helper.
|
# Launch fish_test_helper.
|
||||||
expect_prompt()
|
expect_prompt()
|
||||||
exe_path = os.environ.get("fish_test_helper")
|
exe_path = os.environ.get("fish_test_helper")
|
||||||
|
|
Loading…
Reference in a new issue