Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
Robadob committed Jul 27, 2023
1 parent ca6e377 commit fd59cf6
Showing 1 changed file with 23 additions and 4 deletions.
27 changes: 23 additions & 4 deletions tests/test_cases/simulation/test_mpi_ensemble.cu
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,29 @@ TEST_F(TestMPIEnsemble, success) {
std::string output = testing::internal::GetCapturedStdout();
std::string errors = testing::internal::GetCapturedStderr();
// Expect no warnings (stderr) but outputs on progress and timing
if (world_rank == 0) {
EXPECT_TRUE(output.find("CUDAEnsemble progress") != std::string::npos); // E.g. CUDAEnsemble progress: 1/2
EXPECT_TRUE(output.find("CUDAEnsemble completed") != std::string::npos); // E.g. CUDAEnsemble completed 2 runs successfully!
EXPECT_TRUE(errors.empty());
} else {
EXPECT_TRUE(output.empty());
EXPECT_TRUE(errors.empty());
}

validateLogs();
}
TEST_F(TestMPIEnsemble, success_verbose) {
initEnsemble();
ensemble->Config().verbosity = Verbosity::Verbose;
// Capture stderr and stdout
testing::internal::CaptureStdout();
testing::internal::CaptureStderr();
const unsigned int err_count = ensemble->simulate(*plans);
EXPECT_EQ(err_count, 0u);
// Get stderr and stdout
std::string output = testing::internal::GetCapturedStdout();
std::string errors = testing::internal::GetCapturedStderr();
// Expect no warnings (stderr) but outputs on progress and timing
if (world_rank == 0) {
EXPECT_TRUE(output.find("CUDAEnsemble progress") != std::string::npos); // E.g. CUDAEnsemble progress: 1/2
EXPECT_TRUE(output.find("CUDAEnsemble completed") != std::string::npos); // E.g. CUDAEnsemble completed 2 runs successfully!
Expand Down Expand Up @@ -176,7 +199,6 @@ TEST_F(TestMPIEnsemble, error_off) {
if (world_rank == 0) {
EXPECT_TRUE(output.find("CUDAEnsemble progress") != std::string::npos); // E.g. CUDAEnsemble progress: 1/2
EXPECT_TRUE(output.find("CUDAEnsemble completed") != std::string::npos); // E.g. CUDAEnsemble completed 2 runs successfully!
EXPECT_TRUE(output.find("Ensemble time elapsed") != std::string::npos); // E.g. Ensemble time elapsed: 0.006000s
EXPECT_TRUE(errors.empty());
} else {
EXPECT_TRUE(output.empty());
Expand All @@ -202,7 +224,6 @@ TEST_F(TestMPIEnsemble, error_slow) {
if (world_rank == 0) {
EXPECT_TRUE(output.find("CUDAEnsemble progress") != std::string::npos); // E.g. CUDAEnsemble progress: 1/2
EXPECT_TRUE(output.find("CUDAEnsemble completed") != std::string::npos); // E.g. CUDAEnsemble completed 2 runs successfully!
EXPECT_TRUE(output.find("Ensemble time elapsed") != std::string::npos); // E.g. Ensemble time elapsed: 0.006000s
EXPECT_TRUE(errors.empty());
} else {
EXPECT_TRUE(output.empty());
Expand All @@ -227,8 +248,6 @@ TEST_F(TestMPIEnsemble, error_fast) {
// Expect no warnings (stderr) but outputs on progress and timing
if (world_rank == 0) {
EXPECT_TRUE(output.find("CUDAEnsemble progress") != std::string::npos); // E.g. CUDAEnsemble progress: 1/2
EXPECT_TRUE(output.find("CUDAEnsemble completed") != std::string::npos); // E.g. CUDAEnsemble completed 2 runs successfully!
EXPECT_TRUE(output.find("Ensemble time elapsed") != std::string::npos); // E.g. Ensemble time elapsed: 0.006000s
EXPECT_TRUE(errors.empty());
} else {
EXPECT_TRUE(output.empty());
Expand Down

0 comments on commit fd59cf6

Please sign in to comment.