Squashed 'externals/oaknut/' changes from 86f2ca872..c2cb5ec49

c2cb5ec49 github: Faster CI
1ed4284bc code_block: Correct headers

git-subtree-dir: externals/oaknut
git-subtree-split: c2cb5ec49aa4a0748172a6a93df6a0fb17368183
This commit is contained in:
Merry 2022-07-12 20:41:36 +01:00
parent 621367dce8
commit 04cfab01ba
3 changed files with 38 additions and 34 deletions

View file

@ -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

View file

@ -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()

View file

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