Added new unit test for register.cc (#1712)
* new unit test for register.cc Signed-off-by: Deeksha Goplani <deeksha.goplani@amd.com> * Add new register API tests * Fix debug message ordering issue --------- Signed-off-by: Deeksha Goplani <deeksha.goplani@amd.com> Co-authored-by: Atul Kulkarni <atul.kulkarni@amd.com>
Cette révision appartient à :
@@ -402,6 +402,9 @@ bool ProcessIsolatedTestRunner::executeAllTests(const ExecutionOptions& options)
|
||||
continue;
|
||||
}
|
||||
|
||||
// Flush all output before fork to prevent child from inheriting unflushed buffers
|
||||
fflush(NULL);
|
||||
|
||||
pid_t pid = fork();
|
||||
|
||||
if(pid == 0)
|
||||
@@ -435,6 +438,10 @@ bool ProcessIsolatedTestRunner::executeAllTests(const ExecutionOptions& options)
|
||||
{
|
||||
INFO("Running isolated test '%s' (PID: %d)\n", testConfig.name.c_str(), pid);
|
||||
}
|
||||
// Flush parent's output before reading from child pipes to ensure proper ordering
|
||||
fflush(stdout);
|
||||
fflush(stderr);
|
||||
|
||||
int status;
|
||||
CapturedOutput output = captureProcessOutput(stdout_fd, stderr_fd, pid, &status);
|
||||
|
||||
@@ -442,6 +449,9 @@ bool ProcessIsolatedTestRunner::executeAllTests(const ExecutionOptions& options)
|
||||
auto duration
|
||||
= std::chrono::duration_cast<std::chrono::milliseconds>(endTime - startTime);
|
||||
|
||||
// Display captured output BEFORE status messages for proper sequencing
|
||||
displayCapturedOutput(output, testConfig.name);
|
||||
|
||||
TestResult testResult;
|
||||
testResult.testName = testConfig.name;
|
||||
testResult.processId = pid;
|
||||
@@ -530,8 +540,6 @@ bool ProcessIsolatedTestRunner::executeAllTests(const ExecutionOptions& options)
|
||||
testResult.errorMessage = "Failed to wait for process";
|
||||
}
|
||||
|
||||
displayCapturedOutput(output, testConfig.name);
|
||||
|
||||
recordTestResult(testResult);
|
||||
|
||||
// Stop on first failure if requested
|
||||
|
||||
Référencer dans un nouveau ticket
Bloquer un utilisateur