Skip to content

Commit

Permalink
lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Bill-hbrhbr committed Feb 11, 2025
1 parent 2780b90 commit 531cb78
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 8 deletions.
9 changes: 7 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS
)

find_package(Catch2 3.8.0 REQUIRED)
if (Catch2_FOUND)
if(Catch2_FOUND)
message(STATUS "Found Catch2 ${Catch2_VERSION}.")
else()
message(FATAL_ERROR "Could not find libraries for Catch2.")
Expand All @@ -26,5 +26,10 @@ add_subdirectory(src/ystdlib)

add_executable(unitTest)
target_sources(unitTest PRIVATE src/main.cpp)
target_link_libraries(unitTest PRIVATE ystdlib::testlib Catch2::Catch2WithMain)
target_link_libraries(
unitTest
PRIVATE
ystdlib::testlib
Catch2::Catch2WithMain
)
target_compile_features(unitTest PRIVATE cxx_std_20)
6 changes: 2 additions & 4 deletions src/main.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
#define CATCH_CONFIG_MAIN

#include <catch2/catch_test_macros.hpp>
#include <concepts>
#include <iostream>

#include <catch2/catch_all.hpp>
#include <ystdlib/testlib/hello.hpp>

namespace {
Expand All @@ -15,5 +13,5 @@ requires std::integral<T>
}; // namespace

TEST_CASE("dummy") {
REQUIRE((169 == square(ystdlib::testlib::hello().size())));
REQUIRE((169 == square(ystdlib::testlib::hello().size())));
}
13 changes: 13 additions & 0 deletions taskfiles/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,22 @@ tasks:

clean:
desc: "Removes all built artifacts."
deps:
- ":config-cmake-project"
cmds:
- >-
cmake
--build "{{.G_BUILD_DIR}}"
--parallel {{numCPU}}
--target clean
config-cmake-project:
internal: true
sources:
- "CMakeLists.txt"
- "{{.TASKFILE}}"
generates:
- "{{.G_CMAKE_CACHE}}"
- "{{.G_COMPILE_COMMANDS_DB}}"
cmds:
- "cmake -S '{{.ROOT_DIR}}' -B '{{.G_BUILD_DIR}}'"
2 changes: 1 addition & 1 deletion taskfiles/deps.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ vars:
"Catch2": "v3.8.0"
}
G_DEPS_RELEASES:
ref: 'fromJson .G_DEPS_RELEASES_JSON'
ref: "fromJson .G_DEPS_RELEASES_JSON"

tasks:
install-all:
Expand Down
2 changes: 1 addition & 1 deletion taskfiles/lint-cpp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ tasks:
- "{{.ROOT_DIR}}/.clang-tidy"
- "{{.TASKFILE}}"
deps:
- ":config-cmake-project"
- ":build:config-cmake-project"
- "cpp-configs"
- "venv"
cmds:
Expand Down

0 comments on commit 531cb78

Please sign in to comment.