generated from seqan/app-template
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
235 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
From 769620513bcc59d257119aacfa06020df7ca45a6 Mon Sep 17 00:00:00 2001 | ||
From ca8c640b31970a92080d6c36cc7623de5c6b488b Mon Sep 17 00:00:00 2001 | ||
From: Simon Gene Gottlieb <[email protected]> | ||
Date: Thu, 5 Oct 2023 13:43:30 +0200 | ||
Subject: [PATCH 1/6] [API] Update TDL | ||
Subject: [PATCH 1/8] [API] Update TDL | ||
|
||
--- | ||
test/unit/detail/format_ctd_test.cpp | 2 +- | ||
|
@@ -84,5 +84,5 @@ index d2bb143..5591a88 100644 | |
"class: CommandLineTool\n" | ||
"baseCommand:\n" | ||
-- | ||
2.43.0 | ||
2.43.2 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
From 9d8035baa8b0ff4accd6ba2e60a22f779986483d Mon Sep 17 00:00:00 2001 | ||
From 9ddea5a7db6e7436e157ed25e1cb368c3445bc84 Mon Sep 17 00:00:00 2001 | ||
From: Enrico Seiler <[email protected]> | ||
Date: Mon, 5 Feb 2024 16:02:03 +0100 | ||
Subject: [PATCH 2/6] [API] Quoted strings and paths | ||
Subject: [PATCH 2/8] [API] Quoted strings and paths | ||
|
||
--- | ||
test/snippet/readme_sneak_peek.out | 6 ++--- | ||
|
@@ -341,5 +341,5 @@ index cade0f9..ba1694d 100644 | |
+ basic_options_str + "\n" + basic_version_str; | ||
EXPECT_EQ(my_stdout, expected); | ||
-- | ||
2.43.0 | ||
2.43.2 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
From a4fffdf64380b018822b13a9ad72586f0564385f Mon Sep 17 00:00:00 2001 | ||
From 69dfcfa3a693a398200dc7cac0ec6d76b1ecb443 Mon Sep 17 00:00:00 2001 | ||
From: Enrico Seiler <[email protected]> | ||
Date: Wed, 7 Feb 2024 13:31:22 +0100 | ||
Subject: [PATCH 3/6] [NOAPI] Update copyright | ||
Subject: [PATCH 3/8] [NOAPI] Update copyright | ||
|
||
--- | ||
test/unit/detail/format_help_test.cpp | 10 +++++----- | ||
|
@@ -121,5 +121,5 @@ index 307b58b..eefffd6 100644 | |
testing::internal::CaptureStdout(); | ||
EXPECT_EXIT(parser.parse(), ::testing::ExitedWithCode(EXIT_SUCCESS), ""); | ||
-- | ||
2.43.0 | ||
2.43.2 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
From 1481f5dfdc68d2d5e04cb5abbec45fab7f15fbcd Mon Sep 17 00:00:00 2001 | ||
From 9ec785b9f7761bc020da7972a1c18b61bff53685 Mon Sep 17 00:00:00 2001 | ||
From: Enrico Seiler <[email protected]> | ||
Date: Fri, 9 Feb 2024 16:17:21 +0100 | ||
Subject: [PATCH 4/6] [INFRA] Update TDL | ||
Subject: [PATCH 4/8] [INFRA] Update TDL | ||
|
||
--- | ||
test/unit/detail/format_cwl_test.cpp | 28 +++++++++++++++++++++++++++- | ||
|
@@ -69,5 +69,5 @@ index 1d27cc3..eaf0cad 100644 | |
" path04:\n" | ||
" type: File?\n" | ||
-- | ||
2.43.0 | ||
2.43.2 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
From 085bc1fd63f3c48999610e0a9a916895a7cf9207 Mon Sep 17 00:00:00 2001 | ||
From 069d34a5d3997dfdd1b47cac24ef47931b534367 Mon Sep 17 00:00:00 2001 | ||
From: Enrico Seiler <[email protected]> | ||
Date: Fri, 9 Feb 2024 18:13:36 +0100 | ||
Subject: [PATCH 5/6] [INFRA] Use seqan3 main branch | ||
Subject: [PATCH 5/8] [INFRA] Use seqan3 main branch | ||
|
||
--- | ||
test/unit/detail/CMakeLists.txt | 2 +- | ||
|
@@ -21,5 +21,5 @@ index 392f878..1f9a8e0 100644 | |
sharg_test (seqan3_test.cpp) | ||
target_include_directories (seqan3_test SYSTEM PUBLIC ${CMAKE_BINARY_DIR}/include) | ||
-- | ||
2.43.0 | ||
2.43.2 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
From c84f8aeeba0895677c64d9740f4df908674cd0be Mon Sep 17 00:00:00 2001 | ||
From 94f4ae3d0f188ff9193e05c26b71b5ab8e5398c6 Mon Sep 17 00:00:00 2001 | ||
From: Enrico Seiler <[email protected]> | ||
Date: Wed, 14 Feb 2024 12:34:40 +0100 | ||
Subject: [PATCH 6/6] [API][FIX] positional options in CWL/CTD | ||
Subject: [PATCH 6/8] [API][FIX] positional options in CWL/CTD | ||
|
||
--- | ||
test/unit/detail/format_ctd_test.cpp | 4 ++-- | ||
|
@@ -55,5 +55,5 @@ index eaf0cad..52079db 100644 | |
" doc: \"this is a int option. Default: 5\"\n" | ||
" type: long?\n" | ||
-- | ||
2.43.0 | ||
2.43.2 | ||
|
149 changes: 149 additions & 0 deletions
149
test/api_stability/1.1.1/0007-API-MISC-Defer-everything-to-parse.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,149 @@ | ||
From 458dd383728e5fbffda9c4f3a1470b321bb75386 Mon Sep 17 00:00:00 2001 | ||
From: Enrico Seiler <[email protected]> | ||
Date: Mon, 29 Apr 2024 16:37:15 +0200 | ||
Subject: [PATCH 7/8] [API][MISC] Defer everything to parse() | ||
|
||
--- | ||
test/unit/detail/format_help_test.cpp | 2 +- | ||
test/unit/detail/format_html_test.cpp | 10 ++++-- | ||
test/unit/parser/format_parse_test.cpp | 34 ++++++++++++------- | ||
test/unit/parser/parser_design_error_test.cpp | 4 +-- | ||
4 files changed, 31 insertions(+), 19 deletions(-) | ||
|
||
diff --git a/test/unit/detail/format_help_test.cpp b/test/unit/detail/format_help_test.cpp | ||
index be31399..20f4c39 100644 | ||
--- a/test/unit/detail/format_help_test.cpp | ||
+++ b/test/unit/detail/format_help_test.cpp | ||
@@ -575,7 +575,7 @@ TEST(parse_test, subcommand_parser) | ||
" See the respective help page for further details (e.g. by calling\n" | ||
" test_parser sub1 -h).\n" | ||
"\n" | ||
- " The following options below belong to the top-level parser and need to be\n" | ||
+ " The following options belong to the top-level parser and need to be\n" | ||
" specified before the subcommand key word. Every argument after the\n" | ||
" subcommand key word is passed on to the corresponding sub-parser.\n" | ||
"\nOPTIONS\n" | ||
diff --git a/test/unit/detail/format_html_test.cpp b/test/unit/detail/format_html_test.cpp | ||
index 6fd41d1..6f485cc 100644 | ||
--- a/test/unit/detail/format_html_test.cpp | ||
+++ b/test/unit/detail/format_html_test.cpp | ||
@@ -217,11 +217,15 @@ TEST(export_help, parse_error) | ||
std::array const argv3{"./help_add_test", "--version-check", "false", "--export-help", "atml"}; | ||
|
||
// no value after --export-help | ||
- EXPECT_THROW((sharg::parser{"test_parser", argv.size(), argv.data()}), sharg::parser_error); | ||
+ auto parser = sharg::parser{"test_parser", argv.size(), argv.data()}; | ||
+ EXPECT_THROW(parser.parse(), sharg::parser_error); | ||
|
||
// wrong value after --export-help | ||
- EXPECT_THROW((sharg::parser{"test_parser", argv2.size(), argv2.data()}), sharg::validation_error); | ||
+ parser = sharg::parser{"test_parser", argv2.size(), argv2.data()}; | ||
+ EXPECT_THROW(parser.parse(), sharg::validation_error); | ||
|
||
// wrong value after --export-help | ||
- EXPECT_THROW((sharg::parser{"test_parser", argv3.size(), argv3.data()}), sharg::validation_error); | ||
+ parser = sharg::parser{"test_parser", argv3.size(), argv3.data()}; | ||
+ EXPECT_THROW(parser.parse(), sharg::validation_error); | ||
+ | ||
} | ||
diff --git a/test/unit/parser/format_parse_test.cpp b/test/unit/parser/format_parse_test.cpp | ||
index 8e5a286..f63fa61 100644 | ||
--- a/test/unit/parser/format_parse_test.cpp | ||
+++ b/test/unit/parser/format_parse_test.cpp | ||
@@ -815,12 +815,14 @@ TEST(parse_test, version_check_option_error) | ||
{ | ||
{ // version-check must be followed by a value | ||
char const * argv[] = {"./parser_test", "--version-check"}; | ||
- EXPECT_THROW((sharg::parser{"test_parser", 2, argv}), sharg::parser_error); | ||
+ auto parser = sharg::parser{"test_parser", 2, argv}; | ||
+ EXPECT_THROW(parser.parse(), sharg::parser_error); | ||
} | ||
|
||
{ // version-check value must be 0 or 1 | ||
char const * argv[] = {"./parser_test", "--version-check", "foo"}; | ||
- EXPECT_THROW((sharg::parser{"test_parser", 3, argv}), sharg::parser_error); | ||
+ auto parser = sharg::parser{"test_parser", 3, argv}; | ||
+ EXPECT_THROW(parser.parse(), sharg::parser_error); | ||
} | ||
} | ||
|
||
@@ -1107,44 +1109,50 @@ TEST(parse_test, container_default) | ||
|
||
TEST(parse_test, executable_name) | ||
{ | ||
- testing::internal::CaptureStdout(); | ||
{ | ||
- std::array argv{"parser_test"}; | ||
+ bool flag{false}; | ||
+ std::array argv{"parser_test", "-t"}; | ||
sharg::parser parser{"test_parser", argv.size(), argv.data(), sharg::update_notifications::off}; | ||
- EXPECT_EXIT(parser.parse(), ::testing::ExitedWithCode(EXIT_SUCCESS), ""); | ||
+ parser.add_flag(flag, sharg::config{.short_id = 't'}); | ||
+ EXPECT_NO_THROW(parser.parse()); | ||
auto & executable_name = sharg::detail::test_accessor::executable_name(parser); | ||
ASSERT_EQ(executable_name.size(), 1); | ||
EXPECT_EQ(executable_name[0], "parser_test"); | ||
} | ||
|
||
{ | ||
- std::array argv{"./parser_test"}; | ||
+ bool flag{false}; | ||
+ std::array argv{"./parser_test", "-t"}; | ||
sharg::parser parser{"test_parser", argv.size(), argv.data(), sharg::update_notifications::off}; | ||
- EXPECT_EXIT(parser.parse(), ::testing::ExitedWithCode(EXIT_SUCCESS), ""); | ||
+ parser.add_flag(flag, sharg::config{.short_id = 't'}); | ||
+ EXPECT_NO_THROW(parser.parse()); | ||
auto & executable_name = sharg::detail::test_accessor::executable_name(parser); | ||
ASSERT_EQ(executable_name.size(), 1); | ||
EXPECT_EQ(executable_name[0], "./parser_test"); | ||
} | ||
|
||
{ | ||
- std::array argv{"./bin/parser_test"}; | ||
+ bool flag{false}; | ||
+ std::array argv{"./bin/parser_test", "-t"}; | ||
sharg::parser parser{"test_parser", argv.size(), argv.data(), sharg::update_notifications::off}; | ||
- EXPECT_EXIT(parser.parse(), ::testing::ExitedWithCode(EXIT_SUCCESS), ""); | ||
+ parser.add_flag(flag, sharg::config{.short_id = 't'}); | ||
+ EXPECT_NO_THROW(parser.parse()); | ||
auto & executable_name = sharg::detail::test_accessor::executable_name(parser); | ||
ASSERT_EQ(executable_name.size(), 1); | ||
EXPECT_EQ(executable_name[0], "./bin/parser_test"); | ||
} | ||
|
||
{ | ||
- std::array argv{"./bin/parser_test", "build"}; | ||
+ bool flag{false}; | ||
+ std::array argv{"./bin/parser_test", "build", "-t"}; | ||
sharg::parser parser{"test_parser", argv.size(), argv.data(), sharg::update_notifications::off, {"build"}}; | ||
- parser.parse(); | ||
+ EXPECT_NO_THROW(parser.parse()); | ||
auto & sub_parser = parser.get_sub_parser(); | ||
- EXPECT_EXIT(sub_parser.parse(), ::testing::ExitedWithCode(EXIT_SUCCESS), ""); | ||
+ sub_parser.add_flag(flag, sharg::config{.short_id = 't'}); | ||
+ EXPECT_NO_THROW(sub_parser.parse()); | ||
auto & executable_name = sharg::detail::test_accessor::executable_name(sub_parser); | ||
ASSERT_EQ(executable_name.size(), 2); | ||
EXPECT_EQ(executable_name[0], "./bin/parser_test"); | ||
EXPECT_EQ(executable_name[1], "build"); | ||
} | ||
- testing::internal::GetCapturedStdout(); | ||
} | ||
diff --git a/test/unit/parser/parser_design_error_test.cpp b/test/unit/parser/parser_design_error_test.cpp | ||
index 4c3406f..4d81119 100644 | ||
--- a/test/unit/parser/parser_design_error_test.cpp | ||
+++ b/test/unit/parser/parser_design_error_test.cpp | ||
@@ -272,8 +272,8 @@ TEST(parse_test, subcommand_parser_error) | ||
// subcommand key word must only contain alpha numeric characters | ||
{ | ||
char const * argv[]{"./top_level", "-f"}; | ||
- EXPECT_THROW((sharg::parser{"top_level", 2, argv, sharg::update_notifications::off, {"with space"}}), | ||
- sharg::design_error); | ||
+ auto parser = sharg::parser{"top_level", 2, argv, sharg::update_notifications::off, {"with space"}}; | ||
+ EXPECT_THROW(parser.parse(), sharg::design_error); | ||
} | ||
|
||
// no positional/options are allowed | ||
-- | ||
2.43.2 | ||
|
3 changes: 3 additions & 0 deletions
3
test/api_stability/1.1.1/0007-API-MISC-Defer-everything-to-parse.patch.license
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
SPDX-FileCopyrightText: 2006-2024 Knut Reinert & Freie Universität Berlin | ||
SPDX-FileCopyrightText: 2016-2024 Knut Reinert & MPI für molekulare Genetik | ||
SPDX-License-Identifier: BSD-3-Clause |
62 changes: 62 additions & 0 deletions
62
test/api_stability/1.1.1/0008-API-MISC-Allow-options-for-subcommands.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
From 28c35ece0450603abf08bf2705aecbd8365f935a Mon Sep 17 00:00:00 2001 | ||
From: Enrico Seiler <[email protected]> | ||
Date: Mon, 29 Apr 2024 16:37:30 +0200 | ||
Subject: [PATCH 8/8] [API][MISC] Allow options for subcommands | ||
|
||
--- | ||
test/unit/parser/format_parse_test.cpp | 6 +++--- | ||
test/unit/parser/parser_design_error_test.cpp | 9 --------- | ||
2 files changed, 3 insertions(+), 12 deletions(-) | ||
|
||
diff --git a/test/unit/parser/format_parse_test.cpp b/test/unit/parser/format_parse_test.cpp | ||
index f63fa61..c2a8f58 100644 | ||
--- a/test/unit/parser/format_parse_test.cpp | ||
+++ b/test/unit/parser/format_parse_test.cpp | ||
@@ -899,7 +899,7 @@ TEST(parse_test, subcommand_parser_error) | ||
std::array argv{"./top_level", "subiddysub", "-f"}; | ||
sharg::parser top_level_parser{"top", argv.size(), argv.data(), sharg::update_notifications::off, {"sub1"}}; | ||
|
||
- EXPECT_THROW(top_level_parser.parse(), sharg::parser_error); | ||
+ EXPECT_THROW(top_level_parser.parse(), sharg::user_input_error); | ||
} | ||
|
||
// incorrect sub command with no other arguments | ||
@@ -907,7 +907,7 @@ TEST(parse_test, subcommand_parser_error) | ||
std::array argv{"./top_level", "subiddysub"}; | ||
sharg::parser top_level_parser{"top", argv.size(), argv.data(), sharg::update_notifications::off, {"sub1"}}; | ||
|
||
- EXPECT_THROW(top_level_parser.parse(), sharg::parser_error); | ||
+ EXPECT_THROW(top_level_parser.parse(), sharg::user_input_error); | ||
} | ||
|
||
// incorrect sub command with trailing special option | ||
@@ -915,7 +915,7 @@ TEST(parse_test, subcommand_parser_error) | ||
std::array argv{"./top_level", "subiddysub", "-h"}; | ||
sharg::parser top_level_parser{"top", argv.size(), argv.data(), sharg::update_notifications::off, {"sub1"}}; | ||
|
||
- EXPECT_THROW(top_level_parser.parse(), sharg::parser_error); | ||
+ EXPECT_THROW(top_level_parser.parse(), sharg::user_input_error); | ||
} | ||
} | ||
|
||
diff --git a/test/unit/parser/parser_design_error_test.cpp b/test/unit/parser/parser_design_error_test.cpp | ||
index 4d81119..e31a2e7 100644 | ||
--- a/test/unit/parser/parser_design_error_test.cpp | ||
+++ b/test/unit/parser/parser_design_error_test.cpp | ||
@@ -275,13 +275,4 @@ TEST(parse_test, subcommand_parser_error) | ||
auto parser = sharg::parser{"top_level", 2, argv, sharg::update_notifications::off, {"with space"}}; | ||
EXPECT_THROW(parser.parse(), sharg::design_error); | ||
} | ||
- | ||
- // no positional/options are allowed | ||
- { | ||
- char const * argv[]{"./top_level", "foo"}; | ||
- sharg::parser top_level_parser{"top_level", 2, argv, sharg::update_notifications::off, {"foo"}}; | ||
- | ||
- EXPECT_THROW((top_level_parser.add_option(flag_value, sharg::config{.short_id = 'f'})), sharg::design_error); | ||
- EXPECT_THROW((top_level_parser.add_positional_option(flag_value, sharg::config{})), sharg::design_error); | ||
- } | ||
} | ||
-- | ||
2.43.2 | ||
|
3 changes: 3 additions & 0 deletions
3
test/api_stability/1.1.1/0008-API-MISC-Allow-options-for-subcommands.patch.license
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
SPDX-FileCopyrightText: 2006-2024 Knut Reinert & Freie Universität Berlin | ||
SPDX-FileCopyrightText: 2016-2024 Knut Reinert & MPI für molekulare Genetik | ||
SPDX-License-Identifier: BSD-3-Clause |