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:
luigi-rosso
2022-07-19 04:37:30 +00:00
parent 5d5f859d61
commit 5506f4dd56
5 changed files with 52 additions and 3 deletions

View File

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

View File

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