adjust recently added/expanded tests so they skip tests when packages are missing
This commit is contained in:
@ -105,7 +105,7 @@ TEST_F(LibraryConfig, style_count)
|
|||||||
EXPECT_GT(lammps_style_count(lmp, "dihedral"), 1);
|
EXPECT_GT(lammps_style_count(lmp, "dihedral"), 1);
|
||||||
EXPECT_GT(lammps_style_count(lmp, "improper"), 1);
|
EXPECT_GT(lammps_style_count(lmp, "improper"), 1);
|
||||||
EXPECT_GT(lammps_style_count(lmp, "pair"), 1);
|
EXPECT_GT(lammps_style_count(lmp, "pair"), 1);
|
||||||
EXPECT_GT(lammps_style_count(lmp, "kspace"), 1);
|
EXPECT_GE(lammps_style_count(lmp, "kspace"), 0);
|
||||||
EXPECT_GT(lammps_style_count(lmp, "compute"), 1);
|
EXPECT_GT(lammps_style_count(lmp, "compute"), 1);
|
||||||
EXPECT_GT(lammps_style_count(lmp, "fix"), 1);
|
EXPECT_GT(lammps_style_count(lmp, "fix"), 1);
|
||||||
EXPECT_GT(lammps_style_count(lmp, "region"), 1);
|
EXPECT_GT(lammps_style_count(lmp, "region"), 1);
|
||||||
|
|||||||
@ -12,6 +12,7 @@
|
|||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
#include "atom.h"
|
#include "atom.h"
|
||||||
|
#include "info.h"
|
||||||
#include "input.h"
|
#include "input.h"
|
||||||
#include "gmock/gmock.h"
|
#include "gmock/gmock.h"
|
||||||
#include "gtest/gtest.h"
|
#include "gtest/gtest.h"
|
||||||
@ -37,6 +38,7 @@ using ::testing::MatchesRegex;
|
|||||||
class PythonPackageTest : public ::testing::Test {
|
class PythonPackageTest : public ::testing::Test {
|
||||||
protected:
|
protected:
|
||||||
LAMMPS *lmp;
|
LAMMPS *lmp;
|
||||||
|
Info *info;
|
||||||
|
|
||||||
void SetUp() override
|
void SetUp() override
|
||||||
{
|
{
|
||||||
@ -47,6 +49,7 @@ protected:
|
|||||||
lmp = new LAMMPS(argc, argv, MPI_COMM_WORLD);
|
lmp = new LAMMPS(argc, argv, MPI_COMM_WORLD);
|
||||||
if (!verbose) ::testing::internal::GetCapturedStdout();
|
if (!verbose) ::testing::internal::GetCapturedStdout();
|
||||||
ASSERT_NE(lmp, nullptr);
|
ASSERT_NE(lmp, nullptr);
|
||||||
|
info = new Info(lmp);
|
||||||
if (!verbose) ::testing::internal::CaptureStdout();
|
if (!verbose) ::testing::internal::CaptureStdout();
|
||||||
lmp->input->one("units real");
|
lmp->input->one("units real");
|
||||||
lmp->input->one("dimension 3");
|
lmp->input->one("dimension 3");
|
||||||
@ -71,6 +74,7 @@ protected:
|
|||||||
|
|
||||||
TEST_F(PythonPackageTest, python_invoke)
|
TEST_F(PythonPackageTest, python_invoke)
|
||||||
{
|
{
|
||||||
|
if (!info->has_style("command","python")) GTEST_SKIP();
|
||||||
// execute python function from file
|
// execute python function from file
|
||||||
if (!verbose) ::testing::internal::CaptureStdout();
|
if (!verbose) ::testing::internal::CaptureStdout();
|
||||||
lmp->input->one("python printnum file ${input_dir}/func.py");
|
lmp->input->one("python printnum file ${input_dir}/func.py");
|
||||||
@ -105,6 +109,7 @@ TEST_F(PythonPackageTest, python_invoke)
|
|||||||
|
|
||||||
TEST_F(PythonPackageTest, python_variable)
|
TEST_F(PythonPackageTest, python_variable)
|
||||||
{
|
{
|
||||||
|
if (!info->has_style("command","python")) GTEST_SKIP();
|
||||||
if (!verbose) ::testing::internal::CaptureStdout();
|
if (!verbose) ::testing::internal::CaptureStdout();
|
||||||
lmp->input->one("variable sq python square");
|
lmp->input->one("variable sq python square");
|
||||||
lmp->input->one("variable val index 1.5");
|
lmp->input->one("variable val index 1.5");
|
||||||
|
|||||||
Reference in New Issue
Block a user