diff options
author | Vincent Sanders <vince@kyllikki.org> | 2019-06-05 20:57:55 +0100 |
---|---|---|
committer | Vincent Sanders <vince@kyllikki.org> | 2019-06-05 20:58:40 +0100 |
commit | 27ee92c8721f982b79432689dbcb5439bb4fadc2 (patch) | |
tree | 492577e1e6525278fb0a99d1ef4e2303ee6c485d /test/monkey-see-monkey-do | |
parent | 3d80e825e1c77ece19c21ed1cc568049856a44de (diff) | |
download | netsurf-27ee92c8721f982b79432689dbcb5439bb4fadc2.tar.gz netsurf-27ee92c8721f982b79432689dbcb5439bb4fadc2.tar.bz2 |
extend the monkey test tooling to cope with ssl certificate windows
Diffstat (limited to 'test/monkey-see-monkey-do')
-rwxr-xr-x | test/monkey-see-monkey-do | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/test/monkey-see-monkey-do b/test/monkey-see-monkey-do index 84a935e90..68c75a339 100755 --- a/test/monkey-see-monkey-do +++ b/test/monkey-see-monkey-do @@ -8,7 +8,7 @@ MONKEY_PATH="./nsmonkey" # Otherwise let's begin... import sys - +import getopt import yaml import multiprocessing as mp @@ -40,6 +40,8 @@ def child_run_test(parts): else: sys.stdout = oldout sys.stderr = olderr + if verbose == True: + print("STDOUT:\n{}\n", outcapture.getvalue()) def run_test(parts): p = mp.Process(target=child_run_test, args=(parts, )) @@ -47,6 +49,26 @@ def run_test(parts): p.join() return p.exitcode +def print_usage(): + print('Usage:') + print(' ' + sys.argv[0] + ' [-v] [-h]') + +def parse_argv(argv): + verbose=False + try: + opts, args = getopt.getopt(argv,"hv",[]) + except getopt.GetoptError: + print_usage() + sys.exit(2) + for opt, arg in opts: + if opt == '-h': + print_usage() + sys.exit() + elif opt in ("-v", "--verbose"): + verbose=True + return verbose + +verbose = parse_argv(sys.argv[1:]) print("Fetching tests...") index = request.urlopen(BASE_PATH) |