Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

oss: make 'make tests' run Python tests #458

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions eden/scm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,11 @@ test-getdeps: install-getdeps

check: tests

.PHONY: tests
tests:
cd tests && PYTHON_SYS_EXECUTABLE=$(shell $(PYTHON3) contrib/pick_python.py $(PYTHON3)) \
$(shell $(PYTHON3) contrib/pick_python.py $(PYTHON3)) run-tests.py

update-pot: i18n/hg.pot

i18n/hg.pot: $(PYFILES) $(DOCFILES) i18n/posplit i18n/hggettext
Expand Down
24 changes: 13 additions & 11 deletions eden/scm/tests/run-tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -694,19 +694,21 @@ def parseargs(args, parser):
os.path.isfile(options.with_hg) and os.access(options.with_hg, os.X_OK)
):
parser.error("--with-hg must specify an executable hg script")
if options.local:
if options.local and not options.with_hg:
testdir = os.path.dirname(canonpath(sys.argv[0]))
reporootdir = os.path.dirname(testdir)
pathandattrs = [("hg", "with_hg")]
for relpath, attr in pathandattrs:
if getattr(options, attr, None):
continue
binpath = os.path.join(reporootdir, relpath)
if os.name != "nt" and not os.access(binpath, os.X_OK):
parser.error(
"--local specified, but %r not found or not executable" % binpath
)
setattr(options, attr, binpath)
exe_names = ("sl", "hg")
if os.name == "nt":
exe_names = ("sl", "sl.exe", "hg", "hg.exe")
for exe_name in exe_names:
binpath = os.path.join(reporootdir, exe_name)
if os.access(binpath, os.X_OK):
options.with_hg = binpath
break
if not options.with_hg:
parser.error(
"--local specified, but %s not found in %r or not executable" % (" or ".join(exe_names), reporootdir)
)

if options.chg and os.name == "nt":
parser.error("chg does not work on %s" % os.name)
Expand Down