Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci_coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
image: ghcr.io/seqan/${{ matrix.compiler }}
steps:
- name: Checkout
uses: actions/checkout@v5
uses: actions/checkout@v6
with:
fetch-depth: 0

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci_documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ jobs:
steps:
- name: Checkout
if: github.event_name != 'pull_request_target'
uses: actions/checkout@v5
uses: actions/checkout@v6

# pull_request_target does not checkout the merge commit by default
- name: Checkout
if: github.event_name == 'pull_request_target'
uses: actions/checkout@v5
uses: actions/checkout@v6
with:
ref: "refs/pull/${{ github.event.number }}/merge"

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci_install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
options: --privileged
steps:
- name: Checkout
uses: actions/checkout@v5
uses: actions/checkout@v6
with:
path: needle

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci_license.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
if: github.repository_owner == 'seqan' || github.event_name == 'workflow_dispatch' || github.event.label.name == 'lint'
steps:
- name: Checkout
uses: actions/checkout@v5
uses: actions/checkout@v6

- name: REUSE Compliance Check
uses: fsfe/reuse-action@v6
2 changes: 1 addition & 1 deletion .github/workflows/ci_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
fi

- name: Checkout
uses: actions/checkout@v5
uses: actions/checkout@v6

- name: Setup cache
uses: seqan/actions/setup-actions-cache@main
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci_macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
compiler: ["clang-latest", "clang-second-latest", "clang-third-latest", "gcc-latest", "gcc-second-latest", "gcc-third-latest"]
steps:
- name: Checkout
uses: actions/checkout@v5
uses: actions/checkout@v6

- name: Setup toolchain
uses: seqan/actions/setup-toolchain@main
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cron_codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
image: ghcr.io/seqan/gcc-second-latest
steps:
- name: Checkout
uses: actions/checkout@v5
uses: actions/checkout@v6

- name: Initialize CodeQL
uses: github/codeql-action/init@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cron_sanitizer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ jobs:
image: ${{ matrix.image || '' }}
steps:
- name: Checkout
uses: actions/checkout@v5
uses: actions/checkout@v6

- name: Setup compiler
if: contains(matrix.os, 'macos')
Expand Down
9 changes: 9 additions & 0 deletions cmake/test/config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# SPDX-License-Identifier: CC0-1.0

include (test/coverage)
include (CMakeDependentOption)

CPMGetPackage (googletest)

Expand All @@ -25,6 +26,9 @@ else ()
endif ()
add_definitions (-DBINDIR=\"${NEEDLE_TEST_BINARY_DIR}/\")

option (NEEDLE_DO_NOT_KEEP_TEST_OUTPUT "Delete test output." OFF)
cmake_dependent_option (NEEDLE_DO_NOT_KEEP_TEST_OUTPUT_CI "Delete test output." ON "DEFINED ENV{CI}" OFF)

# Add the test interface library.
if (NOT TARGET ${PROJECT_NAME}_test)
add_library (${PROJECT_NAME}_test INTERFACE)
Expand All @@ -42,6 +46,11 @@ if (NOT TARGET ${PROJECT_NAME}_test)
endif ()
endif ()

if (NEEDLE_DO_NOT_KEEP_TEST_OUTPUT OR NEEDLE_DO_NOT_KEEP_TEST_OUTPUT_CI)
message (STATUS "Deleting test output.")
target_compile_definitions (${PROJECT_NAME}_test INTERFACE "NEEDLE_DO_NOT_KEEP_TEST_OUTPUT")
endif ()

target_link_libraries (${PROJECT_NAME}_test INTERFACE "${PROJECT_NAME}_lib" "GTest::gtest_main")

# !Workaround: Get seqan3 test include dir from seqan3 target
Expand Down
3 changes: 3 additions & 0 deletions test/app_test.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ struct app_test : public ::testing::Test
{
try
{
#ifdef NEEDLE_DO_NOT_KEEP_TEST_OUTPUT
std::filesystem::remove_all(current_workdir);
#endif
std::filesystem::current_path(original_workdir); // restore the original work dir
}
catch (std::exception const & exc)
Expand Down
5 changes: 2 additions & 3 deletions test/cli/insert_options_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,16 @@ TEST_F(insert_options_test, insert_fail_no_argument)

TEST_F(insert_options_test, with_argument)
{
std::filesystem::path tmp_dir = std::filesystem::temp_directory_path();
estimate_ibf_arguments ibf_args{};
minimiser_file_input_arguments minimiser_args{};
ibf_args.expression_thresholds = {1, 2};
std::vector<double> fpr = {0.05};
std::vector<std::filesystem::path> sequence_files = {data("exp_01.fasta")};
ibf_args.path_out = tmp_dir / "Test_";
ibf_args.path_out = "Test_";
std::vector<uint8_t> cutoffs{1};
ibf(sequence_files, ibf_args, minimiser_args, fpr, cutoffs);

app_test_result result = execute_app("insert -i ", tmp_dir / "Test_", data("exp_01.fasta"));
app_test_result result = execute_app("insert -i ", "Test_", data("exp_01.fasta"));
EXPECT_SUCCESS(result);
EXPECT_EQ(result.out, "");
EXPECT_EQ(result.err, std::string{});
Expand Down