mirror of
https://github.com/denoland/deno.git
synced 2025-01-03 12:58:54 -05:00
Make it possible to run one integration test at a time
This commit is contained in:
parent
df54db7762
commit
98d20cd178
1 changed files with 12 additions and 5 deletions
|
@ -37,15 +37,19 @@ def str2bool(v):
|
||||||
raise ValueError("Bad boolean value")
|
raise ValueError("Bad boolean value")
|
||||||
|
|
||||||
|
|
||||||
def integration_tests(deno_executable):
|
def integration_tests(deno_exe, test_filter = None):
|
||||||
assert os.path.isfile(deno_executable)
|
assert os.path.isfile(deno_exe)
|
||||||
tests = sorted([
|
tests = sorted([
|
||||||
filename for filename in os.listdir(tests_path)
|
filename for filename in os.listdir(tests_path)
|
||||||
if filename.endswith(".test")
|
if filename.endswith(".test")
|
||||||
])
|
])
|
||||||
assert len(tests) > 0
|
assert len(tests) > 0
|
||||||
for test_filename in tests:
|
for test_filename in tests:
|
||||||
|
if test_filter and test_filter not in test_filename:
|
||||||
|
continue
|
||||||
|
|
||||||
test_abs = os.path.join(tests_path, test_filename)
|
test_abs = os.path.join(tests_path, test_filename)
|
||||||
|
print "read_test", test_abs
|
||||||
test = read_test(test_abs)
|
test = read_test(test_abs)
|
||||||
exit_code = int(test.get("exit_code", 0))
|
exit_code = int(test.get("exit_code", 0))
|
||||||
args = test.get("args", "").split(" ")
|
args = test.get("args", "").split(" ")
|
||||||
|
@ -56,7 +60,7 @@ def integration_tests(deno_executable):
|
||||||
output_abs = os.path.join(root_path, test.get("output", ""))
|
output_abs = os.path.join(root_path, test.get("output", ""))
|
||||||
with open(output_abs, 'r') as f:
|
with open(output_abs, 'r') as f:
|
||||||
expected_out = f.read()
|
expected_out = f.read()
|
||||||
cmd = [deno_executable] + args
|
cmd = [deno_exe] + args
|
||||||
print "test %s" % (test_filename)
|
print "test %s" % (test_filename)
|
||||||
print " ".join(cmd)
|
print " ".join(cmd)
|
||||||
actual_code = 0
|
actual_code = 0
|
||||||
|
@ -83,9 +87,12 @@ def integration_tests(deno_executable):
|
||||||
|
|
||||||
print "... " + green_ok()
|
print "... " + green_ok()
|
||||||
|
|
||||||
|
|
||||||
def main(argv):
|
def main(argv):
|
||||||
integration_tests(argv[1])
|
deno_exe = argv[1]
|
||||||
|
test_filter = None
|
||||||
|
if len(argv) > 2:
|
||||||
|
test_filter = argv[2]
|
||||||
|
integration_tests(deno_exe, test_filter)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
Loading…
Reference in a new issue