test: improve test logging infra (#13811)
Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
Ben Hillis committed
Dec 1, 2025 at 21:17 UTC
0f6f3c1e02cc4c7f9c6c8edef93a339eef508f56
2 files changed
+7
-4
test/linux/unit_tests/unittests.c
+2
-2
@@ -103,11 +103,11 @@ int main(int Argc, char* Argv[], char** Envp)
103
104
if (LXT_SUCCESS(Result))
105
{
106
- LxtLogPassed("%s", false, LxtTests[Itr].Name);
106
+ LxtLogPassed("%s", LxtTests[Itr].Name);
107
}
108
else
109
{
110
- LxtLogError("%s", false, LxtTests[Itr].Name);
110
+ LxtLogError("%s", LxtTests[Itr].Name);
111
}
112
113
goto ErrorExit;
test/windows/Common.cpp
+5
-2
@@ -1907,7 +1907,8 @@ Return Value:
1907
}
1908
1909
LaunchArguments += CommandLine;
1910
- LogInfo("Test process exited with: %lu", LxsstuLaunchWsl(LaunchArguments.c_str()));
1910
+ DWORD ExitCode = LxsstuLaunchWsl(LaunchArguments.c_str());
1911
+ LogInfo("Test process exited with: %lu", ExitCode);
1912
1913
//
1914
// Parse the contents of the linux log(s) files and relog.
@@ -1917,9 +1918,11 @@ Return Value:
1918
{
1919
THROW_IF_NTSTATUS_FAILED(LxsstuParseLinuxLogFiles(LogFileName, &TestPassed));
1920
1920
- THROW_HR_IF(E_FAIL, !TestPassed);
1921
+ VERIFY_IS_TRUE(TestPassed);
1922
}
1923
1924
+ VERIFY_ARE_EQUAL(0, ExitCode);
1925
+
1926
return;
1927
}
1928