add new key to YAML files: skip_tests
This commit is contained in:
@ -246,6 +246,14 @@ void generate_yaml_file(const char *outfile, const TestConfig &config)
|
||||
// epsilon
|
||||
writer.emit("epsilon", config.epsilon);
|
||||
|
||||
// skip tests
|
||||
block.clear();
|
||||
for (auto &skip_tests : config.skip_tests) {
|
||||
if (block.empty()) block = skip_tests;
|
||||
else block += " " + skip_tests;
|
||||
}
|
||||
writer.emit("skip_tests", block);
|
||||
|
||||
// prerequisites
|
||||
block.clear();
|
||||
for (auto &prerequisite : config.prerequisites) {
|
||||
@ -341,6 +349,8 @@ void generate_yaml_file(const char *outfile, const TestConfig &config)
|
||||
|
||||
TEST(AngleStyle, plain)
|
||||
{
|
||||
if (test_config.skip_tests.count(test_info_->name())) GTEST_SKIP();
|
||||
|
||||
const char *args[] = {"AngleStyle", "-log", "none", "-echo", "screen", "-nocite"};
|
||||
|
||||
char **argv = (char **)args;
|
||||
@ -567,6 +577,8 @@ TEST(AngleStyle, plain)
|
||||
TEST(AngleStyle, omp)
|
||||
{
|
||||
if (!LAMMPS::is_installed_pkg("USER-OMP")) GTEST_SKIP();
|
||||
if (test_config.skip_tests.count(test_info_->name())) GTEST_SKIP();
|
||||
|
||||
const char *args[] = {"AngleStyle", "-log", "none", "-echo", "screen", "-nocite",
|
||||
"-pk", "omp", "4", "-sf", "omp"};
|
||||
|
||||
@ -740,6 +752,8 @@ TEST(AngleStyle, omp)
|
||||
|
||||
TEST(AngleStyle, single)
|
||||
{
|
||||
if (test_config.skip_tests.count(test_info_->name())) GTEST_SKIP();
|
||||
|
||||
const char *args[] = {"AngleStyle", "-log", "none", "-echo", "screen", "-nocite"};
|
||||
|
||||
char **argv = (char **)args;
|
||||
|
||||
@ -246,6 +246,14 @@ void generate_yaml_file(const char *outfile, const TestConfig &config)
|
||||
// epsilon
|
||||
writer.emit("epsilon", config.epsilon);
|
||||
|
||||
// skip tests
|
||||
block.clear();
|
||||
for (auto &skip_tests : config.skip_tests) {
|
||||
if (block.empty()) block = skip_tests;
|
||||
else block += " " + skip_tests;
|
||||
}
|
||||
writer.emit("skip_tests", block);
|
||||
|
||||
// prerequisites
|
||||
block.clear();
|
||||
for (auto &prerequisite : config.prerequisites) {
|
||||
@ -341,6 +349,8 @@ void generate_yaml_file(const char *outfile, const TestConfig &config)
|
||||
|
||||
TEST(BondStyle, plain)
|
||||
{
|
||||
if (test_config.skip_tests.count(test_info_->name())) GTEST_SKIP();
|
||||
|
||||
const char *args[] = {"BondStyle", "-log", "none", "-echo", "screen", "-nocite"};
|
||||
|
||||
char **argv = (char **)args;
|
||||
@ -567,6 +577,8 @@ TEST(BondStyle, plain)
|
||||
TEST(BondStyle, omp)
|
||||
{
|
||||
if (!LAMMPS::is_installed_pkg("USER-OMP")) GTEST_SKIP();
|
||||
if (test_config.skip_tests.count(test_info_->name())) GTEST_SKIP();
|
||||
|
||||
const char *args[] = {"BondStyle", "-log", "none", "-echo", "screen", "-nocite",
|
||||
"-pk", "omp", "4", "-sf", "omp"};
|
||||
|
||||
@ -739,6 +751,8 @@ TEST(BondStyle, omp)
|
||||
|
||||
TEST(BondStyle, single)
|
||||
{
|
||||
if (test_config.skip_tests.count(test_info_->name())) GTEST_SKIP();
|
||||
|
||||
const char *args[] = {"BondStyle", "-log", "none", "-echo", "screen", "-nocite"};
|
||||
|
||||
char **argv = (char **)args;
|
||||
@ -995,6 +1009,8 @@ TEST(BondStyle, single)
|
||||
|
||||
TEST(BondStyle, extract)
|
||||
{
|
||||
if (test_config.skip_tests.count(test_info_->name())) GTEST_SKIP();
|
||||
|
||||
const char *args[] = {"BondStyle", "-log", "none", "-echo", "screen", "-nocite"};
|
||||
|
||||
char **argv = (char **)args;
|
||||
|
||||
@ -14,6 +14,7 @@
|
||||
#ifndef TEST_CONFIG_H
|
||||
#define TEST_CONFIG_H
|
||||
|
||||
#include <set>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
@ -32,6 +33,7 @@ public:
|
||||
std::string date_generated;
|
||||
std::string basename;
|
||||
double epsilon;
|
||||
std::set<std::string> skip_tests;
|
||||
std::vector<std::pair<std::string, std::string>> prerequisites;
|
||||
std::vector<std::string> pre_commands;
|
||||
std::vector<std::string> post_commands;
|
||||
@ -74,6 +76,7 @@ public:
|
||||
init_vdwl(0), run_vdwl(0), init_coul(0), run_coul(0), init_stress({0, 0, 0, 0, 0, 0}),
|
||||
run_stress({0, 0, 0, 0, 0, 0}), global_scalar(0)
|
||||
{
|
||||
skip_tests.clear();
|
||||
prerequisites.clear();
|
||||
pre_commands.clear();
|
||||
post_commands.clear();
|
||||
|
||||
@ -15,6 +15,7 @@
|
||||
#include "test_config.h"
|
||||
#include "yaml.h"
|
||||
#include "yaml_reader.h"
|
||||
#include "utils.h"
|
||||
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
@ -25,11 +26,14 @@
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
using LAMMPS_NS::utils::split_words;
|
||||
|
||||
TestConfigReader::TestConfigReader(TestConfig &config) : YamlReader(), config(config)
|
||||
{
|
||||
consumers["lammps_version"] = &TestConfigReader::lammps_version;
|
||||
consumers["date_generated"] = &TestConfigReader::date_generated;
|
||||
consumers["epsilon"] = &TestConfigReader::epsilon;
|
||||
consumers["skip_tests"] = &TestConfigReader::skip_tests;
|
||||
consumers["prerequisites"] = &TestConfigReader::prerequisites;
|
||||
consumers["pre_commands"] = &TestConfigReader::pre_commands;
|
||||
consumers["post_commands"] = &TestConfigReader::post_commands;
|
||||
@ -66,6 +70,13 @@ TestConfigReader::TestConfigReader(TestConfig &config) : YamlReader(), config(co
|
||||
consumers["equilibrium"] = &TestConfigReader::equilibrium;
|
||||
}
|
||||
|
||||
void TestConfigReader::skip_tests(const yaml_event_t &event)
|
||||
{
|
||||
config.skip_tests.clear();
|
||||
for (auto &word : split_words((char *)event.data.scalar.value))
|
||||
config.skip_tests.insert(word);
|
||||
}
|
||||
|
||||
void TestConfigReader::prerequisites(const yaml_event_t &event)
|
||||
{
|
||||
config.prerequisites.clear();
|
||||
|
||||
@ -23,6 +23,7 @@ class TestConfigReader : public YamlReader<TestConfigReader> {
|
||||
public:
|
||||
TestConfigReader(TestConfig &config);
|
||||
|
||||
void skip_tests(const yaml_event_t &event);
|
||||
void prerequisites(const yaml_event_t &event);
|
||||
void pre_commands(const yaml_event_t &event);
|
||||
void post_commands(const yaml_event_t &event);
|
||||
|
||||
@ -344,6 +344,8 @@ void generate_yaml_file(const char *outfile, const TestConfig &config)
|
||||
|
||||
TEST(DihedralStyle, plain)
|
||||
{
|
||||
if (test_config.skip_tests.count(test_info_->name())) GTEST_SKIP();
|
||||
|
||||
const char *args[] = {"DihedralStyle", "-log", "none", "-echo", "screen", "-nocite"};
|
||||
|
||||
char **argv = (char **)args;
|
||||
@ -570,6 +572,8 @@ TEST(DihedralStyle, plain)
|
||||
TEST(DihedralStyle, omp)
|
||||
{
|
||||
if (!LAMMPS::is_installed_pkg("USER-OMP")) GTEST_SKIP();
|
||||
if (test_config.skip_tests.count(test_info_->name())) GTEST_SKIP();
|
||||
|
||||
const char *args[] = {"DihedralStyle", "-log", "none", "-echo", "screen", "-nocite",
|
||||
"-pk", "omp", "4", "-sf", "omp"};
|
||||
|
||||
|
||||
@ -204,6 +204,14 @@ void generate_yaml_file(const char *outfile, const TestConfig &config)
|
||||
// epsilon
|
||||
writer.emit("epsilon", config.epsilon);
|
||||
|
||||
// skip tests
|
||||
block.clear();
|
||||
for (auto &skip_tests : config.skip_tests) {
|
||||
if (block.empty()) block = skip_tests;
|
||||
else block += " " + skip_tests;
|
||||
}
|
||||
writer.emit("skip_tests", block);
|
||||
|
||||
// prerequisites
|
||||
block.clear();
|
||||
for (auto &prerequisite : config.prerequisites) {
|
||||
@ -287,6 +295,8 @@ void generate_yaml_file(const char *outfile, const TestConfig &config)
|
||||
TEST(FixTimestep, plain)
|
||||
{
|
||||
if (!LAMMPS::is_installed_pkg("MOLECULE")) GTEST_SKIP();
|
||||
if (test_config.skip_tests.count(test_info_->name())) GTEST_SKIP();
|
||||
|
||||
const char *args[] = {"FixTimestep", "-log", "none", "-echo", "screen", "-nocite"};
|
||||
|
||||
char **argv = (char **)args;
|
||||
@ -729,6 +739,8 @@ TEST(FixTimestep, omp)
|
||||
{
|
||||
if (!LAMMPS::is_installed_pkg("USER-OMP")) GTEST_SKIP();
|
||||
if (!LAMMPS::is_installed_pkg("MOLECULE")) GTEST_SKIP();
|
||||
if (test_config.skip_tests.count(test_info_->name())) GTEST_SKIP();
|
||||
|
||||
const char *args[] = {"FixTimestep", "-log", "none", "-echo", "screen", "-nocite",
|
||||
"-pk", "omp", "4", "-sf", "omp"};
|
||||
|
||||
|
||||
@ -246,6 +246,14 @@ void generate_yaml_file(const char *outfile, const TestConfig &config)
|
||||
// epsilon
|
||||
writer.emit("epsilon", config.epsilon);
|
||||
|
||||
// skip tests
|
||||
block.clear();
|
||||
for (auto &skip_tests : config.skip_tests) {
|
||||
if (block.empty()) block = skip_tests;
|
||||
else block += " " + skip_tests;
|
||||
}
|
||||
writer.emit("skip_tests", block);
|
||||
|
||||
// prerequisites
|
||||
block.clear();
|
||||
for (auto &prerequisite : config.prerequisites) {
|
||||
@ -335,6 +343,8 @@ void generate_yaml_file(const char *outfile, const TestConfig &config)
|
||||
|
||||
TEST(ImproperStyle, plain)
|
||||
{
|
||||
if (test_config.skip_tests.count(test_info_->name())) GTEST_SKIP();
|
||||
|
||||
const char *args[] = {"ImproperStyle", "-log", "none", "-echo", "screen", "-nocite"};
|
||||
|
||||
char **argv = (char **)args;
|
||||
@ -561,6 +571,8 @@ TEST(ImproperStyle, plain)
|
||||
TEST(ImproperStyle, omp)
|
||||
{
|
||||
if (!LAMMPS::is_installed_pkg("USER-OMP")) GTEST_SKIP();
|
||||
if (test_config.skip_tests.count(test_info_->name())) GTEST_SKIP();
|
||||
|
||||
const char *args[] = {"ImproperStyle", "-log", "none", "-echo", "screen", "-nocite",
|
||||
"-pk", "omp", "4", "-sf", "omp"};
|
||||
|
||||
|
||||
@ -255,6 +255,14 @@ void generate_yaml_file(const char *outfile, const TestConfig &config)
|
||||
// epsilon
|
||||
writer.emit("epsilon", config.epsilon);
|
||||
|
||||
// skip tests
|
||||
block.clear();
|
||||
for (auto &skip_tests : config.skip_tests) {
|
||||
if (block.empty()) block = skip_tests;
|
||||
else block += " " + skip_tests;
|
||||
}
|
||||
writer.emit("skip_tests", block);
|
||||
|
||||
// prerequisites
|
||||
block.clear();
|
||||
for (auto &prerequisite : config.prerequisites) {
|
||||
@ -350,6 +358,8 @@ void generate_yaml_file(const char *outfile, const TestConfig &config)
|
||||
|
||||
TEST(PairStyle, plain)
|
||||
{
|
||||
if (test_config.skip_tests.count(test_info_->name())) GTEST_SKIP();
|
||||
|
||||
const char *args[] = {"PairStyle", "-log", "none", "-echo", "screen", "-nocite"};
|
||||
|
||||
char **argv = (char **)args;
|
||||
@ -632,6 +642,8 @@ TEST(PairStyle, plain)
|
||||
TEST(PairStyle, omp)
|
||||
{
|
||||
if (!LAMMPS::is_installed_pkg("USER-OMP")) GTEST_SKIP();
|
||||
if (test_config.skip_tests.count(test_info_->name())) GTEST_SKIP();
|
||||
|
||||
const char *args[] = {"PairStyle", "-log", "none", "-echo", "screen", "-nocite",
|
||||
"-pk", "omp", "4", "-sf", "omp"};
|
||||
|
||||
@ -814,6 +826,8 @@ TEST(PairStyle, omp)
|
||||
TEST(PairStyle, gpu)
|
||||
{
|
||||
if (!LAMMPS::is_installed_pkg("GPU")) GTEST_SKIP();
|
||||
if (test_config.skip_tests.count(test_info_->name())) GTEST_SKIP();
|
||||
|
||||
const char *args_neigh[] = {"PairStyle", "-log", "none", "-echo", "screen", "-nocite", "-sf", "gpu"};
|
||||
const char *args_noneigh[] = {"PairStyle", "-log", "none", "-echo", "screen", "-nocite", "-sf", "gpu", "-pk", "gpu", "0", "neigh", "no"};
|
||||
|
||||
@ -933,6 +947,8 @@ TEST(PairStyle, gpu)
|
||||
TEST(PairStyle, intel)
|
||||
{
|
||||
if (!LAMMPS::is_installed_pkg("USER-INTEL")) GTEST_SKIP();
|
||||
if (test_config.skip_tests.count(test_info_->name())) GTEST_SKIP();
|
||||
|
||||
const char *args[] = {"PairStyle", "-log", "none", "-echo", "screen", "-nocite",
|
||||
"-pk", "intel", "0", "mode", "double", "omp",
|
||||
"4", "lrt", "no", "-sf", "intel"};
|
||||
@ -1073,6 +1089,8 @@ TEST(PairStyle, intel)
|
||||
TEST(PairStyle, opt)
|
||||
{
|
||||
if (!LAMMPS::is_installed_pkg("OPT")) GTEST_SKIP();
|
||||
if (test_config.skip_tests.count(test_info_->name())) GTEST_SKIP();
|
||||
|
||||
const char *args[] = {"PairStyle", "-log", "none", "-echo", "screen", "-nocite", "-sf", "opt"};
|
||||
|
||||
char **argv = (char **)args;
|
||||
@ -1178,6 +1196,8 @@ TEST(PairStyle, opt)
|
||||
|
||||
TEST(PairStyle, single)
|
||||
{
|
||||
if (test_config.skip_tests.count(test_info_->name())) GTEST_SKIP();
|
||||
|
||||
const char *args[] = {"PairStyle", "-log", "none", "-echo", "screen", "-nocite"};
|
||||
|
||||
char **argv = (char **)args;
|
||||
@ -1435,6 +1455,8 @@ TEST(PairStyle, single)
|
||||
|
||||
TEST(PairStyle, extract)
|
||||
{
|
||||
if (test_config.skip_tests.count(test_info_->name())) GTEST_SKIP();
|
||||
|
||||
const char *args[] = {"PairStyle", "-log", "none", "-echo", "screen", "-nocite"};
|
||||
|
||||
char **argv = (char **)args;
|
||||
|
||||
Reference in New Issue
Block a user