Skip to content

Commit

Permalink
Run all tests without arg
Browse files Browse the repository at this point in the history
  • Loading branch information
faho committed Jan 8, 2025
1 parent 8142049 commit 52068e4
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions tests/test_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@
import tempfile

import littlecheck

try:
import pexpect

PEXPECT = True
except ImportError:
PEXPECT = False
Expand All @@ -21,7 +23,7 @@


def main():
if len(sys.argv) <= 2:
if len(sys.argv) < 2:
print("Usage: test_driver.py FISH_DIRECTORY TESTS")
return 1

Expand All @@ -45,7 +47,17 @@ def main():
print(f"Binary does not exist: {bin}")
return 127

files = [(os.path.abspath(path), path) for path in sys.argv[2:]]
if len(sys.argv) > 2:
files = [(os.path.abspath(path), path) for path in sys.argv[2:]]
else:
files = [
(os.path.abspath(path), path.relative_to(script_path))
for path in script_path.glob("checks/*.fish")
]
files += [
(os.path.abspath(path), path.relative_to(script_path))
for path in script_path.glob("pexpects/*.py")
]

# Set up tempdir
# "delete=" was added in 3.12.
Expand Down Expand Up @@ -73,9 +85,11 @@ def main():
# If we're run multiple times, keep this around to save time.
# TODO: It's cheesy to leave this in the current dir
if not os.path.exists("fish_test_helper"):
comp = subprocess.run(["cc", script_path / "fish_test_helper.c", "-o", "fish_test_helper"])
comp = subprocess.run(
["cc", script_path / "fish_test_helper.c", "-o", "fish_test_helper"]
)
shutil.copy("fish_test_helper", home.name + "/fish_test_helper")
def_subs.update({"fish_test_helper" : home.name + "/fish_test_helper"})
def_subs.update({"fish_test_helper": home.name + "/fish_test_helper"})

# unset LANG, TERM, ...
for var in [
Expand Down

0 comments on commit 52068e4

Please sign in to comment.