2018-08-23 19:47:43 -04:00
|
|
|
#!/usr/bin/env python
|
2019-01-21 14:03:30 -05:00
|
|
|
# Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
|
2018-08-23 19:47:43 -04:00
|
|
|
import sys
|
2018-10-11 16:56:50 -04:00
|
|
|
import subprocess
|
2019-05-08 19:15:24 -04:00
|
|
|
import http_server
|
2018-10-11 16:56:50 -04:00
|
|
|
|
2018-10-15 16:46:42 -04:00
|
|
|
|
2019-05-08 19:15:24 -04:00
|
|
|
def unit_tests(deno_exe):
|
|
|
|
cmd = [
|
|
|
|
deno_exe, "run", "--reload", "--allow-run", "js/unit_test_runner.ts"
|
|
|
|
]
|
2018-10-11 16:56:50 -04:00
|
|
|
process = subprocess.Popen(
|
2019-05-08 19:15:24 -04:00
|
|
|
cmd, bufsize=1, universal_newlines=True, stderr=subprocess.STDOUT)
|
|
|
|
|
2018-10-11 16:56:50 -04:00
|
|
|
process.wait()
|
|
|
|
errcode = process.returncode
|
|
|
|
if errcode != 0:
|
|
|
|
sys.exit(errcode)
|
2018-08-23 19:47:43 -04:00
|
|
|
|
2018-10-15 16:46:42 -04:00
|
|
|
|
2018-08-23 19:47:43 -04:00
|
|
|
if __name__ == '__main__':
|
|
|
|
if len(sys.argv) < 2:
|
2018-11-08 13:38:20 -05:00
|
|
|
print "Usage ./tools/unit_tests.py target/debug/deno"
|
2018-08-23 19:47:43 -04:00
|
|
|
sys.exit(1)
|
2019-05-08 19:15:24 -04:00
|
|
|
|
|
|
|
http_server.spawn()
|
2018-08-23 19:47:43 -04:00
|
|
|
unit_tests(sys.argv[1])
|