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 cbac967 commit ca6e377
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/test_cases/simulation/test_mpi_ensemble.cu
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,9 @@ class TestMPIEnsemble : public testing::Test {
};
TEST_F(TestMPIEnsemble, success) {
initEnsemble();
// 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
Expand All @@ -159,6 +162,9 @@ TEST_F(TestMPIEnsemble, error_off) {
initEnsemble();
ensemble->Config().error_level = CUDAEnsemble::EnsembleConfig::Off;
unsigned int err_count = 0;
// Capture stderr and stdout
testing::internal::CaptureStdout();
testing::internal::CaptureStderr();
EXPECT_NO_THROW(err_count = ensemble->simulate(*plans));
// With error off, we would expect to see run index 12 fail
// Therefore 99 returned instead of 100
Expand All @@ -184,6 +190,9 @@ TEST_F(TestMPIEnsemble, error_slow) {
model->newLayer().addHostFunction(throw_exception);
initEnsemble();
ensemble->Config().error_level = CUDAEnsemble::EnsembleConfig::Slow;
// Capture stderr and stdout
testing::internal::CaptureStdout();
testing::internal::CaptureStderr();
EXPECT_THROW(ensemble->simulate(*plans), flamegpu::exception::EnsembleError);
// @todo can't capture total number of successful/failed runs
// Get stderr and stdout
Expand All @@ -207,6 +216,9 @@ TEST_F(TestMPIEnsemble, error_fast) {
model->newLayer().addHostFunction(throw_exception);
initEnsemble();
ensemble->Config().error_level = CUDAEnsemble::EnsembleConfig::Fast;
// Capture stderr and stdout
testing::internal::CaptureStdout();
testing::internal::CaptureStderr();
EXPECT_THROW(ensemble->simulate(*plans), flamegpu::exception::EnsembleError);
// @todo can't capture total number of successful/failed runs
// Get stderr and stdout
Expand Down

0 comments on commit ca6e377

Please sign in to comment.