Skip to content

Commit 0f91e17

Browse files
authored
Merge pull request #235 from eseiler/infra/update_tdl
[INFRA] Update TDL
2 parents d48c51f + 5cd2f94 commit 0f91e17

15 files changed

+200
-23
lines changed

.github/workflows/ci_cmake.yml

+25-3
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,15 @@ defaults:
2727

2828
jobs:
2929
build:
30-
name: "External project"
30+
name: "External project ${{ contains(matrix.SHARG_NO_TDL, 'OFF') && 'with TDL' || 'without TDL' }}"
3131
runs-on: ubuntu-22.04
3232
timeout-minutes: 120
3333
if: github.repository_owner == 'seqan' || github.event_name == 'workflow_dispatch' || github.event.label.name == 'lint'
34+
strategy:
35+
fail-fast: false
36+
matrix:
37+
SHARG_NO_TDL: [ON, OFF]
38+
3439
steps:
3540
- name: Checkout
3641
uses: actions/checkout@v4
@@ -48,13 +53,30 @@ jobs:
4853
uses: seqan/actions/setup-toolchain@main
4954
with:
5055
compiler: gcc-13
51-
use_actions_cache: false
56+
57+
- name: Install dependencies
58+
if: matrix.SHARG_NO_TDL == 'OFF'
59+
run: |
60+
git clone --depth 1 --single-branch --branch 0.8.0 https://github.com/jbeder/yaml-cpp.git
61+
cd yaml-cpp
62+
mkdir build
63+
cd build
64+
cmake ../ -DCMAKE_BUILD_TYPE=Debug \
65+
-DYAML_CPP_BUILD_CONTRIB=OFF \
66+
-DYAML_CPP_BUILD_TOOLS=OFF \
67+
-DYAML_BUILD_SHARED_LIBS=OFF \
68+
-DYAML_CPP_INSTALL=ON \
69+
-DYAML_CPP_BUILD_TESTS=OFF \
70+
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
71+
make -j2
72+
sudo make install
5273
5374
- name: Configure tests
5475
run: |
5576
mkdir sharg-build
5677
cd sharg-build
57-
cmake ../sharg-parser/test/external_project -DCMAKE_BUILD_TYPE=Debug
78+
cmake ../sharg-parser/test/external_project -DCMAKE_BUILD_TYPE=Debug \
79+
-DSHARG_NO_TDL=${{ matrix.SHARG_NO_TDL }}
5880
make -j2 sharg_test_prerequisite
5981
6082
- name: Build tests

build_system/sharg-config.cmake

+14-1
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,20 @@ endif ()
206206
set (SHARG_USE_TDL FALSE)
207207

208208
if (NOT SHARG_NO_TDL)
209-
find_package (TDL QUIET HINTS ${SHARG_SUBMODULES_DIR}/submodules/tool_description_lib ${SHARG_HINT_TDL})
209+
find_package (TDL QUIET HINTS ${SHARG_HINT_TDL})
210+
211+
if (NOT TDL_FOUND)
212+
if (EXISTS ${SHARG_SUBMODULES_DIR}/submodules/tool_description_lib)
213+
include (FetchContent)
214+
FetchContent_Declare (tdl SOURCE_DIR ${SHARG_SUBMODULES_DIR}/submodules/tool_description_lib)
215+
set (SHARG_LOG_LEVEL ${CMAKE_MESSAGE_LOG_LEVEL})
216+
set (CMAKE_MESSAGE_LOG_LEVEL "ERROR")
217+
option (INSTALL_TDL "Enable installation of TDL." ${INSTALL_SHARG})
218+
FetchContent_MakeAvailable (tdl)
219+
set (CMAKE_MESSAGE_LOG_LEVEL ${SHARG_LOG_LEVEL})
220+
set (TDL_FOUND TRUE)
221+
endif ()
222+
endif ()
210223

211224
if (TDL_FOUND)
212225
sharg_config_print ("Optional dependency: TDL found.")

test/api_stability/1.1.1/0001-API-Update-TDL.patch

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
From 27bc700234a23ea6c6c7337a427c4a3c6f2bbe55 Mon Sep 17 00:00:00 2001
1+
From ace25c7fffccdac9ccaf81329ada87f60021b5f9 Mon Sep 17 00:00:00 2001
22
From: Simon Gene Gottlieb <[email protected]>
33
Date: Thu, 5 Oct 2023 13:43:30 +0200
4-
Subject: [PATCH 1/3] [API] Update TDL
4+
Subject: [PATCH 1/5] [API] Update TDL
55

66
---
77
test/unit/detail/format_ctd_test.cpp | 2 +-

test/api_stability/1.1.1/0002-API-Quoted-strings-and-paths.patch

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
From 09a51343b1ee29f245eeae8210d50cd74ac9b1b4 Mon Sep 17 00:00:00 2001
1+
From 7bf847b4991636a59f26ca89977e94f51edfbf11 Mon Sep 17 00:00:00 2001
22
From: Enrico Seiler <[email protected]>
33
Date: Mon, 5 Feb 2024 16:02:03 +0100
4-
Subject: [PATCH 2/3] [API] Quoted strings and paths
4+
Subject: [PATCH 2/5] [API] Quoted strings and paths
55

66
---
77
test/snippet/readme_sneak_peek.out | 6 ++---

test/api_stability/1.1.1/0003-NOAPI-Update-copyright.patch

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
From 859b9d015379e0d708700225fa55dd31f7d2e2f5 Mon Sep 17 00:00:00 2001
1+
From f02ddb2f31a47da16742dbf612d780b328e7602b Mon Sep 17 00:00:00 2001
22
From: Enrico Seiler <[email protected]>
33
Date: Wed, 7 Feb 2024 13:31:22 +0100
4-
Subject: [PATCH 3/3] [NOAPI] Update copyright
4+
Subject: [PATCH 3/5] [NOAPI] Update copyright
55

66
---
77
test/unit/detail/format_help_test.cpp | 10 +++++-----
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
From 9f040f8ccb8d304841d24d8ac4d67db0d06c370f Mon Sep 17 00:00:00 2001
2+
From: Enrico Seiler <[email protected]>
3+
Date: Fri, 9 Feb 2024 16:17:21 +0100
4+
Subject: [PATCH 4/5] [INFRA] Update TDL
5+
6+
---
7+
test/unit/detail/format_cwl_test.cpp | 28 +++++++++++++++++++++++++++-
8+
1 file changed, 27 insertions(+), 1 deletion(-)
9+
10+
diff --git a/test/unit/detail/format_cwl_test.cpp b/test/unit/detail/format_cwl_test.cpp
11+
index 1d27cc3..eaf0cad 100644
12+
--- a/test/unit/detail/format_cwl_test.cpp
13+
+++ b/test/unit/detail/format_cwl_test.cpp
14+
@@ -76,8 +76,16 @@ TEST(format_cwl_test, full_information)
15+
parser.info.examples.push_back("example2");
16+
17+
std::string expected_short = "label: default\n"
18+
- "doc: \"description\\ndescription2\\n\"\n"
19+
+ "doc: \"description\\n"
20+
+ "description2\\n"
21+
+ "\"\n"
22+
"inputs:\n"
23+
+ " positional_0:\n"
24+
+ " doc: this is a positional option.\n"
25+
+ " type: string?\n"
26+
+ " positional_1:\n"
27+
+ " doc: \"this is a positional option. Default: []\"\n"
28+
+ " type: string?\n"
29+
" int:\n"
30+
" doc: \"this is a int option. Default: 5\"\n"
31+
" type: long?\n"
32+
@@ -88,6 +96,12 @@ TEST(format_cwl_test, full_information)
33+
" type: long\n"
34+
" inputBinding:\n"
35+
" prefix: --jint\n"
36+
+ " flag:\n"
37+
+ " doc: this is a flag.\n"
38+
+ " type: boolean?\n"
39+
+ " kflag:\n"
40+
+ " doc: this is a flag.\n"
41+
+ " type: boolean?\n"
42+
"outputs:\n"
43+
" []\n"
44+
"cwlVersion: v1.2\n"
45+
@@ -196,6 +210,12 @@ TEST(format_cwl_test, subparser)
46+
"label: default-index\n"
47+
"doc: \"\"\n"
48+
"inputs:\n"
49+
+ " positional_0:\n"
50+
+ " doc: this is a positional option.\n"
51+
+ " type: string?\n"
52+
+ " positional_1:\n"
53+
+ " doc: \"this is a positional option. Default: []\"\n"
54+
+ " type: string?\n"
55+
" int:\n"
56+
" doc: \"this is a int option. Default: 5\"\n"
57+
" type: long?\n"
58+
@@ -244,6 +264,12 @@ TEST(format_cwl_test, subparser)
59+
" type: string?\n"
60+
" inputBinding:\n"
61+
" prefix: --path05\n"
62+
+ " flag:\n"
63+
+ " doc: this is a flag.\n"
64+
+ " type: boolean?\n"
65+
+ " kflag:\n"
66+
+ " doc: this is a flag.\n"
67+
+ " type: boolean?\n"
68+
"outputs:\n"
69+
" path04:\n"
70+
" type: File?\n"
71+
--
72+
2.43.0
73+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
SPDX-FileCopyrightText: 2006-2024 Knut Reinert & Freie Universität Berlin
2+
SPDX-FileCopyrightText: 2016-2024 Knut Reinert & MPI für molekulare Genetik
3+
SPDX-License-Identifier: BSD-3-Clause
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
From 3a7dfd8103806e97af6376e9173d686b67fb5b52 Mon Sep 17 00:00:00 2001
2+
From: Enrico Seiler <[email protected]>
3+
Date: Fri, 9 Feb 2024 18:13:36 +0100
4+
Subject: [PATCH 5/5] [INFRA] Use seqan3 main branch
5+
6+
---
7+
test/unit/detail/CMakeLists.txt | 2 +-
8+
1 file changed, 1 insertion(+), 1 deletion(-)
9+
10+
diff --git a/test/unit/detail/CMakeLists.txt b/test/unit/detail/CMakeLists.txt
11+
index 392f878..1f9a8e0 100644
12+
--- a/test/unit/detail/CMakeLists.txt
13+
+++ b/test/unit/detail/CMakeLists.txt
14+
@@ -23,7 +23,7 @@ sharg_test (type_name_as_string_test.cpp)
15+
sharg_test (version_check_debug_test.cpp)
16+
sharg_test (version_check_release_test.cpp)
17+
18+
-file (DOWNLOAD https://raw.githubusercontent.com/seqan/seqan3/master/include/seqan3/version.hpp
19+
+file (DOWNLOAD https://raw.githubusercontent.com/seqan/seqan3/main/include/seqan3/version.hpp
20+
${CMAKE_BINARY_DIR}/include/seqan3/version.hpp)
21+
sharg_test (seqan3_test.cpp)
22+
target_include_directories (seqan3_test SYSTEM PUBLIC ${CMAKE_BINARY_DIR}/include)
23+
--
24+
2.43.0
25+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
SPDX-FileCopyrightText: 2006-2024 Knut Reinert & Freie Universität Berlin
2+
SPDX-FileCopyrightText: 2016-2024 Knut Reinert & MPI für molekulare Genetik
3+
SPDX-License-Identifier: BSD-3-Clause

test/external_project/CMakeLists.txt

+18-9
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,10 @@ ExternalProject_Add (
2424
sharg_submodule_add_subdirectory
2525
PREFIX sharg_submodule_add_subdirectory
2626
SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/sharg_submodule_add_subdirectory"
27-
CMAKE_ARGS ${SHARG_EXTERNAL_PROJECT_CMAKE_ARGS}
27+
CMAKE_ARGS ${SHARG_EXTERNAL_PROJECT_CMAKE_ARGS} #
2828
"-DCMAKE_FIND_DEBUG_MODE=${SHARG_EXTERNAL_PROJECT_FIND_DEBUG_MODE}" #
29-
"-DSHARG_ROOT=${SHARG_ROOT}")
29+
"-DSHARG_ROOT=${SHARG_ROOT}" #
30+
"-DSHARG_NO_TDL=${SHARG_NO_TDL}")
3031

3132
# 2) This tests test/external_project/sharg_submodule_find_package/CMakeLists.txt
3233
# We have a sharg checkout somewhere and we point CMAKE_PREFIX_PATH to <checkout>/sharg/build_system
@@ -37,8 +38,10 @@ ExternalProject_Add (
3738
sharg_submodule_find_package
3839
PREFIX sharg_submodule_find_package
3940
SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/sharg_submodule_find_package"
40-
CMAKE_ARGS ${SHARG_EXTERNAL_PROJECT_CMAKE_ARGS} "-DCMAKE_FIND_DEBUG_MODE=${SHARG_EXTERNAL_PROJECT_FIND_DEBUG_MODE}"
41-
"-DCMAKE_PREFIX_PATH=${SHARG_ROOT}/build_system")
41+
CMAKE_ARGS ${SHARG_EXTERNAL_PROJECT_CMAKE_ARGS} #
42+
"-DCMAKE_FIND_DEBUG_MODE=${SHARG_EXTERNAL_PROJECT_FIND_DEBUG_MODE}" #
43+
"-DCMAKE_PREFIX_PATH=${SHARG_ROOT}/build_system" #
44+
"-DSHARG_NO_TDL=${SHARG_NO_TDL}")
4245

4346
# 3) This tests test/external_project/sharg_installed/CMakeLists.txt
4447
# This test assumes that sharg was installed by make install (e.g. system-wide).
@@ -53,8 +56,10 @@ ExternalProject_Add (
5356
sharg_installed
5457
PREFIX sharg_installed
5558
SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/sharg_installed"
56-
CMAKE_ARGS ${SHARG_EXTERNAL_PROJECT_CMAKE_ARGS} "-DCMAKE_FIND_DEBUG_MODE=${SHARG_EXTERNAL_PROJECT_FIND_DEBUG_MODE}"
57-
"-DCMAKE_SYSTEM_PREFIX_PATH=${SHARG_SYSTEM_PREFIX}")
59+
CMAKE_ARGS ${SHARG_EXTERNAL_PROJECT_CMAKE_ARGS} #
60+
"-DCMAKE_FIND_DEBUG_MODE=${SHARG_EXTERNAL_PROJECT_FIND_DEBUG_MODE}" #
61+
"-DCMAKE_SYSTEM_PREFIX_PATH=${SHARG_SYSTEM_PREFIX}" #
62+
"-DSHARG_NO_TDL=${SHARG_NO_TDL}")
5863
add_dependencies (sharg_installed sharg_test_prerequisite)
5964

6065
# 4) This tests test/external_project/sharg_fetch_content_zip/CMakeLists.txt
@@ -68,8 +73,10 @@ ExternalProject_Add (
6873
sharg_fetch_content_zip
6974
PREFIX sharg_fetch_content_zip
7075
SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/sharg_fetch_content_zip"
71-
CMAKE_ARGS ${SHARG_EXTERNAL_PROJECT_CMAKE_ARGS} "-DCMAKE_FIND_DEBUG_MODE=${SHARG_EXTERNAL_PROJECT_FIND_DEBUG_MODE}"
72-
"-DSHARG_PACKAGE_ZIP_URL=${SHARG_PACKAGE_ZIP_URL}")
76+
CMAKE_ARGS ${SHARG_EXTERNAL_PROJECT_CMAKE_ARGS} #
77+
"-DCMAKE_FIND_DEBUG_MODE=${SHARG_EXTERNAL_PROJECT_FIND_DEBUG_MODE}" #
78+
"-DSHARG_PACKAGE_ZIP_URL=${SHARG_PACKAGE_ZIP_URL}" #
79+
"-DSHARG_NO_TDL=${SHARG_NO_TDL}")
7380
add_dependencies (sharg_fetch_content_zip sharg_test_prerequisite)
7481

7582
# 5) This test is the same as 2) but emulates the settings within the setup tutorial.
@@ -78,4 +85,6 @@ ExternalProject_Add (
7885
sharg_setup_tutorial
7986
PREFIX sharg_setup_tutorial
8087
SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/sharg_setup_tutorial"
81-
CMAKE_ARGS ${SHARG_EXTERNAL_PROJECT_CMAKE_ARGS} "-DCMAKE_FIND_DEBUG_MODE=${SHARG_EXTERNAL_PROJECT_FIND_DEBUG_MODE}")
88+
CMAKE_ARGS ${SHARG_EXTERNAL_PROJECT_CMAKE_ARGS} #
89+
"-DCMAKE_FIND_DEBUG_MODE=${SHARG_EXTERNAL_PROJECT_FIND_DEBUG_MODE}" #
90+
"-DSHARG_NO_TDL=${SHARG_NO_TDL}")

test/snippet/CMakeLists.txt

-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ endmacro ()
4848
macro (sharg_snippets test_name_prefix snippet_base_path_)
4949
get_filename_component (snippet_base_path "${snippet_base_path_}" ABSOLUTE BASE_DIR
5050
"${CMAKE_CURRENT_SOURCE_DIR}/../..")
51-
message (STATUS "${snippet_base_path}")
5251
sharg_test_files (snippet_files "${snippet_base_path}" "*.cpp")
5352
foreach (snippet ${snippet_files})
5453
sharg_snippet ("${test_name_prefix}" "${snippet}" "${snippet_base_path}")

test/unit/detail/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ sharg_test (type_name_as_string_test.cpp)
2020
sharg_test (version_check_debug_test.cpp)
2121
sharg_test (version_check_release_test.cpp)
2222

23-
file (DOWNLOAD https://raw.githubusercontent.com/seqan/seqan3/master/include/seqan3/version.hpp
23+
file (DOWNLOAD https://raw.githubusercontent.com/seqan/seqan3/main/include/seqan3/version.hpp
2424
${CMAKE_BINARY_DIR}/include/seqan3/version.hpp)
2525
sharg_test (seqan3_test.cpp)
2626
target_include_directories (seqan3_test SYSTEM PUBLIC ${CMAKE_BINARY_DIR}/include)

test/unit/detail/format_cwl_test.cpp

+27-1
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,16 @@ TEST(format_cwl_test, full_information)
7979
parser.info.examples.push_back("example2");
8080

8181
std::string expected_short = "label: default\n"
82-
"doc: \"description\\ndescription2\\n\"\n"
82+
"doc: \"description\\n"
83+
"description2\\n"
84+
"\"\n"
8385
"inputs:\n"
86+
" positional_0:\n"
87+
" doc: this is a positional option.\n"
88+
" type: string?\n"
89+
" positional_1:\n"
90+
" doc: \"this is a positional option. Default: []\"\n"
91+
" type: string?\n"
8492
" int:\n"
8593
" doc: \"this is a int option. Default: 5\"\n"
8694
" type: long?\n"
@@ -91,6 +99,12 @@ TEST(format_cwl_test, full_information)
9199
" type: long\n"
92100
" inputBinding:\n"
93101
" prefix: --jint\n"
102+
" flag:\n"
103+
" doc: this is a flag.\n"
104+
" type: boolean?\n"
105+
" kflag:\n"
106+
" doc: this is a flag.\n"
107+
" type: boolean?\n"
94108
"outputs:\n"
95109
" []\n"
96110
"cwlVersion: v1.2\n"
@@ -199,6 +213,12 @@ TEST(format_cwl_test, subparser)
199213
"label: default-index\n"
200214
"doc: \"\"\n"
201215
"inputs:\n"
216+
" positional_0:\n"
217+
" doc: this is a positional option.\n"
218+
" type: string?\n"
219+
" positional_1:\n"
220+
" doc: \"this is a positional option. Default: []\"\n"
221+
" type: string?\n"
202222
" int:\n"
203223
" doc: \"this is a int option. Default: 5\"\n"
204224
" type: long?\n"
@@ -247,6 +267,12 @@ TEST(format_cwl_test, subparser)
247267
" type: string?\n"
248268
" inputBinding:\n"
249269
" prefix: --path05\n"
270+
" flag:\n"
271+
" doc: this is a flag.\n"
272+
" type: boolean?\n"
273+
" kflag:\n"
274+
" doc: this is a flag.\n"
275+
" type: boolean?\n"
250276
"outputs:\n"
251277
" path04:\n"
252278
" type: File?\n"

test/unit/detail/seqan3_test.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66

77
#include <sharg/parser.hpp>
88

9+
#if !__has_include(<seqan3/version.hpp>)
10+
# error "seqan3/version.hpp is not available"
11+
#endif
12+
913
std::string const basic_options_str = " Common options\n"
1014
" -h, --help\n"
1115
" Prints the help page.\n"

0 commit comments

Comments
 (0)