Custom Built-in Unit Test Suite (#105)

* tests: new built-in test runner

* tests: update tests for new builtin test api

* tests: print test suite logs

* tests: remove cmocka from build files

* tests: colorize test suite log and remove redundant prints
This commit is contained in:
Recep Aslantas
2019-09-12 06:56:44 +03:00
committed by GitHub
parent 27cc9c3351
commit 9ab9e95ce5
23 changed files with 561 additions and 415 deletions

View File

@@ -7,8 +7,7 @@
#include "test_common.h"
void
test_project(void **state) {
TEST_IMPL(project) {
mat4 model, view, proj, mvp;
vec4 viewport = {0.0f, 0.0f, 800.0f, 600.0f};
vec3 pos = {13.0f, 45.0f, 0.74f};
@@ -25,7 +24,9 @@ test_project(void **state) {
/* unprojected of projected vector must be same as original one */
/* we used 0.01 because of projection floating point errors */
assert_true(fabsf(pos[0] - unprojected[0]) < 0.01);
assert_true(fabsf(pos[1] - unprojected[1]) < 0.01);
assert_true(fabsf(pos[2] - unprojected[2]) < 0.01);
ASSERT(fabsf(pos[0] - unprojected[0]) < 0.01);
ASSERT(fabsf(pos[1] - unprojected[1]) < 0.01);
ASSERT(fabsf(pos[2] - unprojected[2]) < 0.01);
TEST_SUCCESS
}