MCPcopy Index your code
hub / github.com/nodejs/node / Main

Function Main

deps/v8/tools/bigint-tester.py:303–349  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

301 yield (op, args.num_inputs, args.binary)
302
303def Main():
304 parser = argparse.ArgumentParser(
305 description="Helper for generating or running BigInt tests.")
306 parser.add_argument(
307 "action", help="Action to perform: 'generate' or 'stress'")
308 parser.add_argument(
309 "op", nargs="+",
310 help="Operation(s) to test, one or more of: %s. In 'stress' mode, "
311 "special op 'all' tests all ops." % OPS_NAMES)
312 parser.add_argument(
313 "-n", "--num-inputs", type=int, default=-1,
314 help="Number of input/output sets in each generated test. Defaults to "
315 "%d for 'generate' and '%d' for 'stress' mode." %
316 (kNumInputsGenerate, kNumInputsStress))
317
318 stressopts = parser.add_argument_group("'stress' mode arguments")
319 stressopts.add_argument(
320 "-r", "--runs", type=int, default=1000,
321 help="Number of tests (with NUM_INPUTS each) to generate and run. "
322 "Default: %(default)s.")
323 stressopts.add_argument(
324 "-b", "--binary", default="out/x64.debug/d8",
325 help="The 'd8' binary to use. Default: %(default)s.")
326 args = parser.parse_args()
327
328 for op in args.op:
329 if op not in OPS.keys() and op != "all":
330 print("Invalid op '%s'. See --help." % op)
331 return 1
332
333 if len(args.op) == 1 and args.op[0] == "all":
334 args.op = OPS.keys()
335
336 if args.action == "generate":
337 if args.num_inputs < 0: args.num_inputs = kNumInputsGenerate
338 for op in args.op:
339 OPS[op]().PrintTest(args.num_inputs)
340 elif args.action == "stress":
341 if args.num_inputs < 0: args.num_inputs = kNumInputsStress
342 result = 0
343 pool = multiprocessing.Pool(multiprocessing.cpu_count())
344 for r in pool.imap_unordered(WrapRunOne, RunAll(args)):
345 result = result or r
346 return result
347 else:
348 print("Invalid action '%s'. See --help." % args.action)
349 return 1
350
351if __name__ == "__main__":
352 sys.exit(Main())

Callers 1

bigint-tester.pyFile · 0.70

Calls 7

PrintTestMethod · 0.80
imap_unorderedMethod · 0.80
printFunction · 0.70
RunAllFunction · 0.70
keysMethod · 0.65
add_argumentMethod · 0.45
parse_argsMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…