No flags found
Use flags to group coverage reports by test type, project and/or folders.
Then setup custom commit statuses and notifications for each flag.
e.g., #unittest #integration
#production #enterprise
#frontend #backend
a474b15
... +0 ...
034377a
Use flags to group coverage reports by test type, project and/or folders.
Then setup custom commit statuses and notifications for each flag.
e.g., #unittest #integration
#production #enterprise
#frontend #backend
211 | 211 | fi.autobroker = true; |
|
212 | 212 | continue; |
|
213 | 213 | } |
|
214 | - | if (flg.empty()) |
|
215 | - | { |
|
216 | - | continue; // LCOV_EXCL_LINE |
|
214 | + | if (flg.empty()) { |
|
215 | + | continue; // LCOV_EXCL_LINE |
|
217 | 216 | } |
|
218 | 217 | auto loc = validFlagOptions.find(flg); |
|
219 | 218 | if (loc != validFlagOptions.end()) { |
|
220 | 219 | fi.setFlagOption(propStringsTranslations.at(flg), true); |
|
221 | - | } |
|
222 | - | else { |
|
223 | - | if (flg.front() == '-') |
|
224 | - | { |
|
220 | + | } else { |
|
221 | + | if (flg.front() == '-') { |
|
225 | 222 | loc = validFlagOptions.find(flg.substr(1)); |
|
226 | 223 | if (loc != validFlagOptions.end()) { |
|
227 | 224 | fi.setFlagOption(propStringsTranslations.at(flg.substr(1)), false); |
346 | 343 | ->ignore_underscore(); |
|
347 | 344 | auto rtgroup = app->add_option_group("realtime"); |
|
348 | 345 | rtgroup->option_defaults()->ignore_underscore()->ignore_case(); |
|
349 | - | rtgroup |
|
350 | - | ->add_option_function<Time>( |
|
351 | - | "--rtlag", |
|
352 | - | [this](Time val) { setProperty(helics_property_time_rt_lag, val); }, |
|
353 | - | "the amount of the time the federate is allowed to lag realtime before " |
|
354 | - | "corrective action is taken (default in ms)"); |
|
355 | - | rtgroup |
|
356 | - | ->add_option_function<Time>( |
|
357 | - | "--rtlead", |
|
358 | - | [this](Time val) { setProperty(helics_property_time_rt_lead, val); }, |
|
359 | - | "the amount of the time the federate is allowed to lead realtime before " |
|
360 | - | "corrective action is taken (default in ms)"); |
|
361 | - | rtgroup |
|
362 | - | ->add_option_function<Time>( |
|
363 | - | "--rttolerance", |
|
364 | - | [this](Time val) { setProperty(helics_property_time_rt_tolerance, val); }, |
|
365 | - | "the time tolerance of the real time mode (default in ms)"); |
|
346 | + | rtgroup->add_option_function<Time>( |
|
347 | + | "--rtlag", |
|
348 | + | [this](Time val) { setProperty(helics_property_time_rt_lag, val); }, |
|
349 | + | "the amount of the time the federate is allowed to lag realtime before " |
|
350 | + | "corrective action is taken (default in ms)"); |
|
351 | + | rtgroup->add_option_function<Time>( |
|
352 | + | "--rtlead", |
|
353 | + | [this](Time val) { setProperty(helics_property_time_rt_lead, val); }, |
|
354 | + | "the amount of the time the federate is allowed to lead realtime before " |
|
355 | + | "corrective action is taken (default in ms)"); |
|
356 | + | rtgroup->add_option_function<Time>( |
|
357 | + | "--rttolerance", |
|
358 | + | [this](Time val) { setProperty(helics_property_time_rt_tolerance, val); }, |
|
359 | + | "the time tolerance of the real time mode (default in ms)"); |
|
366 | 360 | ||
367 | 361 | app->add_option_function<Time>( |
|
368 | 362 | "--inputdelay", |
388 | 382 | ->transform( |
|
389 | 383 | CLI::CheckedTransformer(&log_level_map, CLI::ignore_case, CLI::ignore_underscore)); |
|
390 | 384 | ||
391 | - | app->add_option("--separator", [this](CLI::results_t res) { |
|
392 | - | if (res[0].size() != 1) return false; |
|
393 | - | separator = res[0][0]; |
|
394 | - | return true; |
|
395 | - | }, "separator character for local federates") |
|
385 | + | app->add_option( |
|
386 | + | "--separator", |
|
387 | + | [this](CLI::results_t res) { |
|
388 | + | if (res[0].size() != 1) return false; |
|
389 | + | separator = res[0][0]; |
|
390 | + | return true; |
|
391 | + | }, |
|
392 | + | "separator character for local federates") |
|
396 | 393 | ->default_str(std::string(1, separator)) |
|
397 | - | ->type_size(1) |
|
394 | + | ->type_size(1) |
|
398 | 395 | ->type_name("CHAR"); |
|
399 | 396 | app->add_option("--flags,-f,--flag", "named flag for the federate") |
|
400 | 397 | ->type_size(-1) |
434 | 431 | void FederateInfo::loadInfoFromArgsIgnoreOutput(const std::string& args) |
|
435 | 432 | { |
|
436 | 433 | auto app = makeCLIApp(); |
|
437 | - | auto ret=app->helics_parse(args); |
|
434 | + | auto ret = app->helics_parse(args); |
|
438 | 435 | if (ret == helicsCLI11App::parse_output::parse_error) { |
|
439 | 436 | throw helics::InvalidParameter("argument parsing failed"); |
|
440 | 437 | } |
444 | 441 | void FederateInfo::loadInfoFromArgsIgnoreOutput(int argc, char* argv[]) |
|
445 | 442 | { |
|
446 | 443 | auto app = makeCLIApp(); |
|
447 | - | auto ret=app->helics_parse(argc, argv); |
|
444 | + | auto ret = app->helics_parse(argc, argv); |
|
448 | 445 | if (ret == helicsCLI11App::parse_output::parse_error) { |
|
449 | 446 | throw helics::InvalidParameter("argument parsing failed"); |
|
450 | 447 | } |
476 | 473 | (hasJsonExtension(configString)) || |
|
477 | 474 | (configString.find_first_of('{') != std::string::npos)) { |
|
478 | 475 | ret = loadFederateInfoJson(configString); |
|
479 | - | } |
|
480 | - | else if (configString.find("--") != std::string::npos) { |
|
476 | + | } else if (configString.find("--") != std::string::npos) { |
|
481 | 477 | ret.loadInfoFromArgsIgnoreOutput(configString); |
|
482 | - | } |
|
483 | - | else if (configString.find("=") != std::string::npos) |
|
484 | - | { |
|
478 | + | } else if (configString.find("=") != std::string::npos) { |
|
485 | 479 | ret = loadFederateInfoToml(configString); |
|
486 | 480 | } else { |
|
487 | 481 | ret.defName = configString; |
531 | 525 | if (!callIfMember(doc, "max_iterations", intCall)) { |
|
532 | 526 | callIfMember(doc, "maxiterations", intCall); |
|
533 | 527 | } |
|
534 | - | bool lfound{ false }; |
|
535 | - | try |
|
536 | - | { |
|
528 | + | bool lfound{false}; |
|
529 | + | try { |
|
537 | 530 | lfound = callIfMember(doc, "log_level", intCall); |
|
538 | 531 | if (!lfound) { |
|
539 | 532 | lfound = callIfMember(doc, "loglevel", intCall); |
|
540 | 533 | } |
|
541 | 534 | } |
|
542 | - | catch (...) |
|
543 | - | { |
|
535 | + | catch (...) { |
|
544 | 536 | // ignore errors here |
|
545 | 537 | } |
|
546 | 538 | if (!lfound) { |
583 | 575 | } |
|
584 | 576 | if (doc.isMember("core")) { |
|
585 | 577 | auto ct = coreTypeFromString(doc["core"].asString()); |
|
586 | - | if (ct != core_type::UNRECOGNIZED) |
|
587 | - | { |
|
578 | + | if (ct != core_type::UNRECOGNIZED) { |
|
588 | 579 | fi.coreType = ct; |
|
589 | - | }else |
|
590 | - | { |
|
580 | + | } else { |
|
591 | 581 | fi.coreName = doc["core"].asString(); |
|
592 | 582 | } |
|
593 | 583 | } |
|
594 | 584 | if (doc.isMember("coreType")) { |
|
595 | 585 | auto ct = coreTypeFromString(doc["coreType"].asString()); |
|
596 | - | if (ct != core_type::UNRECOGNIZED) |
|
597 | - | { |
|
586 | + | if (ct != core_type::UNRECOGNIZED) { |
|
598 | 587 | fi.coreType = ct; |
|
599 | - | } |
|
600 | - | else |
|
601 | - | { |
|
602 | - | throw(helics::InvalidIdentifier(doc["coreType"].asString() + " is not a valid core type")); |
|
588 | + | } else { |
|
589 | + | throw(helics::InvalidIdentifier( |
|
590 | + | doc["coreType"].asString() + " is not a valid core type")); |
|
603 | 591 | } |
|
604 | 592 | } else if (doc.isMember("coretype")) { |
|
605 | 593 | auto ct = coreTypeFromString(doc["coretype"].asString()); |
|
606 | - | if (ct != core_type::UNRECOGNIZED) |
|
607 | - | { |
|
594 | + | if (ct != core_type::UNRECOGNIZED) { |
|
608 | 595 | fi.coreType = ct; |
|
609 | - | } |
|
610 | - | else |
|
611 | - | { |
|
612 | - | throw(helics::InvalidIdentifier(doc["coretype"].asString() + " is not a valid core type")); |
|
596 | + | } else { |
|
597 | + | throw(helics::InvalidIdentifier( |
|
598 | + | doc["coretype"].asString() + " is not a valid core type")); |
|
613 | 599 | } |
|
614 | 600 | ||
615 | 601 | } else if (doc.isMember("type")) { |
|
616 | 602 | auto ct = coreTypeFromString(doc["type"].asString()); |
|
617 | - | if (ct != core_type::UNRECOGNIZED) |
|
618 | - | { |
|
603 | + | if (ct != core_type::UNRECOGNIZED) { |
|
619 | 604 | fi.coreType = ct; |
|
605 | + | } else { |
|
606 | + | throw(helics::InvalidIdentifier(doc["type"].asString() + " is not a valid core type")); |
|
620 | 607 | } |
|
621 | - | else |
|
622 | - | { |
|
623 | - | throw(helics::InvalidIdentifier(doc["type"].asString() + " is not a valid core type")); |
|
624 | - | } |
|
625 | 608 | } |
|
626 | 609 | replaceIfMember(doc, "name", fi.defName); |
|
627 | 610 | replaceIfMember(doc, "coreName", fi.coreName); |
676 | 659 | if (!callIfMember(doc, "max_iterations", intCall)) { |
|
677 | 660 | callIfMember(doc, "maxiterations", intCall); |
|
678 | 661 | } |
|
679 | - | bool lfound{ false }; |
|
680 | - | try |
|
681 | - | { |
|
662 | + | bool lfound{false}; |
|
663 | + | try { |
|
682 | 664 | lfound = callIfMember(doc, "log_level", intCall); |
|
683 | 665 | if (!lfound) { |
|
684 | 666 | lfound = callIfMember(doc, "loglevel", intCall); |
|
685 | 667 | } |
|
686 | 668 | } |
|
687 | - | catch (...) |
|
688 | - | { |
|
669 | + | catch (...) { |
|
689 | 670 | if (!lfound) { |
|
690 | 671 | lfound = callIfMember(doc, "log_level", logTranslations); |
|
691 | 672 | } |
|
692 | 673 | if (!lfound) { |
|
693 | 674 | lfound = callIfMember(doc, "loglevel", logTranslations); |
|
694 | 675 | } |
|
695 | 676 | } |
|
696 | - | ||
697 | 677 | ||
698 | 678 | for (auto& prop : validFlagOptions) { |
|
699 | 679 | callIfMember(doc, prop, flagCall); |
727 | 707 | } |
|
728 | 708 | if (isMember(doc, "core")) { |
|
729 | 709 | auto ct = coreTypeFromString(tomlAsString(doc["core"])); |
|
730 | - | if (ct != core_type::UNRECOGNIZED) |
|
731 | - | { |
|
710 | + | if (ct != core_type::UNRECOGNIZED) { |
|
732 | 711 | fi.coreType = ct; |
|
733 | - | } |
|
734 | - | else |
|
735 | - | { |
|
712 | + | } else { |
|
736 | 713 | fi.coreName = tomlAsString(doc["core"]); |
|
737 | 714 | } |
|
738 | 715 | } |
|
739 | 716 | if (isMember(doc, "coreType")) { |
|
740 | - | auto ct=coreTypeFromString(tomlAsString(doc["coreType"])); |
|
741 | - | if (ct != core_type::UNRECOGNIZED) |
|
742 | - | { |
|
717 | + | auto ct = coreTypeFromString(tomlAsString(doc["coreType"])); |
|
718 | + | if (ct != core_type::UNRECOGNIZED) { |
|
743 | 719 | fi.coreType = ct; |
|
744 | - | } |
|
745 | - | else |
|
746 | - | { |
|
747 | - | throw(helics::InvalidIdentifier(tomlAsString(doc["coreType"]) + " is not a valid core type")); |
|
720 | + | } else { |
|
721 | + | throw(helics::InvalidIdentifier( |
|
722 | + | tomlAsString(doc["coreType"]) + " is not a valid core type")); |
|
748 | 723 | } |
|
749 | 724 | } else if (isMember(doc, "coretype")) { |
|
750 | 725 | auto ct = coreTypeFromString(tomlAsString(doc["coretype"])); |
|
751 | - | if (ct != core_type::UNRECOGNIZED) |
|
752 | - | { |
|
726 | + | if (ct != core_type::UNRECOGNIZED) { |
|
753 | 727 | fi.coreType = ct; |
|
754 | - | } |
|
755 | - | else |
|
756 | - | { |
|
757 | - | throw(helics::InvalidIdentifier(tomlAsString(doc["coretype"]) + " is not a valid core type")); |
|
728 | + | } else { |
|
729 | + | throw(helics::InvalidIdentifier( |
|
730 | + | tomlAsString(doc["coretype"]) + " is not a valid core type")); |
|
758 | 731 | } |
|
759 | 732 | } else if (isMember(doc, "type")) { |
|
760 | 733 | auto ct = coreTypeFromString(tomlAsString(doc["type"])); |
|
761 | - | if (ct != core_type::UNRECOGNIZED) |
|
762 | - | { |
|
734 | + | if (ct != core_type::UNRECOGNIZED) { |
|
763 | 735 | fi.coreType = ct; |
|
764 | - | } |
|
765 | - | else |
|
766 | - | { |
|
767 | - | throw(helics::InvalidIdentifier(tomlAsString(doc["type"]) + " is not a valid core type")); |
|
736 | + | } else { |
|
737 | + | throw( |
|
738 | + | helics::InvalidIdentifier(tomlAsString(doc["type"]) + " is not a valid core type")); |
|
768 | 739 | } |
|
769 | 740 | } |
|
770 | 741 | replaceIfMember(doc, "name", fi.defName); |
Learn more Showing 7 files with coverage changes found.
src/helics/core/zmq/ZmqComms.cpp
src/helics/core/TimeCoordinator.cpp
src/helics/application_api/FederateInfo.cpp
src/helics/core/CoreBroker.cpp
src/helics/core/CommonCore.cpp
src/helics/core/udp/UdpComms.cpp
src/helics/core/ipc/IpcQueueHelper.cpp
Files | Coverage |
---|---|
src/helics | +<.01% 75.00% |
Project Totals (195 files) | 75.00% |
034377a
a474b15