From 1c4cf1f666195acf7207973be730f5085507cbb2 Mon Sep 17 00:00:00 2001 From: "M. Eric Irrgang" Date: Tue, 1 Dec 2020 17:11:48 +0300 Subject: [PATCH] Improve gmxapi C++ test coverage for failed mdrun. Make sure that we test the C++ API to confirm that non-zero mdrun exit codes are detected when using SIGINT. No additional test execution is needed. We just add a little more rigor to an existing test. Ref #3394 --- src/api/cpp/tests/runner.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/api/cpp/tests/runner.cpp b/src/api/cpp/tests/runner.cpp index d96760836e..4e7f94b332 100644 --- a/src/api/cpp/tests/runner.cpp +++ b/src/api/cpp/tests/runner.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2018, by the GROMACS development team, led by + * Copyright (c) 2018,2020, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -95,7 +95,8 @@ TEST_F(GmxApiTest, RunnerReinitialize) // Try to simulate an interrupt signal to catch. gmx_set_stop_condition(gmx_stop_cond_next_ns); - session->run(); + auto status = session->run(); + EXPECT_FALSE(status.success()); // If this assertion fails, it is not an error, but it indicates expected behavior has // changed and we need to consider the impact of whatever changes caused this. @@ -119,7 +120,8 @@ TEST_F(GmxApiTest, RunnerReinitialize) // Launching a session should clear the stop condition. EXPECT_EQ(gmx_get_stop_condition(), gmx_stop_cond_none); - session->run(); + auto status = session->run(); + EXPECT_TRUE(status.success()); // Stop condition should still be clear. EXPECT_EQ(gmx_get_stop_condition(), gmx_stop_cond_none); -- 2.11.4.GIT