MCPcopy Create free account
hub / github.com/AshampooSystems/boden / updateProgressLabel

Method updateProgressLabel

tests/test_main.cpp:49–80  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47 }
48
49 void updateProgressLabel()
50 {
51 std::ostringstream ssProgress;
52
53 auto testinfo = ::testing::UnitTest::GetInstance()->current_test_info();
54 int nRun = nCasesRun;
55
56 ssProgress << "Running test " << nRun << " of " << ::testing::UnitTest::GetInstance()->total_test_count();
57 std::ostringstream ssTestInfo;
58 bool hasFailed = false;
59 if (testinfo) {
60 ssTestInfo << testinfo->test_suite_name() << "." << testinfo->name();
61
62 if (testinfo->result()) {
63 if (testinfo->result()->Failed()) {
64 hasFailed = true;
65 }
66 }
67 }
68
69 std::string sProgress = ssProgress.str();
70 std::string sTestInfo = ssTestInfo.str();
71 bdn::App()->dispatchQueue()->dispatchAsync([this, sProgress, sTestInfo, hasFailed]() {
72 if (_progressLabel)
73 _progressLabel->text = sProgress;
74 if (_testNameLabel)
75 _testNameLabel->text = sTestInfo;
76 if (hasFailed) {
77 _window->stylesheet |= bdn::json({{"background-color", bdn::Color(1, 0, 0, 1)}});
78 }
79 });
80 }
81
82 void beginLaunch() override
83 {

Callers

nothing calls this directly

Calls 4

AppFunction · 0.85
ColorClass · 0.85
dispatchAsyncMethod · 0.80
dispatchQueueMethod · 0.80

Tested by

no test coverage detected