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

Method fail_test

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

Source from the content-addressed store, hash-verified

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