Add tags to force-style tests

Adds an optional "tags" entry in the force style test YAML. This is a
comma-separated list of keywords, which are parsed by CMake and added as labels
for CTest.  This allows more fine-grained filtering of tests. Any
newly-generated YAML file automatically adds the "generated" tag.
This commit is contained in:
Richard Berger
2021-11-19 09:09:56 -05:00
parent 229ce0a61b
commit 4ac351eba6
5 changed files with 55 additions and 0 deletions

View File

@ -16,6 +16,7 @@
#include <set>
#include <string>
#include <sstream>
#include <utility>
#include <vector>
@ -37,6 +38,7 @@ public:
std::vector<std::pair<std::string, std::string>> prerequisites;
std::vector<std::string> pre_commands;
std::vector<std::string> post_commands;
std::vector<std::string> tags;
std::string input_file;
std::string pair_style;
std::string bond_style;
@ -96,6 +98,19 @@ public:
}
virtual ~TestConfig(){};
std::string tags_line() const
{
if(tags.size() > 0) {
std::stringstream line;
line << tags[0];
for(size_t i = 1; i < tags.size(); i++) {
line << ", " << tags[i];
}
return line.str();
}
return "generated";
}
private:
TestConfig(const TestConfig &){};
};