From ca6e37732030a9337ec85e1233c70fe28b070e48 Mon Sep 17 00:00:00 2001 From: Robert Chisholm Date: Thu, 27 Jul 2023 15:51:44 +0100 Subject: [PATCH] fixup --- tests/test_cases/simulation/test_mpi_ensemble.cu | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/test_cases/simulation/test_mpi_ensemble.cu b/tests/test_cases/simulation/test_mpi_ensemble.cu index 1d3bb1f80..47cb6a579 100644 --- a/tests/test_cases/simulation/test_mpi_ensemble.cu +++ b/tests/test_cases/simulation/test_mpi_ensemble.cu @@ -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 @@ -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 @@ -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 @@ -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