MCPcopy Create free account
hub / github.com/beefytech/Beef / Test_Query

Method Test_Query

BeefRT/rt/Internal.cpp:787–834  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

785}
786
787int32 Internal::Test_Query()
788{
789 if (gTestMethodIdx != -1)
790 {
791 uint32 tickEnd = BfpSystem_TickCount();
792 TestString(StrFormat(":TestResult\t%d\n", tickEnd - gTestStartTick));
793 }
794
795 TestString(":TestQuery\n");
796
797 Beefy::String result;
798 TestReadCmd(result);
799
800 Beefy::String param;
801 int tabPos = (int)result.IndexOf('\t');
802 if (tabPos != -1)
803 {
804 param = result.Substring(tabPos + 1);
805 result.RemoveToEnd(tabPos);
806 }
807
808 if (result == ":TestRun")
809 {
810 gTestStartTick = BfpSystem_TickCount();
811 Beefy::String options;
812 int tabPos = (int)param.IndexOf('\t');
813 if (tabPos != -1)
814 {
815 options = param.Substring(tabPos + 1);
816 param.RemoveToEnd(tabPos);
817 }
818
819 gTestMethodIdx = atoi(param.c_str());
820 gTestBreakOnFailure = options.Contains("FailBreak");
821 return gTestMethodIdx;
822 }
823 else if (result == ":TestFinish")
824 {
825 return -1;
826 }
827 else
828 {
829 printf("Command Str: %s\n", result.c_str());
830 BF_FATAL("Invalid test command string from test manager");
831 }
832
833 return false;
834}
835
836void Internal::Test_Finish()
837{

Callers

nothing calls this directly

Calls 8

TestStringFunction · 0.85
TestReadCmdFunction · 0.85
SubstringMethod · 0.80
BfpSystem_TickCountFunction · 0.50
IndexOfMethod · 0.45
RemoveToEndMethod · 0.45
c_strMethod · 0.45
ContainsMethod · 0.45

Tested by

no test coverage detected