diff --git a/test/api_stability/1.1.1/0001-API-Update-TDL.patch b/test/api_stability/1.1.1/0001-API-Update-TDL.patch new file mode 100644 index 00000000..f3a3958b --- /dev/null +++ b/test/api_stability/1.1.1/0001-API-Update-TDL.patch @@ -0,0 +1,88 @@ +From 724ad34dea87caf2dde5f19af51d7b5527acf3a2 Mon Sep 17 00:00:00 2001 +From: Simon Gene Gottlieb +Date: Thu, 5 Oct 2023 13:43:30 +0200 +Subject: [PATCH 1/2] [API] Update TDL + +--- + test/unit/detail/format_ctd_test.cpp | 2 +- + test/unit/detail/format_cwl_test.cpp | 22 +++++++++++----------- + 2 files changed, 12 insertions(+), 12 deletions(-) + +diff --git a/test/unit/detail/format_ctd_test.cpp b/test/unit/detail/format_ctd_test.cpp +index fa6a5b6..352acaa 100644 +--- a/test/unit/detail/format_ctd_test.cpp ++++ b/test/unit/detail/format_ctd_test.cpp +@@ -110,7 +110,7 @@ TEST_F(format_ctd_test, empty_information) + // Create the dummy parser. + sharg::parser parser{"default", argv.size(), argv.data()}; + parser.info.date = "December 01, 1994"; +- parser.info.version = "1.1.1"; ++ parser.info.version = "1.1.2-rc.1"; + parser.info.man_page_title = "default_man_page_title"; + parser.info.short_description = "A short description here."; + +diff --git a/test/unit/detail/format_cwl_test.cpp b/test/unit/detail/format_cwl_test.cpp +index d2bb143..5591a88 100644 +--- a/test/unit/detail/format_cwl_test.cpp ++++ b/test/unit/detail/format_cwl_test.cpp +@@ -20,12 +20,12 @@ TEST(format_cwl_test, empty_information) + parser.info.man_page_title = "default_man_page_title"; + parser.info.short_description = "A short description here."; + +- std::string expected_short = "inputs:\n" +- " {}\n" +- "outputs:\n" +- " {}\n" +- "label: default\n" ++ std::string expected_short = "label: default\n" + "doc: \"\"\n" ++ "inputs:\n" ++ " []\n" ++ "outputs:\n" ++ " []\n" + "cwlVersion: v1.2\n" + "class: CommandLineTool\n" + "baseCommand:\n" +@@ -75,7 +75,9 @@ TEST(format_cwl_test, full_information) + parser.info.examples.push_back("example"); + parser.info.examples.push_back("example2"); + +- std::string expected_short = "inputs:\n" ++ std::string expected_short = "label: default\n" ++ "doc: \"description\\ndescription2\\n\"\n" ++ "inputs:\n" + " int:\n" + " doc: \"this is a int option. Default: 5. \"\n" + " type: long?\n" +@@ -87,9 +89,7 @@ TEST(format_cwl_test, full_information) + " inputBinding:\n" + " prefix: --jint\n" + "outputs:\n" +- " {}\n" +- "label: default\n" +- "doc: \"description\\ndescription2\\n\"\n" ++ " []\n" + "cwlVersion: v1.2\n" + "class: CommandLineTool\n" + "baseCommand:\n" +@@ -193,6 +193,8 @@ TEST(format_cwl_test, subparser) + sub_parser.info.examples.push_back("example2"); + + std::string expected_short = ++ "label: default-index\n" ++ "doc: \"\"\n" + "inputs:\n" + " int:\n" + " doc: \"this is a int option. Default: 5. \"\n" +@@ -251,8 +253,6 @@ TEST(format_cwl_test, subparser) + " type: Directory?\n" + " outputBinding:\n" + " glob: $(inputs.path05)\n" +- "label: default-index\n" +- "doc: \"\"\n" + "cwlVersion: v1.2\n" + "class: CommandLineTool\n" + "baseCommand:\n" +-- +2.43.0 + diff --git a/test/api_stability/1.1.1/0002-API-Quoted-strings-and-paths.patch b/test/api_stability/1.1.1/0002-API-Quoted-strings-and-paths.patch new file mode 100644 index 00000000..251097a3 --- /dev/null +++ b/test/api_stability/1.1.1/0002-API-Quoted-strings-and-paths.patch @@ -0,0 +1,345 @@ +From a10348cbebceb4276eeb6f8832d47374fc7bfc1a Mon Sep 17 00:00:00 2001 +From: Enrico Seiler +Date: Mon, 5 Feb 2024 16:02:03 +0100 +Subject: [PATCH 2/2] [API] Quoted strings and paths + +--- + test/snippet/readme_sneak_peek.out | 6 ++--- + test/unit/detail/format_ctd_test.cpp | 8 +++--- + test/unit/detail/format_cwl_test.cpp | 12 ++++----- + test/unit/detail/format_help_test.cpp | 10 +++---- + test/unit/detail/format_html_test.cpp | 12 ++++----- + test/unit/detail/format_man_test.cpp | 12 ++++----- + test/unit/detail/seqan3_test.cpp | 2 +- + .../parser/format_parse_validators_test.cpp | 26 +++++++++---------- + 8 files changed, 44 insertions(+), 44 deletions(-) + +diff --git a/test/snippet/readme_sneak_peek.out b/test/snippet/readme_sneak_peek.out +index 47bc0c1..8b51ee2 100644 +--- a/test/snippet/readme_sneak_peek.out ++++ b/test/snippet/readme_sneak_peek.out +@@ -5,7 +5,7 @@ OPTIONS + + Eating Numbers + -i, --int (signed 32 bit integer) +- Desc. Default: 0. ++ Desc. Default: 0 + + Common options + -h, --help +@@ -20,9 +20,9 @@ OPTIONS + Export the help page information. Value must be one of [html, man, + ctd, cwl]. + --version-check (bool) +- Whether to check for the newest app version. Default: true. ++ Whether to check for the newest app version. Default: true + + VERSION + Last update: + Eat-Me-App version: +- Sharg version: 1.1.1 ++ Sharg version: 1.1.2-rc.1 +diff --git a/test/unit/detail/format_ctd_test.cpp b/test/unit/detail/format_ctd_test.cpp +index 352acaa..eb14047 100644 +--- a/test/unit/detail/format_ctd_test.cpp ++++ b/test/unit/detail/format_ctd_test.cpp +@@ -42,13 +42,13 @@ struct format_ctd_test : public ::testing::Test + "\n" + R"del( )del" + "\n" +- R"del( )del" ++ R"del( )del" + "\n" +- R"del( )del" ++ R"del( )del" + "\n" +- R"del( )del" ++ R"del( )del" + "\n" +- R"del( )del" ++ R"del( )del" + "\n" + R"del( )del" + "\n" +diff --git a/test/unit/detail/format_cwl_test.cpp b/test/unit/detail/format_cwl_test.cpp +index 5591a88..1d27cc3 100644 +--- a/test/unit/detail/format_cwl_test.cpp ++++ b/test/unit/detail/format_cwl_test.cpp +@@ -79,12 +79,12 @@ TEST(format_cwl_test, full_information) + "doc: \"description\\ndescription2\\n\"\n" + "inputs:\n" + " int:\n" +- " doc: \"this is a int option. Default: 5. \"\n" ++ " doc: \"this is a int option. Default: 5\"\n" + " type: long?\n" + " inputBinding:\n" + " prefix: --int\n" + " jint:\n" +- " doc: \"this is a required int option. \"\n" ++ " doc: this is a required int option.\n" + " type: long\n" + " inputBinding:\n" + " prefix: --jint\n" +@@ -197,22 +197,22 @@ TEST(format_cwl_test, subparser) + "doc: \"\"\n" + "inputs:\n" + " int:\n" +- " doc: \"this is a int option. Default: 5. \"\n" ++ " doc: \"this is a int option. Default: 5\"\n" + " type: long?\n" + " inputBinding:\n" + " prefix: --int\n" + " jint:\n" +- " doc: \"this is a required int option. \"\n" ++ " doc: this is a required int option.\n" + " type: long\n" + " inputBinding:\n" + " prefix: --jint\n" + " percent:\n" +- " doc: \"this is a required float option. \"\n" ++ " doc: this is a required float option.\n" + " type: double\n" + " inputBinding:\n" + " prefix: --percent\n" + " string:\n" +- " doc: \"this is a string option (advanced). Default: . \"\n" ++ " doc: \"this is a string option (advanced). Default: \\\"\\\"\"\n" + " type: string?\n" + " inputBinding:\n" + " prefix: --string\n" +diff --git a/test/unit/detail/format_help_test.cpp b/test/unit/detail/format_help_test.cpp +index c5ffd9f..f31e066 100644 +--- a/test/unit/detail/format_help_test.cpp ++++ b/test/unit/detail/format_help_test.cpp +@@ -35,7 +35,7 @@ std::string const basic_options_str = " Common options\n" + " Export the help page information. Value must be one of [html, man,\n" + " ctd, cwl].\n" + " --version-check (bool)\n" +- " Whether to check for the newest app version. Default: true.\n"; ++ " Whether to check for the newest app version. Default: true\n"; + + std::string const basic_version_str = "VERSION\n" + " Last update:\n" +@@ -370,7 +370,7 @@ TEST(help_page_printing, advanced_options) + "\n" + " advanced subsection\n" + " -j, --jnt (unsigned 8 bit integer)\n" +- " this is a int option. Default: 2.\n" ++ " this is a int option. Default: 2\n" + " -f, --flag\n" + " this is a flag.\n" + " -s, --some\n" +@@ -450,10 +450,10 @@ TEST(help_page_printing, full_information) + " ARGUMENT-1 (signed 8 bit integer)\n" + " this is not a list.\n" + " ARGUMENT-2 (List of std::string)\n" +- " this is a positional option. Default: [].\n" ++ " this is a positional option. Default: []\n" + "\nOPTIONS\n" + " -i, --int (signed 32 bit integer)\n" +- " this is a int option. Default: A number.\n" ++ " this is a int option. Default: A number\n" + " -e, --enum (foo)\n" + " this is an enum option. Default: one. Value must be one of [three,\n" + " two, one].\n" +@@ -580,7 +580,7 @@ TEST(parse_test, subcommand_parser) + " subcommand key word is passed on to the corresponding sub-parser.\n" + "\nOPTIONS\n" + " -f, --foo (signed 32 bit integer)\n" +- " foo bar. Default: 0.\n" ++ " foo bar. Default: 0\n" + "\n" + + basic_options_str + "\n" + basic_version_str; + +diff --git a/test/unit/detail/format_html_test.cpp b/test/unit/detail/format_html_test.cpp +index a0f7d0a..83c6818 100644 +--- a/test/unit/detail/format_html_test.cpp ++++ b/test/unit/detail/format_html_test.cpp +@@ -44,7 +44,7 @@ TEST(html_format, empty_information) + "
--export-help (std::string)
\n" + "
Export the help page information. Value must be one of [html, man, ctd, cwl].
\n" + "
--version-check (bool)
\n" +- "
Whether to check for the newest app version. Default: true.
\n" ++ "
Whether to check for the newest app version. Default: true
\n" + "\n" + "

Version

\n" + "

\n" +@@ -138,16 +138,16 @@ TEST(html_format, full_information_information) + "

Positional Arguments

\n" + "
\n" + "
ARGUMENT-1 (signed 8 bit integer)
\n" +- "
this is a positional option.
\n" ++ "
this is a positional option.
\n" + "
ARGUMENT-2 (List of std::string)
\n" +- "
this is a positional option. Default: [].
\n" ++ "
this is a positional option. Default: []
\n" + "
\n" + "

Options

\n" + "
\n" + "
-i, --int (signed 32 bit integer)
\n" +- "
this is a int option. Default: A number.
\n" ++ "
this is a int option. Default: A number
\n" + "
-j, --jint (signed 32 bit integer)
\n" +- "
this is a required int option.
\n" ++ "
this is a required int option.
\n" + "
-f, --flag
\n" + "
this is a flag.
\n" + "
-k, --kflag
\n" +@@ -166,7 +166,7 @@ TEST(html_format, full_information_information) + "
--export-help (std::string)
\n" + "
Export the help page information. Value must be one of [html, man, ctd, cwl].
\n" + "
--version-check (bool)
\n" +- "
Whether to check for the newest app version. Default: true.
\n" ++ "
Whether to check for the newest app version. Default: true
\n" + "
\n" + "

Examples

\n" + "

\n" +diff --git a/test/unit/detail/format_man_test.cpp b/test/unit/detail/format_man_test.cpp +index 9827886..307b58b 100644 +--- a/test/unit/detail/format_man_test.cpp ++++ b/test/unit/detail/format_man_test.cpp +@@ -47,13 +47,13 @@ struct format_man_test : public ::testing::Test + "\n" + R"(\fBARGUMENT-1\fP (\fIsigned 8 bit integer\fP))" + "\n" +- R"(this is a positional option. )" ++ R"(this is a positional option.)" + "\n" + R"(.TP)" + "\n" + R"(\fBARGUMENT-2\fP (\fIList\fP of \fIstd::string\fP))" + "\n" +- R"(this is a positional option. Default: []. )" ++ R"(this is a positional option. Default: [])" + "\n" + R"(.SH OPTIONS)" + "\n" +@@ -61,13 +61,13 @@ struct format_man_test : public ::testing::Test + "\n" + R"(\fB-i\fP, \fB--int\fP (\fIsigned 32 bit integer\fP))" + "\n" +- R"(this is a int option. Default: A number. )" ++ R"(this is a int option. Default: A number)" + "\n" + R"(.TP)" + "\n" + R"(\fB-j\fP, \fB--jint\fP (\fIsigned 32 bit integer\fP))" + "\n" +- R"(this is a required int option. )" ++ R"(this is a required int option.)" + "\n" + R"(.SH FLAGS)" + "\n" +@@ -123,7 +123,7 @@ struct format_man_test : public ::testing::Test + "\n" + R"(\fB--version-check\fP (bool))" + "\n" +- R"(Whether to check for the newest app version. Default: true.)" ++ R"(Whether to check for the newest app version. Default: true)" + "\n" + R"(.SH EXAMPLES)" + "\n" +@@ -236,7 +236,7 @@ TEST_F(format_man_test, empty_information) + "\n" + R"(\fB--version-check\fP (bool))" + "\n" +- R"(Whether to check for the newest app version. Default: true.)" ++ R"(Whether to check for the newest app version. Default: true)" + "\n" + R"(.SH VERSION)" + "\n" +diff --git a/test/unit/detail/seqan3_test.cpp b/test/unit/detail/seqan3_test.cpp +index c1329cb..6c228f5 100644 +--- a/test/unit/detail/seqan3_test.cpp ++++ b/test/unit/detail/seqan3_test.cpp +@@ -22,7 +22,7 @@ std::string const basic_options_str = " Common options\n" + " Export the help page information. Value must be one of [html, man,\n" + " ctd, cwl].\n" + " --version-check (bool)\n" +- " Whether to check for the newest app version. Default: true.\n"; ++ " Whether to check for the newest app version. Default: true\n"; + + std::string const basic_version_str = "VERSION\n" + " Last update:\n" +diff --git a/test/unit/parser/format_parse_validators_test.cpp b/test/unit/parser/format_parse_validators_test.cpp +index cade0f9..ba1694d 100644 +--- a/test/unit/parser/format_parse_validators_test.cpp ++++ b/test/unit/parser/format_parse_validators_test.cpp +@@ -167,8 +167,8 @@ TEST(validator_test, input_file) + "\n" + "POSITIONAL ARGUMENTS\n" + " ARGUMENT-1 (std::filesystem::path)\n" +- " desc The input file must exist and read permissions must be granted.\n" +- " Valid file extensions are: [fa, sam, fasta, fasta.txt].\n" ++ " desc. The input file must exist and read permissions must be\n" ++ " granted. Valid file extensions are: [fa, sam, fasta, fasta.txt].\n" + "\nOPTIONS\n\n"} + + basic_options_str + "\n" + basic_version_str; + EXPECT_EQ(my_stdout, expected); +@@ -319,7 +319,7 @@ TEST(validator_test, output_file) + "\n" + "POSITIONAL ARGUMENTS\n" + " ARGUMENT-1 (std::filesystem::path)\n" +- " desc The output file must not exist already and write permissions\n" ++ " desc. The output file must not exist already and write permissions\n" + " must be granted. Valid file extensions are: [fa, sam, fasta,\n" + " fasta.txt].\n" + "\nOPTIONS\n\n"} +@@ -348,7 +348,7 @@ TEST(validator_test, output_file) + "\n" + "POSITIONAL ARGUMENTS\n" + " ARGUMENT-1 (std::filesystem::path)\n" +- " desc Write permissions must be granted. Valid file extensions are:\n" ++ " desc. Write permissions must be granted. Valid file extensions are:\n" + " [fa, sam, fasta, fasta.txt].\n" + "\nOPTIONS\n\n"} + + basic_options_str + "\n" + basic_version_str; +@@ -439,7 +439,7 @@ TEST(validator_test, input_directory) + "\n" + "POSITIONAL ARGUMENTS\n" + " ARGUMENT-1 (std::filesystem::path)\n" +- " desc An existing, readable path for the input directory.\n" ++ " desc. An existing, readable path for the input directory.\n" + "\nOPTIONS\n\n"} + + basic_options_str + "\n" + basic_version_str; + +@@ -501,7 +501,7 @@ TEST(validator_test, output_directory) + "\n" + "POSITIONAL ARGUMENTS\n" + " ARGUMENT-1 (std::filesystem::path)\n" +- " desc A valid path for the output directory.\n" ++ " desc. A valid path for the output directory.\n" + "\nOPTIONS\n\n"} + + basic_options_str + "\n" + basic_version_str; + +@@ -1403,10 +1403,10 @@ TEST(validator_test, chaining_validators) + "===========\n" + "\nOPTIONS\n" + " -s, --string-option (std::string)\n" +- " desc Default: . Value must match the pattern '(/[^/]+)+/.*\\.[^/\\.]+$'.\n" +- " The output file must not exist already and write permissions must be\n" +- " granted. Valid file extensions are: [sa, so]. Value must match the\n" +- " pattern '.*'.\n" ++ " desc Default: \"\". Value must match the pattern\n" ++ " '(/[^/]+)+/.*\\.[^/\\.]+$'. The output file must not exist already and\n" ++ " write permissions must be granted. Valid file extensions are: [sa,\n" ++ " so]. Value must match the pattern '.*'.\n" + "\n"} + + basic_options_str + "\n" + basic_version_str; + EXPECT_EQ(my_stdout, expected); +@@ -1436,9 +1436,9 @@ TEST(validator_test, chaining_validators) + "===========\n" + "\nOPTIONS\n" + " -s, --string-option (std::string)\n" +- " desc Default: . Value must match the pattern '(/[^/]+)+/.*\\.[^/\\.]+$'.\n" +- " Write permissions must be granted. Valid file extensions are: [sa,\n" +- " so]. Value must match the pattern '.*'.\n" ++ " desc Default: \"\". Value must match the pattern\n" ++ " '(/[^/]+)+/.*\\.[^/\\.]+$'. Write permissions must be granted. Valid\n" ++ " file extensions are: [sa, so]. Value must match the pattern '.*'.\n" + "\n"} + + basic_options_str + "\n" + basic_version_str; + EXPECT_EQ(my_stdout, expected); +-- +2.43.0 + diff --git a/test/api_stability/CMakeLists.txt b/test/api_stability/CMakeLists.txt index 9638f4aa..59c4303c 100644 --- a/test/api_stability/CMakeLists.txt +++ b/test/api_stability/CMakeLists.txt @@ -2,16 +2,20 @@ cmake_minimum_required (VERSION 3.8) project (api_stability) +if (NOT CMAKE_VERSION VERSION_LESS 3.24) # cmake >= 3.24 + cmake_policy (SET CMP0135 NEW) +endif () + find_package (Git) include (../sharg-test.cmake) include (ExternalProject) -set (SHARG_LAST_STABLE_VERSION "1.0.0") +set (SHARG_LAST_STABLE_VERSION "1.1.1") set (SHARG_LAST_STABLE_SOURCE_URL "https://github.com/seqan/sharg-parser/releases/download/${SHARG_LAST_STABLE_VERSION}/sharg-${SHARG_LAST_STABLE_VERSION}-Source.tar.xz" ) -set (SHARG_LAST_STABLE_SOURCE_SHA256 "babd34fc0851ac6710346b67eb46ca067576fc319e0be5c478437733a69b66a0") +set (SHARG_LAST_STABLE_SOURCE_SHA256 "7330f06501718e7871e55e5fd70d0e41472cc8b34bd0e3519f8c5547510c671c") set (SHARG_API_STABILITY_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DSHARG_DISABLE_DEPRECATED_WARNINGS=1") @@ -37,7 +41,8 @@ endmacro () if (EXISTS "${CMAKE_CURRENT_LIST_DIR}/${SHARG_LAST_STABLE_VERSION}") set (SHARG_GIT_APPLY - "${GIT_EXECUTABLE} apply --verbose ${CMAKE_CURRENT_LIST_DIR}/${SHARG_LAST_STABLE_VERSION}/*.patch") + "${GIT_EXECUTABLE} init . && ${GIT_EXECUTABLE} apply --verbose ${CMAKE_CURRENT_LIST_DIR}/${SHARG_LAST_STABLE_VERSION}/*.patch" + ) else () set (SHARG_GIT_APPLY "true") message (STATUS "No patches found in ${CMAKE_CURRENT_LIST_DIR}/${SHARG_LAST_STABLE_VERSION}.")