| #!/usr/bin/env python3 |
| # Copyright 2019 The ChromiumOS Authors |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| """Run unittests in a new browser.""" |
| |
| import os |
| import subprocess |
| import sys |
| |
| import hterm |
| import libdot # pylint: disable=wrong-import-order |
| |
| |
| # Path to our html test page. |
| TEST_PAGE = (hterm.DIR / "html" / "hterm_test.html").relative_to( |
| libdot.LIBAPPS_DIR |
| ) |
| |
| |
| def mkdeps(_opts): |
| """Build the required deps for the test suite.""" |
| subprocess.check_call([os.path.join(hterm.BIN_DIR, "mkdist")]) |
| |
| |
| def main(argv): |
| """The main func!""" |
| return libdot.load_tests.test_runner_main( |
| argv, |
| TEST_PAGE, |
| serve=True, |
| mkdeps=mkdeps, |
| ) |
| |
| |
| if __name__ == "__main__": |
| sys.exit(main(sys.argv[1:])) |