diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index dba7b8a9..59a5b6e9 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -3,36 +3,38 @@ on: [push, pull_request] jobs: test_on_ubuntu: runs-on: ubuntu-latest - name: Build on ${{ matrix.distro }} ${{ matrix.arch }} - - strategy: - matrix: - include: - - arch: aarch64 - distro: ubuntu_latest + name: g++-10 steps: - - uses: actions/checkout@v3 - - uses: uraimo/run-on-arch-action@v2 - name: Build and Test - id: build - with: - arch: ${{ matrix.arch }} - distro: ${{ matrix.distro }} - shell: /bin/bash + - name: Checkout oaknut repo + uses: actions/checkout@v3 - install: | - apt-get update -q -y - apt-get install -q -y make cmake g++ git + - name: Install dependencies + run: > + sudo apt-get install -q -y + gcc-10-aarch64-linux-gnu + g++-10-aarch64-linux-gnu + ninja-build + qemu-user - pushd /tmp - git clone https://github.com/catchorg/Catch2.git - cd Catch2 - cmake -Bbuild -H. -DBUILD_TESTING=OFF - cmake --build build/ --target install - popd + - name: Checkout Catch2 v3 repo + run: git clone https://github.com/catchorg/Catch2.git externals/catch - run: | - cmake -Bbuild -H. - cmake --build build - ./build/oaknut-tests + - name: Configure CMake + env: + CC: aarch64-linux-gnu-gcc-10 + CXX: aarch64-linux-gnu-g++-10 + run: > + cmake + -B ${{github.workspace}}/build + -H. + -GNinja + -DDYNARMIC_USE_BUNDLED_CATCH=ON + + - name: Build + working-directory: ${{github.workspace}}/build + run: ninja + + - name: Test + working-directory: ${{github.workspace}}/build + run: qemu-aarch64 -L /usr/aarch64-linux-gnu ./oaknut-tests -d yes diff --git a/CMakeLists.txt b/CMakeLists.txt index b6f139b9..b84422d2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -39,7 +39,11 @@ target_compile_features(oaknut INTERFACE cxx_std_20) # Tests if (MASTER_PROJECT) - find_package(Catch2 3 REQUIRED) + if (DYNARMIC_USE_BUNDLED_CATCH) + add_subdirectory(externals/catch) + else() + find_package(Catch2 3 REQUIRED) + endif() add_executable(oaknut-tests tests/basic.cpp @@ -49,9 +53,4 @@ if (MASTER_PROJECT) target_include_directories(oaknut-tests PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/tests) target_link_libraries(oaknut-tests PRIVATE Catch2::Catch2WithMain merry::oaknut) target_compile_options(oaknut-tests PRIVATE -Wall -Wextra -Wcast-qual -pedantic -pedantic-errors -Wfatal-errors -Wno-missing-braces) - - include(CTest) - include(Catch) - catch_discover_tests(oaknut-tests) - enable_testing() endif() diff --git a/include/oaknut/code_block.hpp b/include/oaknut/code_block.hpp index c7b06664..6b7deac8 100644 --- a/include/oaknut/code_block.hpp +++ b/include/oaknut/code_block.hpp @@ -1,6 +1,9 @@ // SPDX-FileCopyrightText: Copyright (c) 2022 merryhime // SPDX-License-Identifier: MIT +#pragma once + +#include #include #include #include