mirror of
https://github.com/rive-app/rive-cpp.git
synced 2026-01-18 21:21:17 +01:00
Run tests for rive_tess
Adds ability to run tests when building rive_tess: ``` cd packages/runtime/tess/build/macosx ./build_tess.sh test ``` Also runs them in GitHub Actions. Diffs= 265e9c7aa Run tests for rive_tess
This commit is contained in:
@@ -20,7 +20,7 @@ pushd ..
|
||||
|
||||
CONFIG=debug
|
||||
GRAPHICS=gl
|
||||
|
||||
TEST=false
|
||||
for var in "$@"; do
|
||||
if [[ $var = "release" ]]; then
|
||||
CONFIG=release
|
||||
@@ -34,6 +34,9 @@ for var in "$@"; do
|
||||
if [[ $var = "metal" ]]; then
|
||||
GRAPHICS=metal
|
||||
fi
|
||||
if [[ $var = "test" ]]; then
|
||||
TEST=true
|
||||
fi
|
||||
done
|
||||
|
||||
$PREMAKE --file=./premake5_tess.lua gmake2 --graphics=$GRAPHICS
|
||||
@@ -50,4 +53,7 @@ $DEPENDENCIES/bin/sokol-shdc --input ../src/sokol/shader.glsl --output ../src/so
|
||||
|
||||
make config=$CONFIG -j$(($(sysctl -n hw.physicalcpu) + 1))
|
||||
|
||||
if [[ $TEST = "true" ]]; then
|
||||
macosx/bin/$CONFIG/rive_tess_tests
|
||||
fi
|
||||
popd
|
||||
|
||||
@@ -53,4 +53,34 @@ project "rive_tess_renderer"
|
||||
{ "metal" },
|
||||
{ "d3d" }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
project "rive_tess_tests"
|
||||
kind "ConsoleApp"
|
||||
language "C++"
|
||||
cppdialect "C++17"
|
||||
toolset "clang"
|
||||
targetdir "%{cfg.system}/bin/%{cfg.buildcfg}"
|
||||
objdir "%{cfg.system}/obj/%{cfg.buildcfg}"
|
||||
includedirs {
|
||||
"../../dev/test/include",
|
||||
"../include",
|
||||
rive .. "/include",
|
||||
dependencies .. "/sokol"
|
||||
}
|
||||
files {
|
||||
"../test/**.cpp",
|
||||
}
|
||||
links { "rive_tess_renderer" }
|
||||
buildoptions {"-Wall", "-fno-exceptions", "-fno-rtti", "-Werror=format"}
|
||||
defines {"TESTING"}
|
||||
|
||||
filter "configurations:debug"
|
||||
buildoptions {"-g"}
|
||||
defines {"DEBUG"}
|
||||
symbols "On"
|
||||
|
||||
filter "configurations:release"
|
||||
buildoptions {"-flto=full"}
|
||||
defines {"RELEASE", "NDEBUG"}
|
||||
optimize "On"
|
||||
6
tess/test/main_test.cpp
Normal file
6
tess/test/main_test.cpp
Normal file
@@ -0,0 +1,6 @@
|
||||
// The only purpose of this file is to DEFINE the catch config so it can include
|
||||
// main()
|
||||
|
||||
#define CATCH_CONFIG_MAIN // This tells Catch to provide a main() - only do this
|
||||
// in one cpp file
|
||||
#include <catch.hpp>
|
||||
Reference in New Issue
Block a user