mirror of https://github.com/lammps/lammps.git
avoid global namespace import in header, more consistency
This commit is contained in:
parent
634496b509
commit
bb6ea422b7
unittest
commands
test_compute_global.cpptest_delete_atoms.cpptest_groups.cpptest_kim_commands.cpptest_lattice_region.cpptest_regions.cpptest_reset_ids.cpptest_set_property.cpptest_simple_commands.cpptest_variables.cpp
cplusplus
formats
compressed_dump_test_main.cpptest_dump_atom.cpptest_dump_cfg.cpptest_dump_custom.cpptest_dump_local.cpptest_dump_netcdf.cpp
testing
|
@ -26,8 +26,6 @@
|
||||||
// whether to print verbose output (i.e. not capturing LAMMPS screen output).
|
// whether to print verbose output (i.e. not capturing LAMMPS screen output).
|
||||||
bool verbose = false;
|
bool verbose = false;
|
||||||
|
|
||||||
using LAMMPS_NS::utils::split_words;
|
|
||||||
|
|
||||||
namespace LAMMPS_NS {
|
namespace LAMMPS_NS {
|
||||||
|
|
||||||
#define STRINGIFY(val) XSTR(val)
|
#define STRINGIFY(val) XSTR(val)
|
||||||
|
@ -296,7 +294,6 @@ TEST_F(ComputeGlobalTest, Reduction)
|
||||||
EXPECT_DOUBLE_EQ(rep[2], 26);
|
EXPECT_DOUBLE_EQ(rep[2], 26);
|
||||||
EXPECT_DOUBLE_EQ(rep[3], max[0]);
|
EXPECT_DOUBLE_EQ(rep[3], max[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace LAMMPS_NS
|
} // namespace LAMMPS_NS
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
|
@ -304,12 +301,12 @@ int main(int argc, char **argv)
|
||||||
MPI_Init(&argc, &argv);
|
MPI_Init(&argc, &argv);
|
||||||
::testing::InitGoogleMock(&argc, argv);
|
::testing::InitGoogleMock(&argc, argv);
|
||||||
|
|
||||||
if (platform::mpi_vendor() == "Open MPI" && !Info::has_exceptions())
|
if (LAMMPS_NS::platform::mpi_vendor() == "Open MPI" && !Info::has_exceptions())
|
||||||
std::cout << "Warning: using OpenMPI without exceptions. Death tests will be skipped\n";
|
std::cout << "Warning: using OpenMPI without exceptions. Death tests will be skipped\n";
|
||||||
|
|
||||||
// handle arguments passed via environment variable
|
// handle arguments passed via environment variable
|
||||||
if (const char *var = getenv("TEST_ARGS")) {
|
if (const char *var = getenv("TEST_ARGS")) {
|
||||||
std::vector<std::string> env = split_words(var);
|
std::vector<std::string> env = LAMMPS_NS::utils::split_words(var);
|
||||||
for (auto arg : env) {
|
for (auto arg : env) {
|
||||||
if (arg == "-v") {
|
if (arg == "-v") {
|
||||||
verbose = true;
|
verbose = true;
|
||||||
|
|
|
@ -31,9 +31,6 @@
|
||||||
// whether to print verbose output (i.e. not capturing LAMMPS screen output).
|
// whether to print verbose output (i.e. not capturing LAMMPS screen output).
|
||||||
bool verbose = false;
|
bool verbose = false;
|
||||||
|
|
||||||
using LAMMPS_NS::MathConst::MY_PI;
|
|
||||||
using LAMMPS_NS::utils::split_words;
|
|
||||||
|
|
||||||
namespace LAMMPS_NS {
|
namespace LAMMPS_NS {
|
||||||
using ::testing::ContainsRegex;
|
using ::testing::ContainsRegex;
|
||||||
using ::testing::ExitedWithCode;
|
using ::testing::ExitedWithCode;
|
||||||
|
@ -164,12 +161,12 @@ int main(int argc, char **argv)
|
||||||
MPI_Init(&argc, &argv);
|
MPI_Init(&argc, &argv);
|
||||||
::testing::InitGoogleMock(&argc, argv);
|
::testing::InitGoogleMock(&argc, argv);
|
||||||
|
|
||||||
if (platform::mpi_vendor() == "Open MPI" && !Info::has_exceptions())
|
if (LAMMPS_NS::platform::mpi_vendor() == "Open MPI" && !Info::has_exceptions())
|
||||||
std::cout << "Warning: using OpenMPI without exceptions. Death tests will be skipped\n";
|
std::cout << "Warning: using OpenMPI without exceptions. Death tests will be skipped\n";
|
||||||
|
|
||||||
// handle arguments passed via environment variable
|
// handle arguments passed via environment variable
|
||||||
if (const char *var = getenv("TEST_ARGS")) {
|
if (const char *var = getenv("TEST_ARGS")) {
|
||||||
std::vector<std::string> env = split_words(var);
|
std::vector<std::string> env = LAMMPS_NS::utils::split_words(var);
|
||||||
for (auto arg : env) {
|
for (auto arg : env) {
|
||||||
if (arg == "-v") {
|
if (arg == "-v") {
|
||||||
verbose = true;
|
verbose = true;
|
||||||
|
|
|
@ -316,12 +316,12 @@ int main(int argc, char **argv)
|
||||||
MPI_Init(&argc, &argv);
|
MPI_Init(&argc, &argv);
|
||||||
::testing::InitGoogleMock(&argc, argv);
|
::testing::InitGoogleMock(&argc, argv);
|
||||||
|
|
||||||
if (platform::mpi_vendor() == "Open MPI" && !Info::has_exceptions())
|
if (LAMMPS_NS::platform::mpi_vendor() == "Open MPI" && !Info::has_exceptions())
|
||||||
std::cout << "Warning: using OpenMPI without exceptions. Death tests will be skipped\n";
|
std::cout << "Warning: using OpenMPI without exceptions. Death tests will be skipped\n";
|
||||||
|
|
||||||
// handle arguments passed via environment variable
|
// handle arguments passed via environment variable
|
||||||
if (const char *var = getenv("TEST_ARGS")) {
|
if (const char *var = getenv("TEST_ARGS")) {
|
||||||
std::vector<std::string> env = split_words(var);
|
std::vector<std::string> env = LAMMPS_NS::utils::split_words(var);
|
||||||
for (auto arg : env) {
|
for (auto arg : env) {
|
||||||
if (arg == "-v") {
|
if (arg == "-v") {
|
||||||
verbose = true;
|
verbose = true;
|
||||||
|
|
|
@ -683,12 +683,12 @@ int main(int argc, char **argv)
|
||||||
MPI_Init(&argc, &argv);
|
MPI_Init(&argc, &argv);
|
||||||
::testing::InitGoogleMock(&argc, argv);
|
::testing::InitGoogleMock(&argc, argv);
|
||||||
|
|
||||||
if (platform::mpi_vendor() == "Open MPI" && !Info::has_exceptions())
|
if (LAMMPS_NS::platform::mpi_vendor() == "Open MPI" && !Info::has_exceptions())
|
||||||
std::cout << "Warning: using OpenMPI without exceptions. Death tests will be skipped\n";
|
std::cout << "Warning: using OpenMPI without exceptions. Death tests will be skipped\n";
|
||||||
|
|
||||||
// handle arguments passed via environment variable
|
// handle arguments passed via environment variable
|
||||||
if (const char *var = getenv("TEST_ARGS")) {
|
if (const char *var = getenv("TEST_ARGS")) {
|
||||||
std::vector<std::string> env = split_words(var);
|
std::vector<std::string> env = LAMMPS_NS::utils::split_words(var);
|
||||||
for (auto arg : env) {
|
for (auto arg : env) {
|
||||||
if (arg == "-v") {
|
if (arg == "-v") {
|
||||||
verbose = true;
|
verbose = true;
|
||||||
|
|
|
@ -32,8 +32,6 @@
|
||||||
// whether to print verbose output (i.e. not capturing LAMMPS screen output).
|
// whether to print verbose output (i.e. not capturing LAMMPS screen output).
|
||||||
bool verbose = false;
|
bool verbose = false;
|
||||||
|
|
||||||
using LAMMPS_NS::utils::split_words;
|
|
||||||
|
|
||||||
namespace LAMMPS_NS {
|
namespace LAMMPS_NS {
|
||||||
using ::testing::ContainsRegex;
|
using ::testing::ContainsRegex;
|
||||||
using ::testing::ExitedWithCode;
|
using ::testing::ExitedWithCode;
|
||||||
|
@ -634,12 +632,12 @@ int main(int argc, char **argv)
|
||||||
MPI_Init(&argc, &argv);
|
MPI_Init(&argc, &argv);
|
||||||
::testing::InitGoogleMock(&argc, argv);
|
::testing::InitGoogleMock(&argc, argv);
|
||||||
|
|
||||||
if (platform::mpi_vendor() == "Open MPI" && !Info::has_exceptions())
|
if (LAMMPS_NS::platform::mpi_vendor() == "Open MPI" && !Info::has_exceptions())
|
||||||
std::cout << "Warning: using OpenMPI without exceptions. Death tests will be skipped\n";
|
std::cout << "Warning: using OpenMPI without exceptions. Death tests will be skipped\n";
|
||||||
|
|
||||||
// handle arguments passed via environment variable
|
// handle arguments passed via environment variable
|
||||||
if (const char *var = getenv("TEST_ARGS")) {
|
if (const char *var = getenv("TEST_ARGS")) {
|
||||||
std::vector<std::string> env = split_words(var);
|
std::vector<std::string> env = LAMMPS_NS::utils::split_words(var);
|
||||||
for (auto arg : env) {
|
for (auto arg : env) {
|
||||||
if (arg == "-v") {
|
if (arg == "-v") {
|
||||||
verbose = true;
|
verbose = true;
|
||||||
|
|
|
@ -30,8 +30,6 @@
|
||||||
// whether to print verbose output (i.e. not capturing LAMMPS screen output).
|
// whether to print verbose output (i.e. not capturing LAMMPS screen output).
|
||||||
bool verbose = false;
|
bool verbose = false;
|
||||||
|
|
||||||
using LAMMPS_NS::utils::split_words;
|
|
||||||
|
|
||||||
namespace LAMMPS_NS {
|
namespace LAMMPS_NS {
|
||||||
using ::testing::ExitedWithCode;
|
using ::testing::ExitedWithCode;
|
||||||
using ::testing::StrEq;
|
using ::testing::StrEq;
|
||||||
|
@ -279,12 +277,12 @@ int main(int argc, char **argv)
|
||||||
MPI_Init(&argc, &argv);
|
MPI_Init(&argc, &argv);
|
||||||
::testing::InitGoogleMock(&argc, argv);
|
::testing::InitGoogleMock(&argc, argv);
|
||||||
|
|
||||||
if (platform::mpi_vendor() == "Open MPI" && !Info::has_exceptions())
|
if (LAMMPS_NS::platform::mpi_vendor() == "Open MPI" && !Info::has_exceptions())
|
||||||
std::cout << "Warning: using OpenMPI without exceptions. Death tests will be skipped\n";
|
std::cout << "Warning: using OpenMPI without exceptions. Death tests will be skipped\n";
|
||||||
|
|
||||||
// handle arguments passed via environment variable
|
// handle arguments passed via environment variable
|
||||||
if (const char *var = getenv("TEST_ARGS")) {
|
if (const char *var = getenv("TEST_ARGS")) {
|
||||||
std::vector<std::string> env = split_words(var);
|
std::vector<std::string> env = LAMMPS_NS::utils::split_words(var);
|
||||||
for (auto arg : env) {
|
for (auto arg : env) {
|
||||||
if (arg == "-v") {
|
if (arg == "-v") {
|
||||||
verbose = true;
|
verbose = true;
|
||||||
|
|
|
@ -29,8 +29,6 @@
|
||||||
// whether to print verbose output (i.e. not capturing LAMMPS screen output).
|
// whether to print verbose output (i.e. not capturing LAMMPS screen output).
|
||||||
bool verbose = false;
|
bool verbose = false;
|
||||||
|
|
||||||
using LAMMPS_NS::utils::split_words;
|
|
||||||
|
|
||||||
namespace LAMMPS_NS {
|
namespace LAMMPS_NS {
|
||||||
|
|
||||||
#define GETIDX(i) lmp->atom->map(i)
|
#define GETIDX(i) lmp->atom->map(i)
|
||||||
|
@ -677,7 +675,6 @@ TEST_F(ResetMolIDsTest, FailOnlyMolecular)
|
||||||
END_HIDE_OUTPUT();
|
END_HIDE_OUTPUT();
|
||||||
TEST_FAILURE(".*ERROR: Can only use reset_mol_ids.*", command("reset_mol_ids all"););
|
TEST_FAILURE(".*ERROR: Can only use reset_mol_ids.*", command("reset_mol_ids all"););
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace LAMMPS_NS
|
} // namespace LAMMPS_NS
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
|
@ -685,12 +682,12 @@ int main(int argc, char **argv)
|
||||||
MPI_Init(&argc, &argv);
|
MPI_Init(&argc, &argv);
|
||||||
::testing::InitGoogleMock(&argc, argv);
|
::testing::InitGoogleMock(&argc, argv);
|
||||||
|
|
||||||
if (platform::mpi_vendor() == "Open MPI" && !Info::has_exceptions())
|
if (LAMMPS_NS::platform::mpi_vendor() == "Open MPI" && !Info::has_exceptions())
|
||||||
std::cout << "Warning: using OpenMPI without exceptions. Death tests will be skipped\n";
|
std::cout << "Warning: using OpenMPI without exceptions. Death tests will be skipped\n";
|
||||||
|
|
||||||
// handle arguments passed via environment variable
|
// handle arguments passed via environment variable
|
||||||
if (const char *var = getenv("TEST_ARGS")) {
|
if (const char *var = getenv("TEST_ARGS")) {
|
||||||
std::vector<std::string> env = split_words(var);
|
std::vector<std::string> env = LAMMPS_NS::utils::split_words(var);
|
||||||
for (auto arg : env) {
|
for (auto arg : env) {
|
||||||
if (arg == "-v") {
|
if (arg == "-v") {
|
||||||
verbose = true;
|
verbose = true;
|
||||||
|
|
|
@ -25,14 +25,11 @@
|
||||||
// whether to print verbose output (i.e. not capturing LAMMPS screen output).
|
// whether to print verbose output (i.e. not capturing LAMMPS screen output).
|
||||||
bool verbose = false;
|
bool verbose = false;
|
||||||
|
|
||||||
using LAMMPS_NS::MathConst::MY_PI;
|
|
||||||
using LAMMPS_NS::utils::split_words;
|
|
||||||
|
|
||||||
namespace LAMMPS_NS {
|
|
||||||
using ::testing::ContainsRegex;
|
using ::testing::ContainsRegex;
|
||||||
using ::testing::ExitedWithCode;
|
using ::testing::ExitedWithCode;
|
||||||
using ::testing::StrEq;
|
using ::testing::StrEq;
|
||||||
|
|
||||||
|
namespace LAMMPS_NS {
|
||||||
class SetTest : public LAMMPSTest {
|
class SetTest : public LAMMPSTest {
|
||||||
protected:
|
protected:
|
||||||
Atom *atom;
|
Atom *atom;
|
||||||
|
@ -172,12 +169,12 @@ int main(int argc, char **argv)
|
||||||
MPI_Init(&argc, &argv);
|
MPI_Init(&argc, &argv);
|
||||||
::testing::InitGoogleMock(&argc, argv);
|
::testing::InitGoogleMock(&argc, argv);
|
||||||
|
|
||||||
if (platform::mpi_vendor() == "Open MPI" && !LAMMPS_NS::Info::has_exceptions())
|
if (LAMMPS_NS::platform::mpi_vendor() == "Open MPI" && !Info::has_exceptions())
|
||||||
std::cout << "Warning: using OpenMPI without exceptions. Death tests will be skipped\n";
|
std::cout << "Warning: using OpenMPI without exceptions. Death tests will be skipped\n";
|
||||||
|
|
||||||
// handle arguments passed via environment variable
|
// handle arguments passed via environment variable
|
||||||
if (const char *var = getenv("TEST_ARGS")) {
|
if (const char *var = getenv("TEST_ARGS")) {
|
||||||
std::vector<std::string> env = split_words(var);
|
std::vector<std::string> env = LAMMPS_NS::utils::split_words(var);
|
||||||
for (auto arg : env) {
|
for (auto arg : env) {
|
||||||
if (arg == "-v") {
|
if (arg == "-v") {
|
||||||
verbose = true;
|
verbose = true;
|
||||||
|
|
|
@ -36,8 +36,6 @@
|
||||||
// whether to print verbose output (i.e. not capturing LAMMPS screen output).
|
// whether to print verbose output (i.e. not capturing LAMMPS screen output).
|
||||||
bool verbose = false;
|
bool verbose = false;
|
||||||
|
|
||||||
using LAMMPS_NS::utils::split_words;
|
|
||||||
|
|
||||||
namespace LAMMPS_NS {
|
namespace LAMMPS_NS {
|
||||||
using ::testing::ContainsRegex;
|
using ::testing::ContainsRegex;
|
||||||
using ::testing::ExitedWithCode;
|
using ::testing::ExitedWithCode;
|
||||||
|
@ -552,12 +550,12 @@ int main(int argc, char **argv)
|
||||||
MPI_Init(&argc, &argv);
|
MPI_Init(&argc, &argv);
|
||||||
::testing::InitGoogleMock(&argc, argv);
|
::testing::InitGoogleMock(&argc, argv);
|
||||||
|
|
||||||
if (platform::mpi_vendor() == "Open MPI" && !Info::has_exceptions())
|
if (LAMMPS_NS::platform::mpi_vendor() == "Open MPI" && !Info::has_exceptions())
|
||||||
std::cout << "Warning: using OpenMPI without exceptions. Death tests will be skipped\n";
|
std::cout << "Warning: using OpenMPI without exceptions. Death tests will be skipped\n";
|
||||||
|
|
||||||
// handle arguments passed via environment variable
|
// handle arguments passed via environment variable
|
||||||
if (const char *var = getenv("TEST_ARGS")) {
|
if (const char *var = getenv("TEST_ARGS")) {
|
||||||
std::vector<std::string> env = split_words(var);
|
std::vector<std::string> env = LAMMPS_NS::utils::split_words(var);
|
||||||
for (auto arg : env) {
|
for (auto arg : env) {
|
||||||
if (arg == "-v") {
|
if (arg == "-v") {
|
||||||
verbose = true;
|
verbose = true;
|
||||||
|
|
|
@ -32,13 +32,11 @@
|
||||||
// whether to print verbose output (i.e. not capturing LAMMPS screen output).
|
// whether to print verbose output (i.e. not capturing LAMMPS screen output).
|
||||||
bool verbose = false;
|
bool verbose = false;
|
||||||
|
|
||||||
using LAMMPS_NS::MathConst::MY_PI;
|
|
||||||
using LAMMPS_NS::utils::split_words;
|
|
||||||
|
|
||||||
namespace LAMMPS_NS {
|
namespace LAMMPS_NS {
|
||||||
using ::testing::ContainsRegex;
|
using ::testing::ContainsRegex;
|
||||||
using ::testing::ExitedWithCode;
|
using ::testing::ExitedWithCode;
|
||||||
using ::testing::StrEq;
|
using ::testing::StrEq;
|
||||||
|
using MathConst::MY_PI;
|
||||||
|
|
||||||
class VariableTest : public LAMMPSTest {
|
class VariableTest : public LAMMPSTest {
|
||||||
protected:
|
protected:
|
||||||
|
@ -585,12 +583,12 @@ int main(int argc, char **argv)
|
||||||
MPI_Init(&argc, &argv);
|
MPI_Init(&argc, &argv);
|
||||||
::testing::InitGoogleMock(&argc, argv);
|
::testing::InitGoogleMock(&argc, argv);
|
||||||
|
|
||||||
if (platform::mpi_vendor() == "Open MPI" && !Info::has_exceptions())
|
if (LAMMPS_NS::platform::mpi_vendor() == "Open MPI" && !Info::has_exceptions())
|
||||||
std::cout << "Warning: using OpenMPI without exceptions. Death tests will be skipped\n";
|
std::cout << "Warning: using OpenMPI without exceptions. Death tests will be skipped\n";
|
||||||
|
|
||||||
// handle arguments passed via environment variable
|
// handle arguments passed via environment variable
|
||||||
if (const char *var = getenv("TEST_ARGS")) {
|
if (const char *var = getenv("TEST_ARGS")) {
|
||||||
std::vector<std::string> env = split_words(var);
|
std::vector<std::string> env = LAMMPS_NS::utils::split_words(var);
|
||||||
for (auto arg : env) {
|
for (auto arg : env) {
|
||||||
if (arg == "-v") {
|
if (arg == "-v") {
|
||||||
verbose = true;
|
verbose = true;
|
||||||
|
|
|
@ -16,7 +16,6 @@
|
||||||
bool verbose = false;
|
bool verbose = false;
|
||||||
|
|
||||||
namespace LAMMPS_NS {
|
namespace LAMMPS_NS {
|
||||||
|
|
||||||
class Advanced_utils : public LAMMPSTest {
|
class Advanced_utils : public LAMMPSTest {
|
||||||
protected:
|
protected:
|
||||||
Error *error;
|
Error *error;
|
||||||
|
@ -218,7 +217,6 @@ TEST_F(Advanced_utils, expand_args)
|
||||||
delete[] args[i];
|
delete[] args[i];
|
||||||
delete[] args;
|
delete[] args;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace LAMMPS_NS
|
} // namespace LAMMPS_NS
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
|
@ -226,12 +224,12 @@ int main(int argc, char **argv)
|
||||||
MPI_Init(&argc, &argv);
|
MPI_Init(&argc, &argv);
|
||||||
::testing::InitGoogleMock(&argc, argv);
|
::testing::InitGoogleMock(&argc, argv);
|
||||||
|
|
||||||
if (platform::mpi_vendor() == "Open MPI" && !Info::has_exceptions())
|
if (LAMMPS_NS::platform::mpi_vendor() == "Open MPI" && !Info::has_exceptions())
|
||||||
std::cout << "Warning: using OpenMPI without exceptions. Death tests will be skipped\n";
|
std::cout << "Warning: using OpenMPI without exceptions. Death tests will be skipped\n";
|
||||||
|
|
||||||
// handle arguments passed via environment variable
|
// handle arguments passed via environment variable
|
||||||
if (const char *var = getenv("TEST_ARGS")) {
|
if (const char *var = getenv("TEST_ARGS")) {
|
||||||
std::vector<std::string> env = utils::split_words(var);
|
std::vector<std::string> env = LAMMPS_NS::utils::split_words(var);
|
||||||
for (auto arg : env) {
|
for (auto arg : env) {
|
||||||
if (arg == "-v") {
|
if (arg == "-v") {
|
||||||
verbose = true;
|
verbose = true;
|
||||||
|
|
|
@ -16,9 +16,7 @@
|
||||||
bool verbose = false;
|
bool verbose = false;
|
||||||
|
|
||||||
namespace LAMMPS_NS {
|
namespace LAMMPS_NS {
|
||||||
|
|
||||||
using ::testing::ContainsRegex;
|
using ::testing::ContainsRegex;
|
||||||
using utils::split_words;
|
|
||||||
|
|
||||||
class Error_class : public LAMMPSTest {
|
class Error_class : public LAMMPSTest {
|
||||||
protected:
|
protected:
|
||||||
|
@ -120,7 +118,6 @@ TEST_F(Error_class, all)
|
||||||
{
|
{
|
||||||
TEST_FAILURE("ERROR: one error.*test_error_class.cpp:.*", error->all(FLERR, "one error"););
|
TEST_FAILURE("ERROR: one error.*test_error_class.cpp:.*", error->all(FLERR, "one error"););
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace LAMMPS_NS
|
} // namespace LAMMPS_NS
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
|
@ -128,12 +125,12 @@ int main(int argc, char **argv)
|
||||||
MPI_Init(&argc, &argv);
|
MPI_Init(&argc, &argv);
|
||||||
::testing::InitGoogleMock(&argc, argv);
|
::testing::InitGoogleMock(&argc, argv);
|
||||||
|
|
||||||
if (platform::mpi_vendor() == "Open MPI" && !Info::has_exceptions())
|
if (LAMMPS_NS::platform::mpi_vendor() == "Open MPI" && !Info::has_exceptions())
|
||||||
std::cout << "Warning: using OpenMPI without exceptions. Death tests will be skipped\n";
|
std::cout << "Warning: using OpenMPI without exceptions. Death tests will be skipped\n";
|
||||||
|
|
||||||
// handle arguments passed via environment variable
|
// handle arguments passed via environment variable
|
||||||
if (const char *var = getenv("TEST_ARGS")) {
|
if (const char *var = getenv("TEST_ARGS")) {
|
||||||
std::vector<std::string> env = split_words(var);
|
std::vector<std::string> env = LAMMPS_NS::utils::split_words(var);
|
||||||
for (auto arg : env) {
|
for (auto arg : env) {
|
||||||
if (arg == "-v") {
|
if (arg == "-v") {
|
||||||
verbose = true;
|
verbose = true;
|
||||||
|
|
|
@ -50,7 +50,7 @@ int main(int argc, char **argv)
|
||||||
|
|
||||||
// handle arguments passed via environment variable
|
// handle arguments passed via environment variable
|
||||||
if (const char *var = getenv("TEST_ARGS")) {
|
if (const char *var = getenv("TEST_ARGS")) {
|
||||||
std::vector<std::string> env = utils::split_words(var);
|
std::vector<std::string> env = LAMMPS_NS::utils::split_words(var);
|
||||||
for (auto arg : env) {
|
for (auto arg : env) {
|
||||||
if (arg == "-v") {
|
if (arg == "-v") {
|
||||||
verbose = true;
|
verbose = true;
|
||||||
|
|
|
@ -28,6 +28,8 @@ using ::testing::Eq;
|
||||||
char *BINARY2TXT_EXECUTABLE = nullptr;
|
char *BINARY2TXT_EXECUTABLE = nullptr;
|
||||||
bool verbose = false;
|
bool verbose = false;
|
||||||
|
|
||||||
|
namespace LAMMPS_NS {
|
||||||
|
|
||||||
class DumpAtomTest : public MeltTest {
|
class DumpAtomTest : public MeltTest {
|
||||||
std::string dump_style = "atom";
|
std::string dump_style = "atom";
|
||||||
|
|
||||||
|
@ -678,6 +680,7 @@ TEST_F(DumpAtomTest, binary_write_dump)
|
||||||
delete_file(reference);
|
delete_file(reference);
|
||||||
delete_file(dump_file);
|
delete_file(dump_file);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
|
@ -686,7 +689,7 @@ int main(int argc, char **argv)
|
||||||
|
|
||||||
// handle arguments passed via environment variable
|
// handle arguments passed via environment variable
|
||||||
if (const char *var = getenv("TEST_ARGS")) {
|
if (const char *var = getenv("TEST_ARGS")) {
|
||||||
std::vector<std::string> env = utils::split_words(var);
|
std::vector<std::string> env = LAMMPS_NS::utils::split_words(var);
|
||||||
for (auto arg : env) {
|
for (auto arg : env) {
|
||||||
if (arg == "-v") {
|
if (arg == "-v") {
|
||||||
verbose = true;
|
verbose = true;
|
||||||
|
|
|
@ -23,6 +23,7 @@ using ::testing::Eq;
|
||||||
|
|
||||||
bool verbose = false;
|
bool verbose = false;
|
||||||
|
|
||||||
|
namespace LAMMPS_NS {
|
||||||
class DumpCfgTest : public MeltTest {
|
class DumpCfgTest : public MeltTest {
|
||||||
std::string dump_style = "cfg";
|
std::string dump_style = "cfg";
|
||||||
|
|
||||||
|
@ -143,6 +144,7 @@ TEST_F(DumpCfgTest, no_unwrap_no_buffer_run0)
|
||||||
ASSERT_THAT(lines[0], Eq("Number of particles = 32"));
|
ASSERT_THAT(lines[0], Eq("Number of particles = 32"));
|
||||||
delete_file("dump_cfg_no_unwrap_no_buffer_run0.melt.cfg");
|
delete_file("dump_cfg_no_unwrap_no_buffer_run0.melt.cfg");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
|
@ -151,7 +153,7 @@ int main(int argc, char **argv)
|
||||||
|
|
||||||
// handle arguments passed via environment variable
|
// handle arguments passed via environment variable
|
||||||
if (const char *var = getenv("TEST_ARGS")) {
|
if (const char *var = getenv("TEST_ARGS")) {
|
||||||
std::vector<std::string> env = utils::split_words(var);
|
std::vector<std::string> env = LAMMPS_NS::utils::split_words(var);
|
||||||
for (auto arg : env) {
|
for (auto arg : env) {
|
||||||
if (arg == "-v") {
|
if (arg == "-v") {
|
||||||
verbose = true;
|
verbose = true;
|
||||||
|
|
|
@ -26,6 +26,7 @@ using ::testing::Eq;
|
||||||
char *BINARY2TXT_EXECUTABLE = nullptr;
|
char *BINARY2TXT_EXECUTABLE = nullptr;
|
||||||
bool verbose = false;
|
bool verbose = false;
|
||||||
|
|
||||||
|
namespace LAMMPS_NS {
|
||||||
class DumpCustomTest : public MeltTest {
|
class DumpCustomTest : public MeltTest {
|
||||||
std::string dump_style = "custom";
|
std::string dump_style = "custom";
|
||||||
|
|
||||||
|
@ -383,7 +384,7 @@ TEST_F(DumpCustomTest, rerun_bin)
|
||||||
ASSERT_NEAR(pe_2, pe_rerun, 1.0e-14);
|
ASSERT_NEAR(pe_2, pe_rerun, 1.0e-14);
|
||||||
delete_file(dump_file);
|
delete_file(dump_file);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
MPI_Init(&argc, &argv);
|
MPI_Init(&argc, &argv);
|
||||||
|
@ -391,7 +392,7 @@ int main(int argc, char **argv)
|
||||||
|
|
||||||
// handle arguments passed via environment variable
|
// handle arguments passed via environment variable
|
||||||
if (const char *var = getenv("TEST_ARGS")) {
|
if (const char *var = getenv("TEST_ARGS")) {
|
||||||
std::vector<std::string> env = utils::split_words(var);
|
std::vector<std::string> env = LAMMPS_NS::utils::split_words(var);
|
||||||
for (auto arg : env) {
|
for (auto arg : env) {
|
||||||
if (arg == "-v") {
|
if (arg == "-v") {
|
||||||
verbose = true;
|
verbose = true;
|
||||||
|
|
|
@ -28,6 +28,7 @@ using ::testing::Eq;
|
||||||
char *BINARY2TXT_EXECUTABLE = nullptr;
|
char *BINARY2TXT_EXECUTABLE = nullptr;
|
||||||
bool verbose = false;
|
bool verbose = false;
|
||||||
|
|
||||||
|
namespace LAMMPS_NS {
|
||||||
class DumpLocalTest : public MeltTest {
|
class DumpLocalTest : public MeltTest {
|
||||||
std::string dump_style = "local";
|
std::string dump_style = "local";
|
||||||
|
|
||||||
|
@ -237,6 +238,7 @@ TEST_F(DumpLocalTest, triclinic_run0)
|
||||||
ASSERT_EQ(utils::split_words(lines[7]).size(), 3);
|
ASSERT_EQ(utils::split_words(lines[7]).size(), 3);
|
||||||
delete_file(dump_file);
|
delete_file(dump_file);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
|
@ -245,7 +247,7 @@ int main(int argc, char **argv)
|
||||||
|
|
||||||
// handle arguments passed via environment variable
|
// handle arguments passed via environment variable
|
||||||
if (const char *var = getenv("TEST_ARGS")) {
|
if (const char *var = getenv("TEST_ARGS")) {
|
||||||
std::vector<std::string> env = utils::split_words(var);
|
std::vector<std::string> env = LAMMPS_NS::utils::split_words(var);
|
||||||
for (auto arg : env) {
|
for (auto arg : env) {
|
||||||
if (arg == "-v") {
|
if (arg == "-v") {
|
||||||
verbose = true;
|
verbose = true;
|
||||||
|
|
|
@ -31,6 +31,7 @@ using ::testing::Eq;
|
||||||
char *NCDUMP_EXECUTABLE = nullptr;
|
char *NCDUMP_EXECUTABLE = nullptr;
|
||||||
bool verbose = false;
|
bool verbose = false;
|
||||||
|
|
||||||
|
namespace LAMMPS_NS {
|
||||||
class DumpNetCDFTest : public MeltTest {
|
class DumpNetCDFTest : public MeltTest {
|
||||||
std::string dump_style = "netcdf";
|
std::string dump_style = "netcdf";
|
||||||
|
|
||||||
|
@ -386,6 +387,7 @@ TEST_F(DumpNetCDFTest, run0_mpi)
|
||||||
}
|
}
|
||||||
delete_file(dump_file);
|
delete_file(dump_file);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
|
@ -394,7 +396,7 @@ int main(int argc, char **argv)
|
||||||
|
|
||||||
// handle arguments passed via environment variable
|
// handle arguments passed via environment variable
|
||||||
if (const char *var = getenv("TEST_ARGS")) {
|
if (const char *var = getenv("TEST_ARGS")) {
|
||||||
std::vector<std::string> env = utils::split_words(var);
|
std::vector<std::string> env = LAMMPS_NS::utils::split_words(var);
|
||||||
for (auto arg : env) {
|
for (auto arg : env) {
|
||||||
if (arg == "-v") {
|
if (arg == "-v") {
|
||||||
verbose = true;
|
verbose = true;
|
||||||
|
|
|
@ -26,7 +26,9 @@
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
using namespace LAMMPS_NS;
|
using LAMMPS_NS::Info;
|
||||||
|
using LAMMPS_NS::LAMMPS;
|
||||||
|
using LAMMPS_NS::LAMMPSException;
|
||||||
|
|
||||||
using ::testing::ContainsRegex;
|
using ::testing::ContainsRegex;
|
||||||
|
|
||||||
|
@ -37,7 +39,7 @@ using ::testing::ContainsRegex;
|
||||||
auto mesg = ::testing::internal::GetCapturedStdout(); \
|
auto mesg = ::testing::internal::GetCapturedStdout(); \
|
||||||
ASSERT_THAT(mesg, ContainsRegex(errmsg)); \
|
ASSERT_THAT(mesg, ContainsRegex(errmsg)); \
|
||||||
} else { \
|
} else { \
|
||||||
if (platform::mpi_vendor() != "Open MPI") { \
|
if (LAMMPS_NS::platform::mpi_vendor() != "Open MPI") { \
|
||||||
::testing::internal::CaptureStdout(); \
|
::testing::internal::CaptureStdout(); \
|
||||||
ASSERT_DEATH({__VA_ARGS__}, ""); \
|
ASSERT_DEATH({__VA_ARGS__}, ""); \
|
||||||
auto mesg = ::testing::internal::GetCapturedStdout(); \
|
auto mesg = ::testing::internal::GetCapturedStdout(); \
|
||||||
|
@ -101,7 +103,7 @@ public:
|
||||||
|
|
||||||
double get_variable_value(const std::string &name)
|
double get_variable_value(const std::string &name)
|
||||||
{
|
{
|
||||||
char *str = utils::strdup(fmt::format("v_{}", name));
|
char *str = LAMMPS_NS::utils::strdup(fmt::format("v_{}", name));
|
||||||
double value = lmp->input->variable->compute_equal(str);
|
double value = lmp->input->variable->compute_equal(str);
|
||||||
delete[] str;
|
delete[] str;
|
||||||
return value;
|
return value;
|
||||||
|
@ -122,9 +124,9 @@ protected:
|
||||||
{
|
{
|
||||||
int argc = args.size() + 1;
|
int argc = args.size() + 1;
|
||||||
char **argv = new char *[argc];
|
char **argv = new char *[argc];
|
||||||
argv[0] = utils::strdup(testbinary);
|
argv[0] = LAMMPS_NS::utils::strdup(testbinary);
|
||||||
for (int i = 1; i < argc; i++) {
|
for (int i = 1; i < argc; i++) {
|
||||||
argv[i] = utils::strdup(args[i - 1]);
|
argv[i] = LAMMPS_NS::utils::strdup(args[i - 1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
HIDE_OUTPUT([&] {
|
HIDE_OUTPUT([&] {
|
||||||
|
|
Loading…
Reference in New Issue