MCPcopy Create free account
hub / github.com/MrNeRF/LichtFeld-Studio / TEST_F

Function TEST_F

tests/test_uv_runner.cpp:23–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21};
22
23TEST_F(UvRunnerTest, RunUvVersion) {
24 UvRunner runner;
25
26 std::string output;
27 bool completed = false;
28 bool success = false;
29 int exit_code = -1;
30
31 runner.set_output_callback([&](const std::string& line, bool is_error, bool is_line_update) {
32 output += line + "\n";
33 });
34
35 runner.set_completion_callback([&](bool s, int ec) {
36 completed = true;
37 success = s;
38 exit_code = ec;
39 });
40
41 ASSERT_TRUE(runner.start({"--version"}));
42 EXPECT_TRUE(runner.is_running());
43
44 // Poll until complete
45 int iterations = 0;
46 while (runner.poll() && iterations < 1000) {
47 std::this_thread::sleep_for(std::chrono::milliseconds(10));
48 iterations++;
49 }
50
51 // Should complete
52 EXPECT_TRUE(completed);
53 EXPECT_TRUE(success);
54 EXPECT_EQ(exit_code, 0);
55 EXPECT_FALSE(output.empty());
56 EXPECT_TRUE(output.find("uv") != std::string::npos);
57}
58
59TEST_F(UvRunnerTest, RunUvHelp) {
60 UvRunner runner;

Callers

nothing calls this directly

Calls 13

instanceFunction · 0.85
set_output_callbackMethod · 0.80
stringMethod · 0.80
venv_pythonMethod · 0.80
is_completeMethod · 0.80
startMethod · 0.45
is_runningMethod · 0.45
pollMethod · 0.45
emptyMethod · 0.45
findMethod · 0.45
cancelMethod · 0.45

Tested by

no test coverage detected