MCPcopy Create free account
hub / github.com/boostorg/build / fail_test

Method fail_test

test/BoostBuild.py:564–593  ·  view source on GitHub ↗
(self, condition, dump_difference=True, dump_stdio=True,
        dump_stack=True)

Source from the content-addressed store, hash-verified

562 return result
563
564 def fail_test(self, condition, dump_difference=True, dump_stdio=True,
565 dump_stack=True):
566 if not condition:
567 return
568
569 if dump_difference and hasattr(self, "difference"):
570 f = StringIO.StringIO()
571 self.difference.pprint(f)
572 annotation("changes caused by the last build command",
573 f.getvalue())
574
575 if dump_stdio:
576 self.dump_stdio()
577
578 if "--preserve" in sys.argv:
579 print
580 print "*** Copying the state of working dir into 'failed_test' ***"
581 print
582 path = os.path.join(self.original_workdir, "failed_test")
583 if os.path.isdir(path):
584 shutil.rmtree(path, ignore_errors=False)
585 elif os.path.exists(path):
586 raise "Path " + path + " already exists and is not a directory"
587 shutil.copytree(self.workdir, path)
588 print "The failed command was:"
589 print " ".join(self.last_program_invocation)
590
591 if dump_stack:
592 annotate_stack_trace()
593 sys.exit(1)
594
595 # A number of methods below check expectations with actual difference
596 # between directory trees before and after a build. All the 'expect*'

Callers 15

test_basicFunction · 0.95
copyMethod · 0.95
run_build_systemMethod · 0.95
readMethod · 0.95
expect_additionMethod · 0.95
expect_removalMethod · 0.95
expect_modificationMethod · 0.95
expect_touchMethod · 0.95
expect_nothingMethod · 0.95
expect_nothing_moreMethod · 0.95
expect_contentMethod · 0.95
__expect_linesMethod · 0.95

Calls 4

dump_stdioMethod · 0.95
annotationFunction · 0.85
annotate_stack_traceFunction · 0.85
pprintMethod · 0.45

Tested by 3

test_basicFunction · 0.76
test_raw_emptyFunction · 0.76
test_raw_ntFunction · 0.76