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

97
test/tests.h Normal file
View File

@@ -0,0 +1,97 @@
/*
* Copyright (c), Recep Aslantas.
*
* MIT License (MIT), http://opensource.org/licenses/MIT
* Full license can be found in the LICENSE file
*/
#ifndef tests_h
#define tests_h
#include "include/common.h"
/*
* To register a test:
* 1. use TEST_DECLARE() to forward declare test
* 2. use TEST_ENTRY() to add test to list
*/
/* mat4 */
TEST_DECLARE(mat4_identity)
TEST_DECLARE(mat4_mul)
TEST_DECLARE(mat4_all)
TEST_DECLARE(affine)
/* mat3 */
TEST_DECLARE(mat3_identity)
TEST_DECLARE(mat3_mul)
TEST_DECLARE(mat3_inv)
/* camera */
TEST_DECLARE(camera_lookat)
TEST_DECLARE(camera_decomp)
/* project */
TEST_DECLARE(project)
/* utils */
TEST_DECLARE(clamp)
/* euler */
TEST_DECLARE(euler)
/* quat */
TEST_DECLARE(quat)
/* bezier */
TEST_DECLARE(bezier)
/* vec3 */
TEST_DECLARE(vec3)
/* vec4 */
TEST_DECLARE(vec4)
/*****************************************************************************/
TEST_LIST {
/* mat4 */
TEST_ENTRY(mat4_identity)
TEST_ENTRY(mat4_mul)
TEST_ENTRY(mat4_all)
TEST_ENTRY(affine)
/* mat3 */
TEST_ENTRY(mat3_identity)
TEST_ENTRY(mat3_mul)
TEST_ENTRY(mat3_inv)
/* camera */
TEST_ENTRY(camera_lookat)
TEST_ENTRY(camera_decomp)
/* project */
TEST_ENTRY(project)
/* utils */
TEST_ENTRY(clamp)
/* euler */
TEST_ENTRY(euler)
/* quat */
TEST_ENTRY(quat)
/* bezier */
TEST_ENTRY(bezier)
/* vec3 */
TEST_ENTRY(vec3)
/* vec4 */
TEST_ENTRY(vec4)
};
#endif /* tests_h */