externals: Update oaknut

Merge commit '04cfab01ba40307ce5421e6dde3598be7eac02bd'
This commit is contained in:
Merry 2022-07-12 20:41:36 +01:00
commit 83f484f190
3 changed files with 38 additions and 34 deletions

View file

@ -3,36 +3,38 @@ on: [push, pull_request]
jobs: jobs:
test_on_ubuntu: test_on_ubuntu:
runs-on: ubuntu-latest runs-on: ubuntu-latest
name: Build on ${{ matrix.distro }} ${{ matrix.arch }} name: g++-10
strategy:
matrix:
include:
- arch: aarch64
distro: ubuntu_latest
steps: steps:
- uses: actions/checkout@v3 - name: Checkout oaknut repo
- uses: uraimo/run-on-arch-action@v2 uses: actions/checkout@v3
name: Build and Test
id: build
with:
arch: ${{ matrix.arch }}
distro: ${{ matrix.distro }}
shell: /bin/bash
install: | - name: Install dependencies
apt-get update -q -y run: >
apt-get install -q -y make cmake g++ git sudo apt-get install -q -y
gcc-10-aarch64-linux-gnu
g++-10-aarch64-linux-gnu
ninja-build
qemu-user
pushd /tmp - name: Checkout Catch2 v3 repo
git clone https://github.com/catchorg/Catch2.git run: git clone https://github.com/catchorg/Catch2.git externals/catch
cd Catch2
cmake -Bbuild -H. -DBUILD_TESTING=OFF
cmake --build build/ --target install
popd
run: | - name: Configure CMake
cmake -Bbuild -H. env:
cmake --build build CC: aarch64-linux-gnu-gcc-10
./build/oaknut-tests 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

View file

@ -39,7 +39,11 @@ target_compile_features(oaknut INTERFACE cxx_std_20)
# Tests # Tests
if (MASTER_PROJECT) 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 add_executable(oaknut-tests
tests/basic.cpp tests/basic.cpp
@ -49,9 +53,4 @@ if (MASTER_PROJECT)
target_include_directories(oaknut-tests PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/tests) target_include_directories(oaknut-tests PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/tests)
target_link_libraries(oaknut-tests PRIVATE Catch2::Catch2WithMain merry::oaknut) 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) 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() endif()

View file

@ -1,6 +1,9 @@
// SPDX-FileCopyrightText: Copyright (c) 2022 merryhime <https://mary.rs> // SPDX-FileCopyrightText: Copyright (c) 2022 merryhime <https://mary.rs>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
#pragma once
#include <algorithm>
#include <cstddef> #include <cstddef>
#include <cstdint> #include <cstdint>
#include <new> #include <new>