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
23 changes: 16 additions & 7 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,35 @@ 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
steps:
- 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
Expand All @@ -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
Expand Down
8 changes: 8 additions & 0 deletions tests/cmake/find_package/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)
25 changes: 25 additions & 0 deletions tests/cmake/find_package/main.cpp
Original file line number Diff line number Diff line change
@@ -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 <iostream>
#include <memory>
#include <sstream>
#include <string>

#include "maddy/parser.h"

int main(int argc, char** argv)
{
std::shared_ptr<maddy::Parser> parser = std::make_shared<maddy::Parser>();

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;
}
5 changes: 5 additions & 0 deletions tools/format.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Loading