(argv=None)
| 26 | |
| 27 | |
| 28 | def main(argv=None): |
| 29 | if argv is None: |
| 30 | argv = sys.argv |
| 31 | |
| 32 | parser = argparse.ArgumentParser() |
| 33 | parser.add_argument("-a", "--all", action="store_true", help="run all tests") |
| 34 | parser.add_argument("-C", "--chdir", action="store", help="change to directory") |
| 35 | parser.add_argument( |
| 36 | "-f", |
| 37 | "--format", |
| 38 | action="store", |
| 39 | default="", |
| 40 | help="run tests with the specified formats", |
| 41 | ) |
| 42 | parser.add_argument( |
| 43 | "-G", |
| 44 | "--gyp_option", |
| 45 | action="append", |
| 46 | default=[], |
| 47 | help="Add -G options to the gyp command line", |
| 48 | ) |
| 49 | parser.add_argument( |
| 50 | "-l", "--list", action="store_true", help="list available tests and exit" |
| 51 | ) |
| 52 | parser.add_argument( |
| 53 | "-n", |
| 54 | "--no-exec", |
| 55 | action="store_true", |
| 56 | help="no execute, just print the command line", |
| 57 | ) |
| 58 | parser.add_argument( |
| 59 | "--path", action="append", default=[], help="additional $PATH directory" |
| 60 | ) |
| 61 | parser.add_argument( |
| 62 | "-q", |
| 63 | "--quiet", |
| 64 | action="store_true", |
| 65 | help="quiet, don't print anything unless there are failures", |
| 66 | ) |
| 67 | parser.add_argument( |
| 68 | "-v", |
| 69 | "--verbose", |
| 70 | action="store_true", |
| 71 | help="print configuration info and test results.", |
| 72 | ) |
| 73 | parser.add_argument("tests", nargs="*") |
| 74 | args = parser.parse_args(argv[1:]) |
| 75 | |
| 76 | if args.chdir: |
| 77 | os.chdir(args.chdir) |
| 78 | |
| 79 | if args.path: |
| 80 | extra_path = [os.path.abspath(p) for p in args.path] |
| 81 | extra_path = os.pathsep.join(extra_path) |
| 82 | os.environ["PATH"] = extra_path + os.pathsep + os.environ["PATH"] |
| 83 | |
| 84 | if not args.tests: |
| 85 | if not args.all: |
no test coverage detected
searching dependent graphs…