Skip to content

Commit

Permalink
❄️
Browse files Browse the repository at this point in the history
  • Loading branch information
matz-e committed Jul 17, 2024
1 parent bbaea66 commit ee5421f
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
* SPDX-License-Identifier: Apache-2.0
*/

#include <fstream>
#include <filesystem>
#include <fstream>
#include <string>
#include <vector>

Expand Down Expand Up @@ -78,7 +78,8 @@ bool check_solvers(const std::string& directory) {
return true;

Check warning on line 78 in src/main.cpp

View check run for this annotation

Codecov / codecov/patch

src/main.cpp#L78

Added line #L78 was not covered by tests
}

void dump_solvers(const std::string& directory, const std::vector<std::string>& solvers = nmodl::solver::get_names()) {
void dump_solvers(const std::string& directory,
const std::vector<std::string>& solvers = nmodl::solver::get_names()) {
fs::path output(directory);

for (const auto& solver: solvers) {
Expand Down Expand Up @@ -216,12 +217,12 @@ int main(int argc, const char* argv[]) {
->ignore_case();

app.add_option_function<std::vector<std::string>>(
"--dump-solvers",
[&](const std::vector<std::string>& solvers) {
dump_solvers(output_dir, solvers);
exit(0);
},
"Create solver headers in directory and exit")
"--dump-solvers",
[&](const std::vector<std::string>& solvers) {
dump_solvers(output_dir, solvers);
exit(0);

Check warning on line 223 in src/main.cpp

View check run for this annotation

Codecov / codecov/patch

src/main.cpp#L221-L223

Added lines #L221 - L223 were not covered by tests
},
"Create solver headers in directory and exit")
->expected(1, 2)
->check(CLI::IsMember(nmodl::solver::get_names()));

Expand Down Expand Up @@ -349,8 +350,9 @@ int main(int argc, const char* argv[]) {
};

if (skip_dump_solvers) {
if (! check_solvers(output_dir)) {
logger->error("Solvers not found in output directory. Please use --dump-solvers first");
if (!check_solvers(output_dir)) {
logger->error(

Check warning on line 354 in src/main.cpp

View check run for this annotation

Codecov / codecov/patch

src/main.cpp#L353-L354

Added lines #L353 - L354 were not covered by tests
"Solvers not found in output directory. Please use --dump-solvers first");
}
} else {
// Unconditionally update the solver files to ensure that they are compatible with
Expand Down

0 comments on commit ee5421f

Please sign in to comment.