MCPcopy Create free account
hub / github.com/Pagghiu/SaneCppLibraries / test_section

Method test_section

Libraries/Testing/Testing.cpp:790–819  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

788}
789
790bool SC::TestCase::test_section(StringSpan sectionName, Execute execution)
791{
792 numSectionTestsFailed = 0;
793 bool isTestEnabled;
794 switch (execution)
795 {
796 case Execute::Default: //
797 isTestEnabled = report.isTestEnabled(testName) and report.isSectionEnabled(sectionName);
798 break;
799 case Execute::OnlyExplicit: //
800 isTestEnabled = report.sectionToRun == sectionName;
801 break;
802 default: return false;
803 }
804 if (isTestEnabled)
805 {
806 SC_TESTING_ASSERT_DEBUG(sectionName.isNullTerminated());
807 if (not report.currentSection.isEmpty())
808 {
809 report.printSectionResult(*this);
810 }
811 report.currentSection = sectionName;
812 return true;
813 }
814 else
815 {
816 report.currentSection = StringSpan();
817 return false;
818 }
819}
820
821void SC::TestReport::printSectionResult(TestCase& testCase)
822{

Callers

nothing calls this directly

Calls 6

StringSpanFunction · 0.85
isTestEnabledMethod · 0.80
isSectionEnabledMethod · 0.80
isNullTerminatedMethod · 0.80
printSectionResultMethod · 0.80
isEmptyMethod · 0.45

Tested by

no test coverage detected