tests: Specifically #require fish_test_helper when needed

This commit is contained in:
Fabian Boehm
2024-12-26 13:30:09 +01:00
parent 63e705a778
commit b531cc8b43
13 changed files with 27 additions and 1 deletions

View File

@@ -26,6 +26,9 @@ fish_pid = sp.spawn.pid
# Launch fish_test_helper.
expect_prompt()
exe_path = os.environ.get("fish_test_helper")
if not exe_path:
sys.exit(127)
sp.sendline(exe_path + " nohup_wait")
# We expect it to transfer tty ownership to fish_test_helper.

View File

@@ -2,6 +2,7 @@
from pexpect_helper import SpawnedProc
import platform
import subprocess
import os
sp = SpawnedProc()
send, sendline, sleep, expect_prompt, expect_re, expect_str = (
@@ -75,6 +76,10 @@ expect_prompt()
sendline("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!
sendline(r"bind ctrl-r 'fg >/dev/null 2>/dev/null'")
expect_prompt()

View File

@@ -1,5 +1,6 @@
#!/usr/bin/env python3
from pexpect_helper import SpawnedProc
import os
sp = SpawnedProc()
send, sendline, expect_prompt, expect_str = (
@@ -13,6 +14,10 @@ expect_prompt()
sendline("function echo_wrap ; /bin/echo $argv ; sleep 0.1; end")
expect_prompt()
if not os.environ.get("fish_test_helper", ""):
import sys
sys.exit(127)
for i in range(5):
sendline(
"echo_wrap 1 2 3 4 | $fish_test_helper become_foreground_then_print_stderr ; or exit 1"

View File

@@ -12,6 +12,10 @@ send, sendline, expect_prompt, expect_str, sleep = (
sp.sleep,
)
if not os.environ.get("fish_test_helper", ""):
import sys
sys.exit(127)
# Launch fish_test_helper.
expect_prompt()
exe_path = os.environ.get("fish_test_helper")