Skip to content

Commit

Permalink
Allow running a single test only
Browse files Browse the repository at this point in the history
  • Loading branch information
Anilm3 committed Jan 5, 2024
1 parent 23ad9cf commit e84ce87
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions perf/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,17 +119,16 @@ benchmark::settings generate_settings(const std::vector<std::string> &args)
print_help_and_exit(args[0], "Missing option --scenarios");
} else {
auto root = opts["scenarios"];
if (!fs::is_directory(root)) {
std::cerr << "Scenarios should be a directory" << std::endl;
utils::exit_failure();
}

for (const auto &dir_entry : fs::directory_iterator{root}) {
const fs::path &scenario_path = dir_entry;
if (fs::is_directory(root)) {
for (const auto &dir_entry : fs::directory_iterator{root}) {
const fs::path &scenario_path = dir_entry;

if (is_regular_file(scenario_path) && scenario_path.extension() == ".json") {
s.scenarios.push_back(scenario_path);
if (is_regular_file(scenario_path) && scenario_path.extension() == ".json") {
s.scenarios.emplace_back(scenario_path);
}
}
} else {
s.scenarios.emplace_back(root);
}
}

Expand Down

0 comments on commit e84ce87

Please sign in to comment.