diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index b118bec..e594a4a 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -12,17 +12,26 @@ jobs: - uses: actions/checkout@v4 - uses: lukka/get-cmake@latest with: - cmakeVersion: "~3.25.0" # <--= optional, use most recent 3.25.x version - ninjaVersion: "^1.11.1" # <--= optional, use most recent 1.x version + cmakeVersion: "~3.25.0" + ninjaVersion: "^1.11.1" - name: build run: | mkdir tmp cd tmp - cmake -DMADDY_BUILD_WITH_TESTS=ON .. + cmake -DMADDY_BUILD_WITH_TESTS=ON -DCMAKE_INSTALL_PREFIX=./install .. make -j4 + make install - name: run tests run: | ./build/MaddyTests + - name: test find_package + run: | + cd tests/cmake/find_package + mkdir tmp + cd tmp + cmake -DCMAKE_PREFIX_PATH=../../../tmp/install .. + make -j4 + ./maddy_find_package_example test-on-windows: runs-on: windows-latest @@ -30,8 +39,8 @@ jobs: - uses: actions/checkout@v4 - uses: lukka/get-cmake@latest with: - cmakeVersion: "~3.25.0" # <--= optional, use most recent 3.25.x version - ninjaVersion: "^1.11.1" # <--= optional, use most recent 1.x version + cmakeVersion: "~3.25.0" + ninjaVersion: "^1.11.1" - name: build run: | mkdir tmp @@ -48,8 +57,8 @@ jobs: - uses: actions/checkout@v4 - uses: lukka/get-cmake@latest with: - cmakeVersion: "~3.25.0" # <--= optional, use most recent 3.25.x version - ninjaVersion: "^1.11.1" # <--= optional, use most recent 1.x version + cmakeVersion: "~3.25.0" + ninjaVersion: "^1.11.1" - name: build run: | mkdir tmp diff --git a/tests/cmake/find_package/CMakeLists.txt b/tests/cmake/find_package/CMakeLists.txt new file mode 100644 index 0000000..019b320 --- /dev/null +++ b/tests/cmake/find_package/CMakeLists.txt @@ -0,0 +1,8 @@ +# This project is licensed under the MIT license. For more information see the +# LICENSE file. +cmake_minimum_required(VERSION 3.25) + +find_package(maddy REQUIRED) + +add_executable(maddy_find_package_example main.cpp) +target_link_libraries(maddy_find_package_example PRIVATE maddy::maddy) diff --git a/tests/cmake/find_package/main.cpp b/tests/cmake/find_package/main.cpp new file mode 100644 index 0000000..b78d294 --- /dev/null +++ b/tests/cmake/find_package/main.cpp @@ -0,0 +1,25 @@ +/* + * This project is licensed under the MIT license. For more information see the + * LICENSE file. + * + * This file is a tiny example project to test if find_package works correctly. + */ +#include +#include +#include +#include + +#include "maddy/parser.h" + +int main(int argc, char** argv) +{ + std::shared_ptr parser = std::make_shared(); + + std::stringstream markdownStream; + markdownStream << "# Hello World\n" + << "This is a **bold** text and this is *italic* text.\n"; + + std::cout << parser->Parse(markdownStream) << std::endl; + + return 0; +} diff --git a/tools/format.py b/tools/format.py index d897168..31a9255 100644 --- a/tools/format.py +++ b/tools/format.py @@ -70,6 +70,11 @@ def format_files(dry_run): files_to_format = [] for pattern in patterns: matched_files = glob.glob(pattern, recursive=True) + + for file in matched_files: + if '\/tmp\/' in file or '\\tmp\\' in file: + matched_files.remove(file) + files_to_format.extend(matched_files) if not files_to_format: