From 4392eed12a7c3ed011fa05e90cac7814cb1c60b6 Mon Sep 17 00:00:00 2001 From: Enrico Seiler Date: Fri, 3 Dec 2021 12:07:50 +0100 Subject: [PATCH 01/12] [MISC] {seqan3->sharg}/version.hpp --- include/sharg/detail/format_base.hpp | 2 +- include/sharg/detail/format_html.hpp | 2 +- include/sharg/detail/format_man.hpp | 2 +- include/sharg/detail/version_check.hpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/sharg/detail/format_base.hpp b/include/sharg/detail/format_base.hpp index 378a2976..4a17d7a9 100644 --- a/include/sharg/detail/format_base.hpp +++ b/include/sharg/detail/format_base.hpp @@ -24,7 +24,7 @@ #include #include #include -#include +#include namespace sharg::detail { diff --git a/include/sharg/detail/format_html.hpp b/include/sharg/detail/format_html.hpp index f1051895..0523c8c5 100644 --- a/include/sharg/detail/format_html.hpp +++ b/include/sharg/detail/format_html.hpp @@ -16,7 +16,7 @@ #include #include -#include +#include namespace sharg::detail { diff --git a/include/sharg/detail/format_man.hpp b/include/sharg/detail/format_man.hpp index 65ffc0bf..087ded46 100644 --- a/include/sharg/detail/format_man.hpp +++ b/include/sharg/detail/format_man.hpp @@ -16,7 +16,7 @@ #include #include -#include +#include namespace sharg::detail { diff --git a/include/sharg/detail/version_check.hpp b/include/sharg/detail/version_check.hpp index 3f98d0e3..f6870987 100644 --- a/include/sharg/detail/version_check.hpp +++ b/include/sharg/detail/version_check.hpp @@ -25,7 +25,7 @@ #include #include #include -#include +#include namespace sharg::detail { From e5e9e42d76de041702816153d35a84ab13335793 Mon Sep 17 00:00:00 2001 From: Enrico Seiler Date: Fri, 3 Dec 2021 12:08:48 +0100 Subject: [PATCH 02/12] [MISC] Sort headers in include seqan3 header are in a separate block to be easily spotted --- include/sharg/argument_parser.hpp | 6 +++--- include/sharg/auxiliary.hpp | 4 ++-- include/sharg/detail/concept.hpp | 3 ++- include/sharg/detail/format_base.hpp | 3 ++- include/sharg/detail/format_help.hpp | 3 ++- include/sharg/detail/format_parse.hpp | 7 ++++--- include/sharg/detail/version_check.hpp | 5 +++-- include/sharg/validators.hpp | 9 +++++---- 8 files changed, 23 insertions(+), 17 deletions(-) diff --git a/include/sharg/argument_parser.hpp b/include/sharg/argument_parser.hpp index 00b59353..d30f1e3b 100644 --- a/include/sharg/argument_parser.hpp +++ b/include/sharg/argument_parser.hpp @@ -21,15 +21,15 @@ #include #include -// #include +#include +#include + #include #include #include #include #include #include -#include -#include namespace sharg { diff --git a/include/sharg/auxiliary.hpp b/include/sharg/auxiliary.hpp index 3d3a6294..82b9242b 100644 --- a/include/sharg/auxiliary.hpp +++ b/include/sharg/auxiliary.hpp @@ -12,15 +12,15 @@ #pragma once -#include #include -#include #include #include #include #include #include +#include +#include namespace sharg::custom { diff --git a/include/sharg/detail/concept.hpp b/include/sharg/detail/concept.hpp index d81a31e1..1de91219 100644 --- a/include/sharg/detail/concept.hpp +++ b/include/sharg/detail/concept.hpp @@ -12,8 +12,9 @@ #pragma once -#include #include + +#include #include #include diff --git a/include/sharg/detail/format_base.hpp b/include/sharg/detail/format_base.hpp index 4a17d7a9..281d067b 100644 --- a/include/sharg/detail/format_base.hpp +++ b/include/sharg/detail/format_base.hpp @@ -19,11 +19,12 @@ #include #include +#include + #include #include #include #include -#include #include namespace sharg::detail diff --git a/include/sharg/detail/format_help.hpp b/include/sharg/detail/format_help.hpp index c2f3efca..95ea578b 100644 --- a/include/sharg/detail/format_help.hpp +++ b/include/sharg/detail/format_help.hpp @@ -17,9 +17,10 @@ #include #include +#include + #include #include -#include namespace sharg::detail { diff --git a/include/sharg/detail/format_parse.hpp b/include/sharg/detail/format_parse.hpp index bd00437f..d40a697a 100644 --- a/include/sharg/detail/format_parse.hpp +++ b/include/sharg/detail/format_parse.hpp @@ -12,15 +12,16 @@ #pragma once -#include -#include #include #include #include -#include +#include +#include #include +#include + namespace sharg::detail { diff --git a/include/sharg/detail/version_check.hpp b/include/sharg/detail/version_check.hpp index f6870987..1ca67959 100644 --- a/include/sharg/detail/version_check.hpp +++ b/include/sharg/detail/version_check.hpp @@ -14,7 +14,6 @@ #include -#include #include #include #include @@ -22,9 +21,11 @@ #include #include +#include +#include + #include #include -#include #include namespace sharg::detail diff --git a/include/sharg/validators.hpp b/include/sharg/validators.hpp index 0ad8582a..7a81847f 100644 --- a/include/sharg/validators.hpp +++ b/include/sharg/validators.hpp @@ -12,22 +12,23 @@ #pragma once -#include -#include #include #include -#include #include #include -#include #include #include #include #include +#include +#include +#include #include #include +#include + namespace sharg { From 6c7c5707bd5d2830369f3fec147cd49b43503913 Mon Sep 17 00:00:00 2001 From: Enrico Seiler Date: Fri, 3 Dec 2021 12:09:06 +0100 Subject: [PATCH 03/12] [DOC] fix closing namespace comment --- include/sharg/detail/terminal.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/sharg/detail/terminal.hpp b/include/sharg/detail/terminal.hpp index 76703562..1e857ce8 100644 --- a/include/sharg/detail/terminal.hpp +++ b/include/sharg/detail/terminal.hpp @@ -73,4 +73,4 @@ inline unsigned get_terminal_width() #endif } -} // namespace seqan::detail +} // namespace sharg::detail From 38d214153e30f3845f79b86801b14189ce867a9d Mon Sep 17 00:00:00 2001 From: Enrico Seiler Date: Fri, 3 Dec 2021 12:10:02 +0100 Subject: [PATCH 04/12] [MISC] Simplify includes in test/snippet debug_stream can be replaced with cerr --- test/snippet/argument_parser_1.cpp | 3 +-- test/snippet/argument_parser_2.cpp | 3 +-- test/snippet/is_option_set.cpp | 5 ++--- test/snippet/validators_1.cpp | 3 +-- test/snippet/validators_2.cpp | 3 +-- test/snippet/validators_3.cpp | 4 +--- test/snippet/validators_4.cpp | 3 +-- test/snippet/validators_chaining.cpp | 1 - test/snippet/validators_input_directory.cpp | 4 +--- test/snippet/validators_input_file.cpp | 4 +--- test/snippet/validators_input_file_ext_from_file.cpp | 10 +++++----- test/snippet/validators_output_directory.cpp | 4 +--- test/snippet/validators_output_file.cpp | 4 +--- test/snippet/validators_output_file_ext_from_file.cpp | 10 +++++----- 14 files changed, 22 insertions(+), 39 deletions(-) diff --git a/test/snippet/argument_parser_1.cpp b/test/snippet/argument_parser_1.cpp index 4cab2e9b..cc3522f0 100644 --- a/test/snippet/argument_parser_1.cpp +++ b/test/snippet/argument_parser_1.cpp @@ -1,5 +1,4 @@ #include -#include int main(int argc, char ** argv) { @@ -32,7 +31,7 @@ int main(int argc, char ** argv) avg = avg / grades.size(); - seqan3::debug_stream << name << " has an average grade of " << avg << '\n'; + std::cerr << name << " has an average grade of " << avg << '\n'; return 0; } diff --git a/test/snippet/argument_parser_2.cpp b/test/snippet/argument_parser_2.cpp index 2a31dccb..fad7a713 100644 --- a/test/snippet/argument_parser_2.cpp +++ b/test/snippet/argument_parser_2.cpp @@ -1,5 +1,4 @@ #include -#include int main(int argc, char ** argv) { @@ -19,6 +18,6 @@ int main(int argc, char ** argv) return -1; } - seqan3::debug_stream << "integer given by user: " << age << '\n'; + std::cerr << "integer given by user: " << age << '\n'; return 0; } diff --git a/test/snippet/is_option_set.cpp b/test/snippet/is_option_set.cpp index 5642b11e..1efa5cdf 100644 --- a/test/snippet/is_option_set.cpp +++ b/test/snippet/is_option_set.cpp @@ -1,5 +1,4 @@ #include -#include int main(int argc, char ** argv) { @@ -19,10 +18,10 @@ int main(int argc, char ** argv) } if (myparser.is_option_set('a')) - seqan3::debug_stream << "The user set option -a on the command line.\n"; + std::cerr << "The user set option -a on the command line.\n"; if (myparser.is_option_set("awesome-parameter")) - seqan3::debug_stream << "The user set option --awesome-parameter on the command line.\n"; + std::cerr << "The user set option --awesome-parameter on the command line.\n"; // Asking for an option identifier that was not used before throws an error: // myparser.is_option_set("foo"); // throws sharg::design_error diff --git a/test/snippet/validators_1.cpp b/test/snippet/validators_1.cpp index cd2009fc..e05a98b2 100644 --- a/test/snippet/validators_1.cpp +++ b/test/snippet/validators_1.cpp @@ -1,5 +1,4 @@ #include -#include int main(int argc, const char ** argv) { @@ -25,6 +24,6 @@ int main(int argc, const char ** argv) return -1; } - seqan3::debug_stream << "integer given by user passed validation: " << myint << "\n"; + std::cerr << "integer given by user passed validation: " << myint << "\n"; return 0; } diff --git a/test/snippet/validators_2.cpp b/test/snippet/validators_2.cpp index 9e8636b2..08692c4d 100644 --- a/test/snippet/validators_2.cpp +++ b/test/snippet/validators_2.cpp @@ -1,5 +1,4 @@ #include -#include int main(int argc, const char ** argv) { @@ -25,6 +24,6 @@ int main(int argc, const char ** argv) return -1; } - seqan3::debug_stream << "integer given by user passed validation: " << myint << "\n"; + std::cerr << "integer given by user passed validation: " << myint << "\n"; return 0; } diff --git a/test/snippet/validators_3.cpp b/test/snippet/validators_3.cpp index 5b366efe..ce8d23b9 100644 --- a/test/snippet/validators_3.cpp +++ b/test/snippet/validators_3.cpp @@ -1,6 +1,4 @@ #include -#include -#include int main(int argc, const char ** argv) { @@ -26,6 +24,6 @@ int main(int argc, const char ** argv) return -1; } - seqan3::debug_stream << "filename given by user passed validation: " << myfile << "\n"; + std::cerr << "filename given by user passed validation: " << myfile << "\n"; return 0; } diff --git a/test/snippet/validators_4.cpp b/test/snippet/validators_4.cpp index 2ae9cb5e..3df1049b 100644 --- a/test/snippet/validators_4.cpp +++ b/test/snippet/validators_4.cpp @@ -1,5 +1,4 @@ #include -#include int main(int argc, const char ** argv) { @@ -25,6 +24,6 @@ int main(int argc, const char ** argv) return -1; } - seqan3::debug_stream << "email address given by user passed validation: " << my_string << "\n"; + std::cerr << "email address given by user passed validation: " << my_string << "\n"; return 0; } diff --git a/test/snippet/validators_chaining.cpp b/test/snippet/validators_chaining.cpp index 7b3c7c12..cf365de2 100644 --- a/test/snippet/validators_chaining.cpp +++ b/test/snippet/validators_chaining.cpp @@ -1,5 +1,4 @@ #include -#include int main(int argc, const char ** argv) { diff --git a/test/snippet/validators_input_directory.cpp b/test/snippet/validators_input_directory.cpp index bb26a732..0ad1fb4a 100644 --- a/test/snippet/validators_input_directory.cpp +++ b/test/snippet/validators_input_directory.cpp @@ -1,6 +1,4 @@ #include -#include -#include int main(int argc, const char ** argv) { @@ -25,6 +23,6 @@ int main(int argc, const char ** argv) return -1; } - seqan3::debug_stream << "directory given by user passed validation: " << mydir << "\n"; + std::cerr << "directory given by user passed validation: " << mydir << "\n"; return 0; } diff --git a/test/snippet/validators_input_file.cpp b/test/snippet/validators_input_file.cpp index 8fb5475c..39a52fd9 100644 --- a/test/snippet/validators_input_file.cpp +++ b/test/snippet/validators_input_file.cpp @@ -1,6 +1,4 @@ #include -#include -#include int main(int argc, const char ** argv) { @@ -25,6 +23,6 @@ int main(int argc, const char ** argv) return -1; } - seqan3::debug_stream << "filename given by user passed validation: " << myfile << "\n"; + std::cerr << "filename given by user passed validation: " << myfile << "\n"; return 0; } diff --git a/test/snippet/validators_input_file_ext_from_file.cpp b/test/snippet/validators_input_file_ext_from_file.cpp index 200bd438..cb534364 100644 --- a/test/snippet/validators_input_file_ext_from_file.cpp +++ b/test/snippet/validators_input_file_ext_from_file.cpp @@ -1,20 +1,20 @@ -#include -#include #include +#include + int main() { // Default constructed validator has an empty extension list. sharg::input_file_validator validator1{}; - seqan3::debug_stream << validator1.get_help_page_message() << '\n'; + std::cerr << validator1.get_help_page_message() << '\n'; // Specify your own extensions for the input file. sharg::input_file_validator validator2{std::vector{std::string{"exe"}, std::string{"fasta"}}}; - seqan3::debug_stream << validator2.get_help_page_message() << '\n'; + std::cerr << validator2.get_help_page_message() << '\n'; // Give the seqan3 file type as a template argument to get all valid extensions for this file. sharg::input_file_validator> validator3{}; - seqan3::debug_stream << validator3.get_help_page_message() << '\n'; + std::cerr << validator3.get_help_page_message() << '\n'; return 0; } diff --git a/test/snippet/validators_output_directory.cpp b/test/snippet/validators_output_directory.cpp index f90cfbe8..4f1600b1 100644 --- a/test/snippet/validators_output_directory.cpp +++ b/test/snippet/validators_output_directory.cpp @@ -1,6 +1,4 @@ #include -#include -#include int main(int argc, const char ** argv) { @@ -26,6 +24,6 @@ int main(int argc, const char ** argv) return -1; } - seqan3::debug_stream << "directory given by user passed validation: " << mydir << "\n"; + std::cerr << "directory given by user passed validation: " << mydir << "\n"; return 0; } diff --git a/test/snippet/validators_output_file.cpp b/test/snippet/validators_output_file.cpp index ba1ec87c..670471cd 100644 --- a/test/snippet/validators_output_file.cpp +++ b/test/snippet/validators_output_file.cpp @@ -1,6 +1,4 @@ #include -#include -#include int main(int argc, const char ** argv) { @@ -33,6 +31,6 @@ int main(int argc, const char ** argv) return -1; } - seqan3::debug_stream << "filename given by user passed validation: " << myfile << "\n"; + std::cerr << "filename given by user passed validation: " << myfile << "\n"; return 0; } diff --git a/test/snippet/validators_output_file_ext_from_file.cpp b/test/snippet/validators_output_file_ext_from_file.cpp index ea632dbd..8553669e 100644 --- a/test/snippet/validators_output_file_ext_from_file.cpp +++ b/test/snippet/validators_output_file_ext_from_file.cpp @@ -1,24 +1,24 @@ -#include -#include #include +#include + int main() { // Default constructed validator has an empty extension list. sharg::output_file_validator validator1{sharg::output_file_open_options::create_new}; - seqan3::debug_stream << validator1.get_help_page_message() << '\n'; + std::cerr << validator1.get_help_page_message() << '\n'; // Specify your own extensions for the output file. sharg::output_file_validator validator2{sharg::output_file_open_options::create_new, std::vector{std::string{"exe"}, std::string{"fasta"}}}; - seqan3::debug_stream << validator2.get_help_page_message() << '\n'; + std::cerr << validator2.get_help_page_message() << '\n'; // Give the seqan3 file type as a template argument to get all valid extensions for this file. sharg::output_file_validator> validator3 { sharg::output_file_open_options::create_new }; - seqan3::debug_stream << validator3.get_help_page_message() << '\n'; + std::cerr << validator3.get_help_page_message() << '\n'; return 0; } From 429534645592bd7d1908eca485bce2e3f4a663d0 Mon Sep 17 00:00:00 2001 From: Enrico Seiler Date: Fri, 3 Dec 2021 12:10:44 +0100 Subject: [PATCH 05/12] [MISC] Simplify includes in test/unit removed unnecessary includes, sorted headers --- test/snippet/custom_argument_parsing_enumeration.cpp | 1 - test/unit/detail/format_help_test.cpp | 4 ---- test/unit/detail/format_html_test.cpp | 2 -- test/unit/detail/format_man_test.cpp | 4 ---- test/unit/detail/version_check_debug_test.cpp | 2 -- test/unit/detail/version_check_release_test.cpp | 2 -- test/unit/detail/version_check_test.hpp | 6 +----- test/unit/format_parse_validators_test.cpp | 7 ++----- 8 files changed, 3 insertions(+), 25 deletions(-) diff --git a/test/snippet/custom_argument_parsing_enumeration.cpp b/test/snippet/custom_argument_parsing_enumeration.cpp index 839b264a..eed18d28 100644 --- a/test/snippet/custom_argument_parsing_enumeration.cpp +++ b/test/snippet/custom_argument_parsing_enumeration.cpp @@ -1,7 +1,6 @@ #include #include -#include namespace sharg::custom { diff --git a/test/unit/detail/format_help_test.cpp b/test/unit/detail/format_help_test.cpp index 66d257ed..8f8cda1d 100644 --- a/test/unit/detail/format_help_test.cpp +++ b/test/unit/detail/format_help_test.cpp @@ -5,13 +5,9 @@ // shipped with this file and also available at: https://github.com/seqan/sharg-parser/blob/master/LICENSE.md // ----------------------------------------------------------------------------------------------------------- -#include -#include - #include #include -#include // reused global variables std::string std_cout; diff --git a/test/unit/detail/format_html_test.cpp b/test/unit/detail/format_html_test.cpp index e7030c7b..13170e44 100644 --- a/test/unit/detail/format_html_test.cpp +++ b/test/unit/detail/format_html_test.cpp @@ -8,8 +8,6 @@ #include #include -#include -#include TEST(html_format, empty_information) { diff --git a/test/unit/detail/format_man_test.cpp b/test/unit/detail/format_man_test.cpp index 139195ef..a8762b16 100644 --- a/test/unit/detail/format_man_test.cpp +++ b/test/unit/detail/format_man_test.cpp @@ -5,13 +5,9 @@ // shipped with this file and also available at: https://github.com/seqan/sharg-parser/blob/master/LICENSE.md // ----------------------------------------------------------------------------------------------------------- -#include -#include - #include #include -#include // Reused global variables struct format_man_test : public ::testing::Test diff --git a/test/unit/detail/version_check_debug_test.cpp b/test/unit/detail/version_check_debug_test.cpp index 8d965db4..adb09526 100644 --- a/test/unit/detail/version_check_debug_test.cpp +++ b/test/unit/detail/version_check_debug_test.cpp @@ -9,6 +9,4 @@ #undef NDEBUG // test in debug mode #endif -#include - #include "version_check_test.hpp" diff --git a/test/unit/detail/version_check_release_test.cpp b/test/unit/detail/version_check_release_test.cpp index 53bf0386..496193e9 100644 --- a/test/unit/detail/version_check_release_test.cpp +++ b/test/unit/detail/version_check_release_test.cpp @@ -9,6 +9,4 @@ #define NDEBUG // test in release mode #endif -#include - #include "version_check_test.hpp" diff --git a/test/unit/detail/version_check_test.hpp b/test/unit/detail/version_check_test.hpp index 131addb7..355b7e0c 100644 --- a/test/unit/detail/version_check_test.hpp +++ b/test/unit/detail/version_check_test.hpp @@ -7,13 +7,9 @@ #include -#include -#include -#include -#include +#include #include -#include //------------------------------------------------------------------------------ // test fixtures diff --git a/test/unit/format_parse_validators_test.cpp b/test/unit/format_parse_validators_test.cpp index e9a28e36..b1016f72 100644 --- a/test/unit/format_parse_validators_test.cpp +++ b/test/unit/format_parse_validators_test.cpp @@ -7,14 +7,11 @@ #include -#include -#include -#include - -#include #include #include +#include + struct dummy_file { From 0f11f6576307a74cf6e5bb8f842038ad8183645f Mon Sep 17 00:00:00 2001 From: Enrico Seiler Date: Fri, 3 Dec 2021 12:28:28 +0100 Subject: [PATCH 06/12] [MISC] Simplify includes in doc removed unnecessary includes, replaced debug_stream --- doc/cookbook/basic_arg_parse.cpp | 5 ++--- .../subcommand_arg_parse.cpp | 14 ++++++++------ .../argument_parser/basic_parser_setup.cpp | 3 +-- .../argument_parser/small_snippets.cpp | 1 - doc/tutorial/argument_parser/solution1.cpp | 1 - doc/tutorial/argument_parser/solution3.cpp | 18 ++++++------------ doc/tutorial/argument_parser/solution4.cpp | 18 ++++++------------ doc/tutorial/argument_parser/solution5.cpp | 18 ++++++------------ doc/tutorial/argument_parser/solution6.cpp | 18 ++++++------------ 9 files changed, 35 insertions(+), 61 deletions(-) diff --git a/doc/cookbook/basic_arg_parse.cpp b/doc/cookbook/basic_arg_parse.cpp index 3705c105..fc51d6d1 100644 --- a/doc/cookbook/basic_arg_parse.cpp +++ b/doc/cookbook/basic_arg_parse.cpp @@ -1,11 +1,10 @@ #include -#include void run_program(std::filesystem::path const & reference_path, std::filesystem::path const & index_path) { - seqan3::debug_stream << "reference_file_path: " << reference_path << '\n'; - seqan3::debug_stream << "index_path " << index_path << '\n'; + std::cerr << "reference_file_path: " << reference_path << '\n'; + std::cerr << "index_path " << index_path << '\n'; } struct cmd_arguments diff --git a/doc/howto/subcommand_argument_parser/subcommand_arg_parse.cpp b/doc/howto/subcommand_argument_parser/subcommand_arg_parse.cpp index db3c0eeb..46b1da1a 100644 --- a/doc/howto/subcommand_argument_parser/subcommand_arg_parse.cpp +++ b/doc/howto/subcommand_argument_parser/subcommand_arg_parse.cpp @@ -1,5 +1,4 @@ #include -#include // ===================================================================================================================== // pull @@ -25,11 +24,11 @@ int run_git_pull(sharg::argument_parser & parser) } catch (sharg::argument_parser_error const & ext) { - seqan3::debug_stream << "[Error git pull] " << ext.what() << "\n"; + std::cerr << "[Error git pull] " << ext.what() << "\n"; return -1; } - seqan3::debug_stream << "Git pull with repository " << args.repository << " and branch " << args.branch << '\n'; + std::cerr << "Git pull with repository " << args.repository << " and branch " << args.branch << '\n'; return 0; } @@ -58,11 +57,14 @@ int run_git_push(sharg::argument_parser & parser) } catch (sharg::argument_parser_error const & ext) { - seqan3::debug_stream << "[Error git push] " << ext.what() << "\n"; + std::cerr << "[Error git push] " << ext.what() << "\n"; return -1; } - seqan3::debug_stream << "Git push with repository " << args.repository << " and branches " << args.branches << '\n'; + std::cerr << "Git push with repository " << args.repository << " and branches "; + for (auto && branch : args.branches) + std::cerr << branch << ' '; + std::cerr << '\n'; return 0; } @@ -93,7 +95,7 @@ int main(int argc, char const ** argv) } catch (sharg::argument_parser_error const & ext) // catch user errors { - seqan3::debug_stream << "[Error] " << ext.what() << "\n"; // customise your error message + std::cerr << "[Error] " << ext.what() << "\n"; // customise your error message return -1; } diff --git a/doc/tutorial/argument_parser/basic_parser_setup.cpp b/doc/tutorial/argument_parser/basic_parser_setup.cpp index 62f1f303..a8d0277b 100644 --- a/doc/tutorial/argument_parser/basic_parser_setup.cpp +++ b/doc/tutorial/argument_parser/basic_parser_setup.cpp @@ -1,5 +1,4 @@ #include // includes all necessary headers -#include // our custom output stream int main(int argc, char ** argv) { @@ -13,7 +12,7 @@ int main(int argc, char ** argv) } catch (sharg::argument_parser_error const & ext) // catch user errors { - seqan3::debug_stream << "[Winter has come] " << ext.what() << "\n"; // customise your error message + std::cerr << "[Winter has come] " << ext.what() << "\n"; // customise your error message return -1; } } diff --git a/doc/tutorial/argument_parser/small_snippets.cpp b/doc/tutorial/argument_parser/small_snippets.cpp index b9db0e6b..cf96c61a 100644 --- a/doc/tutorial/argument_parser/small_snippets.cpp +++ b/doc/tutorial/argument_parser/small_snippets.cpp @@ -1,5 +1,4 @@ #include -#include //![validator_include] #include diff --git a/doc/tutorial/argument_parser/solution1.cpp b/doc/tutorial/argument_parser/solution1.cpp index d5e1b62b..fd754c33 100644 --- a/doc/tutorial/argument_parser/solution1.cpp +++ b/doc/tutorial/argument_parser/solution1.cpp @@ -1,5 +1,4 @@ #include // includes all necessary headers -#include // our custom output stream void initialise_argument_parser(sharg::argument_parser & parser) { diff --git a/doc/tutorial/argument_parser/solution3.cpp b/doc/tutorial/argument_parser/solution3.cpp index 5e589df1..4f752988 100644 --- a/doc/tutorial/argument_parser/solution3.cpp +++ b/doc/tutorial/argument_parser/solution3.cpp @@ -1,11 +1,5 @@ //![program] -#include // includes std::from_chars -#include // use std::filesystem::path -#include -#include - #include // includes all necessary headers -#include // our custom output stream // This is the program! // Take a look at it if you are interested in an example of parsing a data file. @@ -20,7 +14,7 @@ number_type to_number(range_type && range) if (res.ec != std::errc{}) { - seqan3::debug_stream << "Could not cast '" << range << "' to a valid number\n"; + std::cerr << "Could not cast '" << str << "' to a valid number\n"; throw std::invalid_argument{"CAST ERROR"}; } return num; @@ -48,16 +42,16 @@ void run_program(std::filesystem::path & path, uint32_t yr, std::string & aggr_b } if (aggr_by == "median") - seqan3::debug_stream << ([&v] () { std::sort(v.begin(), v.end()); return v[v.size()/2]; })() << '\n'; + std::cerr << ([&v] () { std::sort(v.begin(), v.end()); return v[v.size()/2]; })() << '\n'; else if (aggr_by == "mean") - seqan3::debug_stream << ([&v] () { double sum{}; for (auto i : v) sum += i; return sum / v.size(); })() + std::cerr << ([&v] () { double sum{}; for (auto i : v) sum += i; return sum / v.size(); })() << '\n'; else - seqan3::debug_stream << "I do not know the aggregation method " << aggr_by << '\n'; + std::cerr << "I do not know the aggregation method " << aggr_by << '\n'; } else { - seqan3::debug_stream << "Error: Cannot open file for reading.\n"; + std::cerr << "Error: Cannot open file for reading.\n"; } } // ----------------------------------------------------------------------------- @@ -102,7 +96,7 @@ int main(int argc, char ** argv) } catch (sharg::argument_parser_error const & ext) // catch user errors { - seqan3::debug_stream << "[Winter has come] " << ext.what() << "\n"; // customise your error message + std::cerr << "[Winter has come] " << ext.what() << "\n"; // customise your error message return -1; } diff --git a/doc/tutorial/argument_parser/solution4.cpp b/doc/tutorial/argument_parser/solution4.cpp index ba8d79e9..770e4be9 100644 --- a/doc/tutorial/argument_parser/solution4.cpp +++ b/doc/tutorial/argument_parser/solution4.cpp @@ -1,10 +1,4 @@ -#include -#include - #include // includes all necessary headers -#include // our custom output stream -#include // includes std::from_chars -#include // use std::filesystem::path // This is the program! // Take a look at it if you are interested in an example of parsing a data file. @@ -19,7 +13,7 @@ number_type to_number(range_type && range) if (res.ec != std::errc{}) { - seqan3::debug_stream << "Could not cast '" << range << "' to a valid number\n"; + std::cerr << "Could not cast '" << str << "' to a valid number\n"; throw std::invalid_argument{"CAST ERROR"}; } return num; @@ -49,16 +43,16 @@ void run_program(std::filesystem::path & path, std::vector sn, std::str //![altered_while] if (aggr_by == "median") - seqan3::debug_stream << ([&v] () { std::sort(v.begin(), v.end()); return v[v.size()/2]; })() << '\n'; + std::cerr << ([&v] () { std::sort(v.begin(), v.end()); return v[v.size()/2]; })() << '\n'; else if (aggr_by == "mean") - seqan3::debug_stream << ([&v] () { double sum{}; for (auto i : v) sum += i; return sum / v.size(); })() + std::cerr << ([&v] () { double sum{}; for (auto i : v) sum += i; return sum / v.size(); })() << '\n'; else - seqan3::debug_stream << "I do not know the aggregation method " << aggr_by << '\n'; + std::cerr << "I do not know the aggregation method " << aggr_by << '\n'; } else { - seqan3::debug_stream << "Error: Cannot open file for reading.\n"; + std::cerr << "Error: Cannot open file for reading.\n"; } } // ----------------------------------------------------------------------------- @@ -102,7 +96,7 @@ int main(int argc, char ** argv) } catch (sharg::argument_parser_error const & ext) // catch user errors { - seqan3::debug_stream << "[Winter has come] " << ext.what() << "\n"; // customise your error message + std::cerr << "[Winter has come] " << ext.what() << "\n"; // customise your error message return -1; } diff --git a/doc/tutorial/argument_parser/solution5.cpp b/doc/tutorial/argument_parser/solution5.cpp index 5fea4677..27af61e0 100644 --- a/doc/tutorial/argument_parser/solution5.cpp +++ b/doc/tutorial/argument_parser/solution5.cpp @@ -1,10 +1,4 @@ -#include -#include - #include // includes all necessary headers -#include // our custom output stream -#include // includes std::from_chars -#include // use std::filesystem::path // This is the program! // Take a look at it if you are interested in an example of parsing a data file. @@ -19,7 +13,7 @@ number_type to_number(range_type && range) if (res.ec != std::errc{}) { - seqan3::debug_stream << "Could not cast '" << range << "' to a valid number\n"; + std::cerr << "Could not cast '" << str << "' to a valid number\n"; throw std::invalid_argument{"CAST ERROR"}; } return num; @@ -47,16 +41,16 @@ void run_program(std::filesystem::path & path, std::vector sn, std::str } if (aggr_by == "median") - seqan3::debug_stream << ([&v] () { std::sort(v.begin(), v.end()); return v[v.size()/2]; })() << '\n'; + std::cerr << ([&v] () { std::sort(v.begin(), v.end()); return v[v.size()/2]; })() << '\n'; else if (aggr_by == "mean") - seqan3::debug_stream << ([&v] () { double sum{}; for (auto i : v) sum += i; return sum / v.size(); })() + std::cerr << ([&v] () { double sum{}; for (auto i : v) sum += i; return sum / v.size(); })() << '\n'; else - seqan3::debug_stream << "I do not know the aggregation method " << aggr_by << '\n'; + std::cerr << "I do not know the aggregation method " << aggr_by << '\n'; } else { - seqan3::debug_stream << "Error: Cannot open file for reading.\n"; + std::cerr << "Error: Cannot open file for reading.\n"; } } // ----------------------------------------------------------------------------- @@ -100,7 +94,7 @@ int main(int argc, char ** argv) } catch (sharg::argument_parser_error const & ext) // catch user errors { - seqan3::debug_stream << "[Winter has come] " << ext.what() << "\n"; // customise your error message + std::cerr << "[Winter has come] " << ext.what() << "\n"; // customise your error message return -1; } diff --git a/doc/tutorial/argument_parser/solution6.cpp b/doc/tutorial/argument_parser/solution6.cpp index b9a0e51d..130e06af 100644 --- a/doc/tutorial/argument_parser/solution6.cpp +++ b/doc/tutorial/argument_parser/solution6.cpp @@ -1,10 +1,4 @@ -#include -#include - #include // includes all necessary headers -#include // our custom output stream -#include // includes std::from_chars -#include // use std::filesystem::path // This is the program! // Take a look at it if you are interested in an example of parsing a data file. @@ -19,7 +13,7 @@ number_type to_number(range_type && range) if (res.ec != std::errc{}) { - seqan3::debug_stream << "Could not cast '" << range << "' to a valid number\n"; + std::cerr << "Could not cast '" << str << "' to a valid number\n"; throw std::invalid_argument{"CAST ERROR"}; } return num; @@ -47,16 +41,16 @@ void run_program(std::filesystem::path & path, std::vector sn, std::str } if (aggr_by == "median") - seqan3::debug_stream << ([&v] () { std::sort(v.begin(), v.end()); return v[v.size()/2]; })() << '\n'; + std::cerr << ([&v] () { std::sort(v.begin(), v.end()); return v[v.size()/2]; })() << '\n'; else if (aggr_by == "mean") - seqan3::debug_stream << ([&v] () { double sum{}; for (auto i : v) sum += i; return sum / v.size(); })() + std::cerr << ([&v] () { double sum{}; for (auto i : v) sum += i; return sum / v.size(); })() << '\n'; else - seqan3::debug_stream << "I do not know the aggregation method " << aggr_by << '\n'; + std::cerr << "I do not know the aggregation method " << aggr_by << '\n'; } else { - seqan3::debug_stream << "Error: Cannot open file for reading.\n"; + std::cerr << "Error: Cannot open file for reading.\n"; } } // ----------------------------------------------------------------------------- @@ -107,7 +101,7 @@ int main(int argc, char ** argv) } catch (sharg::argument_parser_error const & ext) // catch user errors { - seqan3::debug_stream << "[Winter has come] " << ext.what() << "\n"; // customise your error message + std::cerr << "[Winter has come] " << ext.what() << "\n"; // customise your error message return -1; } From 7c13d66a33745d0643dd8bdc1b6f5c60afc4353b Mon Sep 17 00:00:00 2001 From: Enrico Seiler Date: Fri, 3 Dec 2021 14:03:19 +0100 Subject: [PATCH 07/12] [INFRA] Add header test --- test/header/CMakeLists.txt | 84 ++++++++++++++++++++++++ test/header/generate_header_source.cmake | 65 ++++++++++++++++++ 2 files changed, 149 insertions(+) create mode 100644 test/header/CMakeLists.txt create mode 100644 test/header/generate_header_source.cmake diff --git a/test/header/CMakeLists.txt b/test/header/CMakeLists.txt new file mode 100644 index 00000000..ddcddf34 --- /dev/null +++ b/test/header/CMakeLists.txt @@ -0,0 +1,84 @@ +# ----------------------------------------------------------------------------------------------------------- +# Copyright (c) 2006-2021, Knut Reinert & Freie Universität Berlin +# Copyright (c) 2016-2021, Knut Reinert & MPI für molekulare Genetik +# This file may be used, modified and/or redistributed under the terms of the 3-clause BSD-License +# shipped with this file and also available at: https://github.com/seqan/sharg-parser/blob/master/LICENSE.md +# ----------------------------------------------------------------------------------------------------------- + +cmake_minimum_required (VERSION 3.10) +project (sharg_header_test CXX) + +find_package (SHARG REQUIRED HINTS ${CMAKE_CURRENT_LIST_DIR}/../../build_system) + +include (${CMAKE_CURRENT_LIST_DIR}/../../lib/seqan3/test/seqan3-test.cmake) + +macro (sharg_header_test component header_base_path exclude_regex) + set (target "${component}_header_test") + + seqan3_test_files (header_files "${header_base_path}" "*.hpp;*.h") + + if (NOT ";${exclude_regex};" STREQUAL ";;") + list (FILTER header_files EXCLUDE REGEX "${exclude_regex}") + endif() + + file (WRITE "${PROJECT_BINARY_DIR}/${target}.cpp" "") + add_executable (${target} ${PROJECT_BINARY_DIR}/${target}.cpp) + target_link_libraries (${target} seqan3::test::header sharg::sharg) + add_test (NAME "header/${target}" COMMAND ${target}) + + foreach (header ${header_files}) + seqan3_test_component (header_test_name "${header}" TEST_NAME) + seqan3_test_component (header_target_name "${header}" TARGET_UNIQUE_NAME) + + foreach (header_sub_test "header-guard" "no-self-include") + set (header_target_source "${PROJECT_BINARY_DIR}/${target}_files/${header_test_name}.hpp-${header_sub_test}.cpp") + set (header_target "${target}--${header_target_name}-${header_sub_test}") + + string (REPLACE "-" "__" header_test_name_safe "${target}, ${header_target}") + + add_custom_command (OUTPUT "${header_target_source}" + COMMAND "${CMAKE_COMMAND}" + "-DHEADER_FILE_ABSOLUTE=${header_base_path}/${header}" + "-DHEADER_FILE_INCLUDE=${header}" + "-DHEADER_TARGET_SOURCE=${header_target_source}" + "-DHEADER_TEST_NAME_SAFE=${header_test_name_safe}" + "-DHEADER_COMPONENT=${component}" + "-DHEADER_SUB_TEST=${header_sub_test}" + "-P" + "${CMAKE_CURRENT_SOURCE_DIR}/generate_header_source.cmake" + DEPENDS "${header_base_path}/${header}" + "${CMAKE_CURRENT_SOURCE_DIR}/generate_header_source.cmake") + add_library (${header_target} OBJECT "${header_target_source}") + + if (CMAKE_VERSION VERSION_LESS 3.12) + target_compile_options (${header_target} PRIVATE $) + target_compile_definitions (${header_target} PRIVATE $) + target_include_directories (${header_target} PRIVATE $) + target_include_directories (${header_target} SYSTEM PRIVATE $) + target_compile_options (${header_target} PRIVATE $) + target_compile_definitions (${header_target} PRIVATE $) + target_include_directories (${header_target} PRIVATE $) + target_include_directories (${header_target} SYSTEM PRIVATE $) + add_dependencies (${header_target} gtest gbenchmark) + else () + target_link_libraries (${header_target} seqan3::test::header sharg::sharg) + endif () + + target_sources (${target} PRIVATE $) + endforeach () + endforeach () + + unset (target) + unset (header_files) + unset (header_test_name) + unset (header_test_name_safe) + unset (header_target_name) + unset (header_target_source) + unset (header_target) +endmacro () + +seqan3_require_ccache () +seqan3_require_benchmark () +seqan3_require_test () + +sharg_header_test (sharg "${SHARG_INCLUDE_DIR}" "") diff --git a/test/header/generate_header_source.cmake b/test/header/generate_header_source.cmake new file mode 100644 index 00000000..6d89561d --- /dev/null +++ b/test/header/generate_header_source.cmake @@ -0,0 +1,65 @@ +cmake_minimum_required (VERSION 3.10) + +option (HEADER_FILE_ABSOLUTE "") +option (HEADER_FILE_INCLUDE "") +option (HEADER_TARGET_SOURCE "") +option (HEADER_TEST_NAME_SAFE "") +option (HEADER_COMPONENT "") +option (HEADER_SUB_TEST "") + +file (WRITE "${HEADER_TARGET_SOURCE}" "") # write empty file + +if (HEADER_SUB_TEST STREQUAL "no-self-include") + # this test ensures that a header will not be included by itself later + file (READ "${HEADER_FILE_ABSOLUTE}" header_content) + + string (REPLACE "#pragma once" "" header_content "${header_content}") + + file (APPEND "${HEADER_TARGET_SOURCE}" "${header_content}") +else () + # this test ensures that a header guard is in place + file (APPEND "${HEADER_TARGET_SOURCE}" " +#include <${HEADER_FILE_INCLUDE}> +#include <${HEADER_FILE_INCLUDE}>") +endif() + +# these includes are required by some headers (note that they follow) +file (APPEND "${HEADER_TARGET_SOURCE}" " +#include +#include +TEST(${HEADER_TEST_NAME_SAFE}) {}") + +# test that sharg headers include platform.hpp +if ("${HEADER_COMPONENT}" MATCHES "sharg") + + # exclude sharg/std/*, sharg/contrib/*, and sharg/version.hpp from platform test + if (NOT HEADER_FILE_INCLUDE MATCHES "sharg/(std/|contrib/|version.hpp)") + file (APPEND "${HEADER_TARGET_SOURCE}" " +#ifndef SHARG_DOXYGEN_ONLY +#error \"Your header '${HEADER_FILE_INCLUDE}' file is missing #include \" +#endif") + endif () + + # sharg/std/* must not include platform.hpp (and therefore any other sharg header) + # See https://github.com/seqan/product_backlog/issues/135 + if (HEADER_FILE_INCLUDE MATCHES "sharg/std/") + file (APPEND "${HEADER_TARGET_SOURCE}" " +#ifdef SHARG_DOXYGEN_ONLY +#error \"The standard header '${HEADER_FILE_INCLUDE}' file MUST NOT include any other sharg header (except for sharg/contrib)\" +#endif") + endif () + + # test whether sharg has the visibility bug on lower gcc versions + # https://github.com/seqan/seqan3/issues/1317 + if (NOT HEADER_FILE_INCLUDE MATCHES "sharg/version.hpp") + file (APPEND "${HEADER_TARGET_SOURCE}" " +#include +class A{ int i{5}; }; + +template +concept private_bug = requires(t a){a.i;}; + +static_assert(!private_bug, \"See https://github.com/seqan/seqan3/issues/1317\");") + endif () + +endif () From ada95db807f4d0f61ff275c988bb382063ac1edc Mon Sep 17 00:00:00 2001 From: Enrico Seiler Date: Fri, 3 Dec 2021 14:04:20 +0100 Subject: [PATCH 08/12] [MISC] Add missing platform include --- include/sharg/auxiliary.hpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/sharg/auxiliary.hpp b/include/sharg/auxiliary.hpp index 82b9242b..22b23f2f 100644 --- a/include/sharg/auxiliary.hpp +++ b/include/sharg/auxiliary.hpp @@ -22,6 +22,8 @@ #include #include +#include + namespace sharg::custom { From f8c4fb98c61930ce5cda699f92ebd7d53d609e05 Mon Sep 17 00:00:00 2001 From: Enrico Seiler Date: Fri, 3 Dec 2021 14:19:33 +0100 Subject: [PATCH 09/12] [MISC] minimize stl includes --- include/sharg/argument_parser.hpp | 7 ------- include/sharg/auxiliary.hpp | 1 - include/sharg/detail/format_base.hpp | 6 ------ include/sharg/detail/format_help.hpp | 3 --- include/sharg/detail/format_html.hpp | 2 -- include/sharg/detail/format_man.hpp | 2 -- include/sharg/detail/format_parse.hpp | 4 ---- include/sharg/detail/version_check.hpp | 3 --- include/sharg/platform.hpp | 4 ---- include/sharg/validators.hpp | 2 -- include/sharg/version.hpp | 1 - 11 files changed, 35 deletions(-) diff --git a/include/sharg/argument_parser.hpp b/include/sharg/argument_parser.hpp index d30f1e3b..6344fbbb 100644 --- a/include/sharg/argument_parser.hpp +++ b/include/sharg/argument_parser.hpp @@ -12,14 +12,7 @@ #pragma once -#include -#include #include -#include -#include -#include -#include -#include #include #include diff --git a/include/sharg/auxiliary.hpp b/include/sharg/auxiliary.hpp index 22b23f2f..09da5463 100644 --- a/include/sharg/auxiliary.hpp +++ b/include/sharg/auxiliary.hpp @@ -12,7 +12,6 @@ #pragma once -#include #include #include diff --git a/include/sharg/detail/format_base.hpp b/include/sharg/detail/format_base.hpp index 281d067b..b0b3ecb9 100644 --- a/include/sharg/detail/format_base.hpp +++ b/include/sharg/detail/format_base.hpp @@ -13,12 +13,6 @@ #pragma once -#include -#include -#include -#include -#include - #include #include diff --git a/include/sharg/detail/format_help.hpp b/include/sharg/detail/format_help.hpp index 95ea578b..3c53732b 100644 --- a/include/sharg/detail/format_help.hpp +++ b/include/sharg/detail/format_help.hpp @@ -14,9 +14,6 @@ #pragma once -#include -#include - #include #include diff --git a/include/sharg/detail/format_html.hpp b/include/sharg/detail/format_html.hpp index 0523c8c5..323f6600 100644 --- a/include/sharg/detail/format_html.hpp +++ b/include/sharg/detail/format_html.hpp @@ -12,8 +12,6 @@ #pragma once -#include - #include #include #include diff --git a/include/sharg/detail/format_man.hpp b/include/sharg/detail/format_man.hpp index 087ded46..79d0a678 100644 --- a/include/sharg/detail/format_man.hpp +++ b/include/sharg/detail/format_man.hpp @@ -12,8 +12,6 @@ #pragma once -#include - #include #include #include diff --git a/include/sharg/detail/format_parse.hpp b/include/sharg/detail/format_parse.hpp index d40a697a..7ba2847a 100644 --- a/include/sharg/detail/format_parse.hpp +++ b/include/sharg/detail/format_parse.hpp @@ -12,10 +12,6 @@ #pragma once -#include -#include -#include - #include #include #include diff --git a/include/sharg/detail/version_check.hpp b/include/sharg/detail/version_check.hpp index 1ca67959..37e6bd5e 100644 --- a/include/sharg/detail/version_check.hpp +++ b/include/sharg/detail/version_check.hpp @@ -12,9 +12,6 @@ #pragma once -#include - -#include #include #include #include diff --git a/include/sharg/platform.hpp b/include/sharg/platform.hpp index 074e4952..89a97e5c 100644 --- a/include/sharg/platform.hpp +++ b/include/sharg/platform.hpp @@ -7,10 +7,6 @@ #pragma once -#include -#include // makes _LIBCPP_VERSION available -#include // makes __GLIBCXX__ available - /*!\file * \brief Provides platform and dependency checks. * \author Svenja Mehringer diff --git a/include/sharg/validators.hpp b/include/sharg/validators.hpp index 7a81847f..d745d2a2 100644 --- a/include/sharg/validators.hpp +++ b/include/sharg/validators.hpp @@ -12,10 +12,8 @@ #pragma once -#include #include #include -#include #include #include diff --git a/include/sharg/version.hpp b/include/sharg/version.hpp index 77386ab8..4705e0fe 100644 --- a/include/sharg/version.hpp +++ b/include/sharg/version.hpp @@ -7,7 +7,6 @@ #pragma once -#include #include /*!\file From ce80f173be22bedff3d3df6808d1633486741c37 Mon Sep 17 00:00:00 2001 From: Enrico Seiler Date: Fri, 3 Dec 2021 14:36:48 +0100 Subject: [PATCH 10/12] [MISC] minimize seqan3 includes --- include/sharg/argument_parser.hpp | 1 - include/sharg/auxiliary.hpp | 2 -- include/sharg/detail/concept.hpp | 3 --- include/sharg/detail/format_base.hpp | 1 + include/sharg/detail/format_help.hpp | 9 +++++++-- include/sharg/detail/format_parse.hpp | 1 - include/sharg/validators.hpp | 4 ---- 7 files changed, 8 insertions(+), 13 deletions(-) diff --git a/include/sharg/argument_parser.hpp b/include/sharg/argument_parser.hpp index 6344fbbb..214836fb 100644 --- a/include/sharg/argument_parser.hpp +++ b/include/sharg/argument_parser.hpp @@ -15,7 +15,6 @@ #include #include -#include #include #include diff --git a/include/sharg/auxiliary.hpp b/include/sharg/auxiliary.hpp index 09da5463..69f67fb6 100644 --- a/include/sharg/auxiliary.hpp +++ b/include/sharg/auxiliary.hpp @@ -18,8 +18,6 @@ #include #include #include -#include -#include #include diff --git a/include/sharg/detail/concept.hpp b/include/sharg/detail/concept.hpp index 1de91219..b515fcd6 100644 --- a/include/sharg/detail/concept.hpp +++ b/include/sharg/detail/concept.hpp @@ -14,9 +14,6 @@ #include -#include -#include - #include namespace sharg::detail diff --git a/include/sharg/detail/format_base.hpp b/include/sharg/detail/format_base.hpp index b0b3ecb9..7f9981dc 100644 --- a/include/sharg/detail/format_base.hpp +++ b/include/sharg/detail/format_base.hpp @@ -14,6 +14,7 @@ #pragma once #include +#include #include #include diff --git a/include/sharg/detail/format_help.hpp b/include/sharg/detail/format_help.hpp index 3c53732b..0726c477 100644 --- a/include/sharg/detail/format_help.hpp +++ b/include/sharg/detail/format_help.hpp @@ -14,11 +14,16 @@ #pragma once -#include - #include #include +namespace seqan3::detail +{ + +struct test_accessor; + +} // seqan3::detail + namespace sharg::detail { diff --git a/include/sharg/detail/format_parse.hpp b/include/sharg/detail/format_parse.hpp index 7ba2847a..af7fe10d 100644 --- a/include/sharg/detail/format_parse.hpp +++ b/include/sharg/detail/format_parse.hpp @@ -13,7 +13,6 @@ #pragma once #include -#include #include #include diff --git a/include/sharg/validators.hpp b/include/sharg/validators.hpp index d745d2a2..ee8f1b69 100644 --- a/include/sharg/validators.hpp +++ b/include/sharg/validators.hpp @@ -19,10 +19,6 @@ #include #include #include -#include -#include -#include -#include #include #include From 622a14d0d535dddf6ac5923e2005914eb2cd26ab Mon Sep 17 00:00:00 2001 From: Enrico Seiler Date: Fri, 3 Dec 2021 14:43:23 +0100 Subject: [PATCH 11/12] [MISC] minimize sharg includes --- include/sharg/argument_parser.hpp | 1 - include/sharg/detail/format_base.hpp | 2 -- include/sharg/detail/format_html.hpp | 2 -- include/sharg/detail/format_man.hpp | 2 -- include/sharg/detail/version_check.hpp | 1 - 5 files changed, 8 deletions(-) diff --git a/include/sharg/argument_parser.hpp b/include/sharg/argument_parser.hpp index 214836fb..659f0a22 100644 --- a/include/sharg/argument_parser.hpp +++ b/include/sharg/argument_parser.hpp @@ -20,7 +20,6 @@ #include #include #include -#include #include namespace sharg diff --git a/include/sharg/detail/format_base.hpp b/include/sharg/detail/format_base.hpp index 7f9981dc..f5b88b03 100644 --- a/include/sharg/detail/format_base.hpp +++ b/include/sharg/detail/format_base.hpp @@ -18,9 +18,7 @@ #include #include -#include #include -#include namespace sharg::detail { diff --git a/include/sharg/detail/format_html.hpp b/include/sharg/detail/format_html.hpp index 323f6600..284afb9f 100644 --- a/include/sharg/detail/format_html.hpp +++ b/include/sharg/detail/format_html.hpp @@ -13,8 +13,6 @@ #pragma once #include -#include -#include namespace sharg::detail { diff --git a/include/sharg/detail/format_man.hpp b/include/sharg/detail/format_man.hpp index 79d0a678..a709eef6 100644 --- a/include/sharg/detail/format_man.hpp +++ b/include/sharg/detail/format_man.hpp @@ -13,8 +13,6 @@ #pragma once #include -#include -#include namespace sharg::detail { diff --git a/include/sharg/detail/version_check.hpp b/include/sharg/detail/version_check.hpp index 37e6bd5e..154de474 100644 --- a/include/sharg/detail/version_check.hpp +++ b/include/sharg/detail/version_check.hpp @@ -23,7 +23,6 @@ #include #include -#include namespace sharg::detail { From e5df0eba2fd09b18e78aafeba591b130482f7eeb Mon Sep 17 00:00:00 2001 From: Enrico Seiler Date: Fri, 3 Dec 2021 14:51:11 +0100 Subject: [PATCH 12/12] [INFRA] Add header test CI --- .github/workflows/ci_misc.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/.github/workflows/ci_misc.yml b/.github/workflows/ci_misc.yml index 26e5e133..f6199d27 100644 --- a/.github/workflows/ci_misc.yml +++ b/.github/workflows/ci_misc.yml @@ -42,6 +42,33 @@ jobs: skip_build_tests: false skip_run_tests: false + - name: "Header gcc11" + cxx: "g++-11" + cc: "gcc-11" + build: header + build_type: Debug + build_threads: 2 + test_threads: 2 + cmake: 3.10.3 + requires_toolchain: true + requires_ccache: true + skip_build_tests: false + skip_run_tests: false + + - name: "Header gcc9" + cxx: "g++-9" + cc: "gcc-9" + build: header + build_type: Debug + build_threads: 2 + test_threads: 2 + cxx_flags: "-std=c++2a" + cmake: 3.10.3 + requires_toolchain: true + requires_ccache: true + skip_build_tests: false + skip_run_tests: false + - name: "Documentation" build: documentation build_threads: 2 @@ -127,6 +154,7 @@ jobs: -DSHARG_VERBOSE_TESTS=OFF case "${{ matrix.build }}" in snippet) make -j${{ matrix.build_threads }} gtest_build;; + header) make -j${{ matrix.build_threads }} gtest_build gbenchmark_build;; documentation) make -j${{ matrix.build_threads }} download-cppreference-doxygen-web-tag;; esac