From cb23db34b8f7ce8fec4733cf40176305ad124dc4 Mon Sep 17 00:00:00 2001 From: Yann Herklotz Date: Fri, 18 May 2018 19:57:29 +0100 Subject: Renaming tests and improving travis file --- scripts/travis_build | 2 +- tests/CMakeLists.txt | 23 +- tests/active/test.cpp | 46 -- tests/active_test.cpp | 46 ++ tests/engine/entities.json | 23 - tests/engine/test.cpp | 19 - tests/log/test.cpp | 19 - tests/matrix/test.cpp | 65 --- tests/matrix_test.cpp | 65 +++ tests/particlebody/test.cpp | 41 -- tests/particlebody_test.cpp | 41 ++ tests/spritesheet/floor_atlas.json | 1026 ------------------------------------ tests/spritesheet/floor_atlas.png | Bin 234876 -> 0 bytes tests/spritesheet/test.cpp | 23 - tests/struct/test.cpp | 57 -- tests/struct_test.cpp | 57 ++ tests/syncqueue/test.cpp | 53 -- tests/testshared.h | 5 +- tests/thread/test.cpp | 29 - tests/vector3/test.cpp | 62 --- tests/vector3_test.cpp | 62 +++ tests/vector4/test.cpp | 67 --- tests/vector4_test.cpp | 67 +++ tests/window/test.cpp | 21 - tests/yage/test.cpp | 26 - tests/yage_test.cpp | 22 + 26 files changed, 370 insertions(+), 1597 deletions(-) delete mode 100644 tests/active/test.cpp create mode 100644 tests/active_test.cpp delete mode 100644 tests/engine/entities.json delete mode 100644 tests/engine/test.cpp delete mode 100644 tests/log/test.cpp delete mode 100644 tests/matrix/test.cpp create mode 100644 tests/matrix_test.cpp delete mode 100644 tests/particlebody/test.cpp create mode 100644 tests/particlebody_test.cpp delete mode 100644 tests/spritesheet/floor_atlas.json delete mode 100644 tests/spritesheet/floor_atlas.png delete mode 100644 tests/spritesheet/test.cpp delete mode 100644 tests/struct/test.cpp create mode 100644 tests/struct_test.cpp delete mode 100644 tests/syncqueue/test.cpp delete mode 100644 tests/thread/test.cpp delete mode 100644 tests/vector3/test.cpp create mode 100644 tests/vector3_test.cpp delete mode 100644 tests/vector4/test.cpp create mode 100644 tests/vector4_test.cpp delete mode 100644 tests/window/test.cpp delete mode 100644 tests/yage/test.cpp create mode 100644 tests/yage_test.cpp diff --git a/scripts/travis_build b/scripts/travis_build index ed2fdd0a..9d431e39 100755 --- a/scripts/travis_build +++ b/scripts/travis_build @@ -13,7 +13,7 @@ cd build cmake .. make cd tests -ctest +ctest -j 2 --schedule-random --repeat-until-fail 3 cd ../.. # update docs if we are on the master branch diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 5b7d6fd3..08c8d541 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -12,24 +12,17 @@ add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/external/googletest) enable_testing() set(SIMULATION_RUNS 1000) -function(make_test test_name cycles) - add_executable("${test_name}test" ${test_name}/test.cpp) +function(make_test test_file_name cycles) + string(REPLACE "_test.cpp" "" test_name ${test_file_name}) + add_executable("${test_name}test" ${test_file_name}) target_link_libraries("${test_name}test" gtest_main yage) add_test(NAME ${test_name} COMMAND "${test_name}test" --gtest_repeat=${cycles} --gtest_break_on_failure) endfunction(make_test) -make_test(yage 1) -make_test(matrix ${SIMULATION_RUNS}) -make_test(particlebody 100) -make_test(window ${SIMULATION_RUNS}) -make_test(spritesheet ${SIMULATION_RUNS}) -make_test(vector3 ${SIMULATION_RUNS}) -make_test(vector4 ${SIMULATION_RUNS}) -make_test(log 1) -make_test(thread 1) -make_test(syncqueue 1) -make_test(active 1) -make_test(struct ${SIMULATION_RUNS}) -make_test(engine ${SIMULATION_RUNS}) +file(GLOB YAGE_TEST_SOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *_test.cpp) + +foreach(yage_test ${YAGE_TEST_SOURCES}) + make_test(${yage_test} 100) +endforeach() diff --git a/tests/active/test.cpp b/tests/active/test.cpp deleted file mode 100644 index d907a1cc..00000000 --- a/tests/active/test.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/** --------------------------------------------------------------------------- - * @file: test.cpp - * - * Copyright (c) 2017 Yann Herklotz Grave - * MIT License, see LICENSE file for more details. - * ---------------------------------------------------------------------------- - */ - -#include - -#include - -using namespace yage; - -void print_random() -{ - std::cout << "hello world" - << "\n"; -} - -void print_h() -{ - std::cout << "Helllllllo" - << "\n"; -} - -void flush() -{ - std::cout << "flush" << std::endl; -} - -int main() -{ - auto a = Active::create(); - - a->send(print_random); - a->send(print_h); - a->send(flush); - - std::cout << std::endl; - - for (int i = 0; i < 1000000; i++) { - } - - std::cout << std::endl; -} diff --git a/tests/active_test.cpp b/tests/active_test.cpp new file mode 100644 index 00000000..d907a1cc --- /dev/null +++ b/tests/active_test.cpp @@ -0,0 +1,46 @@ +/** --------------------------------------------------------------------------- + * @file: test.cpp + * + * Copyright (c) 2017 Yann Herklotz Grave + * MIT License, see LICENSE file for more details. + * ---------------------------------------------------------------------------- + */ + +#include + +#include + +using namespace yage; + +void print_random() +{ + std::cout << "hello world" + << "\n"; +} + +void print_h() +{ + std::cout << "Helllllllo" + << "\n"; +} + +void flush() +{ + std::cout << "flush" << std::endl; +} + +int main() +{ + auto a = Active::create(); + + a->send(print_random); + a->send(print_h); + a->send(flush); + + std::cout << std::endl; + + for (int i = 0; i < 1000000; i++) { + } + + std::cout << std::endl; +} diff --git a/tests/engine/entities.json b/tests/engine/entities.json deleted file mode 100644 index 25959311..00000000 --- a/tests/engine/entities.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "Entities": [ - { - "name": "Object1", - "mass": "Hello", - "position": [ - 0, - 0, - 0 - ], - "velocity": [ - 0, - 0, - 0 - ], - "acceleration": [ - 0, - 0, - 0 - ] - } - ] -} diff --git a/tests/engine/test.cpp b/tests/engine/test.cpp deleted file mode 100644 index 5095a974..00000000 --- a/tests/engine/test.cpp +++ /dev/null @@ -1,19 +0,0 @@ -#include - -#include - -int main() -{ - yage::Space space; - auto entity = space.createEntity(); - auto entity2 = space.createEntity(); - auto entity3 = space.createEntity(); - auto entity4 = space.createEntity(); - - yLogInfo << "Entity 1: " << entity; - yLogInfo << "Entity 3: " << entity3; - yLogInfo << "Entity 2: " << entity2; - yLogInfo << "Entity 4: " << entity4; - - return 0; -} diff --git a/tests/log/test.cpp b/tests/log/test.cpp deleted file mode 100644 index d7e50540..00000000 --- a/tests/log/test.cpp +++ /dev/null @@ -1,19 +0,0 @@ -/** --------------------------------------------------------------------------- - * @file: test.cpp - * - * Copyright (c) 2017 Yann Herklotz Grave - * MIT License, see LICENSE file for more details. - * ---------------------------------------------------------------------------- - */ - -#include - -#include - -int main() -{ - yLogError << "First message"; - - yLogError << "Second Message"; - std::cout << "COUT\n"; -} diff --git a/tests/matrix/test.cpp b/tests/matrix/test.cpp deleted file mode 100644 index 022775af..00000000 --- a/tests/matrix/test.cpp +++ /dev/null @@ -1,65 +0,0 @@ -/** --------------------------------------------------------------------------- - * @file: test.cpp - * - * Copyright (c) 2017 Yann Herklotz Grave - * MIT License, see LICENSE file for more details. - * ---------------------------------------------------------------------------- - */ - -#include -#include - -#include -#include -#include -#include - -// TESTS - -TEST(Matrix, Assign) -{ - double rand_num = rand(); - yage::Matrix<5, 5, double> mat1; - - mat1[3][2] = rand_num; - - ASSERT_EQ(rand_num, mat1[3][2]); - - yage::Matrix<2, 2, double> mat2{{rand_num, rand_num, rand_num, rand_num}}; - - ASSERT_EQ(rand_num, mat2[1][0]); -} - -TEST(Matrix, Addition) -{ - int rand_x = rand(); - int rand_y = rand(); - yage::Matrix<5, 5, int> m1, m2; - - m1[2][4] = rand_x; - m2[2][4] = rand_y; - - ASSERT_EQ(rand_x + rand_y, (m1 + m2)[2][4]); -} - -TEST(Vector, DotProduct) -{ - std::vector contents_i = {rand() % 100, rand() % 100, rand() % 100}; - std::vector contents_j = {rand() % 100, rand() % 100, rand() % 100}; - yage::Vector<3, int> v1{contents_i}; - yage::Vector<3, int> v2{contents_j}; - - int sum = 0; - for (std::size_t i = 0; i < contents_i.size(); ++i) { - sum += contents_i[i] * contents_j[i]; - } - - ASSERT_EQ(sum, yage::matrix::dot(v1, v2)); -} - -int main(int argc, char **argv) -{ - srand(static_cast(time(nullptr))); - testing::InitGoogleTest(&argc, argv); - return RUN_ALL_TESTS(); -} diff --git a/tests/matrix_test.cpp b/tests/matrix_test.cpp new file mode 100644 index 00000000..022775af --- /dev/null +++ b/tests/matrix_test.cpp @@ -0,0 +1,65 @@ +/** --------------------------------------------------------------------------- + * @file: test.cpp + * + * Copyright (c) 2017 Yann Herklotz Grave + * MIT License, see LICENSE file for more details. + * ---------------------------------------------------------------------------- + */ + +#include +#include + +#include +#include +#include +#include + +// TESTS + +TEST(Matrix, Assign) +{ + double rand_num = rand(); + yage::Matrix<5, 5, double> mat1; + + mat1[3][2] = rand_num; + + ASSERT_EQ(rand_num, mat1[3][2]); + + yage::Matrix<2, 2, double> mat2{{rand_num, rand_num, rand_num, rand_num}}; + + ASSERT_EQ(rand_num, mat2[1][0]); +} + +TEST(Matrix, Addition) +{ + int rand_x = rand(); + int rand_y = rand(); + yage::Matrix<5, 5, int> m1, m2; + + m1[2][4] = rand_x; + m2[2][4] = rand_y; + + ASSERT_EQ(rand_x + rand_y, (m1 + m2)[2][4]); +} + +TEST(Vector, DotProduct) +{ + std::vector contents_i = {rand() % 100, rand() % 100, rand() % 100}; + std::vector contents_j = {rand() % 100, rand() % 100, rand() % 100}; + yage::Vector<3, int> v1{contents_i}; + yage::Vector<3, int> v2{contents_j}; + + int sum = 0; + for (std::size_t i = 0; i < contents_i.size(); ++i) { + sum += contents_i[i] * contents_j[i]; + } + + ASSERT_EQ(sum, yage::matrix::dot(v1, v2)); +} + +int main(int argc, char **argv) +{ + srand(static_cast(time(nullptr))); + testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} diff --git a/tests/particlebody/test.cpp b/tests/particlebody/test.cpp deleted file mode 100644 index 65c26d5d..00000000 --- a/tests/particlebody/test.cpp +++ /dev/null @@ -1,41 +0,0 @@ -/** --------------------------------------------------------------------------- - * @file: test.cpp - * - * Copyright (c) 2017 Yann Herklotz Grave - * MIT License, see LICENSE file for more details. - * ---------------------------------------------------------------------------- - */ - -#include -#include - -#include -#include - -double gravityAcceleration(int iterations) -{ - yage::ParticleBody body; - for (int i = 0; i < 60 * iterations; ++i) { - body.update(); - } - - return body.yPosition(); -} - -// Tests - -TEST(ParticleBody, Gravity) -{ - int randomItr = rand() % 10; - double idealPosition = 0.5 * -9.81 * std::pow(randomItr, 2); - - ASSERT_GE(idealPosition * 0.95, gravityAcceleration(randomItr)); - ASSERT_LE(idealPosition * 1.05, gravityAcceleration(randomItr)); -} - -int main(int argc, char **argv) -{ - testing::InitGoogleTest(&argc, argv); - srand(static_cast(time(nullptr))); - return RUN_ALL_TESTS(); -} diff --git a/tests/particlebody_test.cpp b/tests/particlebody_test.cpp new file mode 100644 index 00000000..5716d3ac --- /dev/null +++ b/tests/particlebody_test.cpp @@ -0,0 +1,41 @@ +/** --------------------------------------------------------------------------- + * @file: test.cpp + * + * Copyright (c) 2017 Yann Herklotz Grave + * MIT License, see LICENSE file for more details. + * ---------------------------------------------------------------------------- + */ + +#include +#include + +#include +#include + +double gravityAcceleration(int iterations) +{ + yage::ParticleBody body; + for (int i = 0; i < 60 * iterations; ++i) { + body.update(); + } + + return body.yPosition(); +} + +// Tests + +TEST(ParticleBody, Gravity) +{ + int randomItr = rand() % 10; + double idealPosition = 0.5 * -9.81 * std::pow(randomItr, 2); + + ASSERT_GE(idealPosition * 0.95, gravityAcceleration(randomItr)); + ASSERT_LE(idealPosition * 1.05, gravityAcceleration(randomItr)); +} + +int main(int argc, char **argv) +{ + testing::InitGoogleTest(&argc, argv); + srand(static_cast(time(nullptr))); + return RUN_ALL_TESTS(); +} diff --git a/tests/spritesheet/floor_atlas.json b/tests/spritesheet/floor_atlas.json deleted file mode 100644 index e6defd22..00000000 --- a/tests/spritesheet/floor_atlas.json +++ /dev/null @@ -1,1026 +0,0 @@ -{ - "width": 512, - "height": 352, - "sprites": { - "sandstone_floor6.png": { - "x": 0, - "y": 0, - "width": 32, - "height": 32 - }, - "pedestal_ne.png": { - "x": 32, - "y": 0, - "width": 32, - "height": 32 - }, - "marble_floor4.png": { - "x": 64, - "y": 0, - "width": 32, - "height": 32 - }, - "pebble_brown2.png": { - "x": 96, - "y": 0, - "width": 32, - "height": 32 - }, - "sandstone_floor4.png": { - "x": 128, - "y": 0, - "width": 32, - "height": 32 - }, - "hive2.png": { - "x": 160, - "y": 0, - "width": 32, - "height": 32 - }, - "lair1.png": { - "x": 192, - "y": 0, - "width": 32, - "height": 32 - }, - "crystal_floor3.png": { - "x": 224, - "y": 0, - "width": 32, - "height": 32 - }, - "volcanic_floor1.png": { - "x": 256, - "y": 0, - "width": 32, - "height": 32 - }, - "snake2.png": { - "x": 288, - "y": 0, - "width": 32, - "height": 32 - }, - "lava2.png": { - "x": 320, - "y": 0, - "width": 32, - "height": 32 - }, - "cobble_blood5.png": { - "x": 352, - "y": 0, - "width": 32, - "height": 32 - }, - "dirt_ne.png": { - "x": 384, - "y": 0, - "width": 32, - "height": 32 - }, - "mesh2.png": { - "x": 416, - "y": 0, - "width": 32, - "height": 32 - }, - "cobble_blood7.png": { - "x": 448, - "y": 0, - "width": 32, - "height": 32 - }, - "sandstone_floor2.png": { - "x": 480, - "y": 0, - "width": 32, - "height": 32 - }, - "dirt_e.png": { - "x": 0, - "y": 32, - "width": 32, - "height": 32 - }, - "pedestal_se.png": { - "x": 32, - "y": 32, - "width": 32, - "height": 32 - }, - "rough_red0.png": { - "x": 64, - "y": 32, - "width": 32, - "height": 32 - }, - "grey_dirt2.png": { - "x": 96, - "y": 32, - "width": 32, - "height": 32 - }, - "bog_green2.png": { - "x": 128, - "y": 32, - "width": 32, - "height": 32 - }, - "floor_sand_stone3.png": { - "x": 160, - "y": 32, - "width": 32, - "height": 32 - }, - "tomb0.png": { - "x": 192, - "y": 32, - "width": 32, - "height": 32 - }, - "pedestal_sw.png": { - "x": 224, - "y": 32, - "width": 32, - "height": 32 - }, - "pebble_brown3.png": { - "x": 256, - "y": 32, - "width": 32, - "height": 32 - }, - "floor_vines3.png": { - "x": 288, - "y": 32, - "width": 32, - "height": 32 - }, - "pebble_brown1.png": { - "x": 320, - "y": 32, - "width": 32, - "height": 32 - }, - "crystal_floor0.png": { - "x": 352, - "y": 32, - "width": 32, - "height": 32 - }, - "rect_gray3.png": { - "x": 384, - "y": 32, - "width": 32, - "height": 32 - }, - "floor_sand_stone4.png": { - "x": 416, - "y": 32, - "width": 32, - "height": 32 - }, - "floor_sand_stone0.png": { - "x": 448, - "y": 32, - "width": 32, - "height": 32 - }, - "cobble_blood6.png": { - "x": 480, - "y": 32, - "width": 32, - "height": 32 - }, - "floor_nerves2.png": { - "x": 0, - "y": 64, - "width": 32, - "height": 32 - }, - "ice2.png": { - "x": 32, - "y": 64, - "width": 32, - "height": 32 - }, - "lair0.png": { - "x": 64, - "y": 64, - "width": 32, - "height": 32 - }, - "rough_red1.png": { - "x": 96, - "y": 64, - "width": 32, - "height": 32 - }, - "pebble_brown0.png": { - "x": 128, - "y": 64, - "width": 32, - "height": 32 - }, - "snake3.png": { - "x": 160, - "y": 64, - "width": 32, - "height": 32 - }, - "volcanic_floor2.png": { - "x": 192, - "y": 64, - "width": 32, - "height": 32 - }, - "pebble_brown7.png": { - "x": 224, - "y": 64, - "width": 32, - "height": 32 - }, - "floor_sand_stone1.png": { - "x": 256, - "y": 64, - "width": 32, - "height": 32 - }, - "floor_nerves6.png": { - "x": 288, - "y": 64, - "width": 32, - "height": 32 - }, - "cobble_blood10.png": { - "x": 320, - "y": 64, - "width": 32, - "height": 32 - }, - "dirt_n.png": { - "x": 352, - "y": 64, - "width": 32, - "height": 32 - }, - "mesh0.png": { - "x": 384, - "y": 64, - "width": 32, - "height": 32 - }, - "sandstone_floor7.png": { - "x": 416, - "y": 64, - "width": 32, - "height": 32 - }, - "volcanic_floor6.png": { - "x": 448, - "y": 64, - "width": 32, - "height": 32 - }, - "sandstone_floor0.png": { - "x": 480, - "y": 64, - "width": 32, - "height": 32 - }, - "rough_red3.png": { - "x": 0, - "y": 96, - "width": 32, - "height": 32 - }, - "pedestal_e.png": { - "x": 32, - "y": 96, - "width": 32, - "height": 32 - }, - "ice1.png": { - "x": 64, - "y": 96, - "width": 32, - "height": 32 - }, - "floor_nerves0.png": { - "x": 96, - "y": 96, - "width": 32, - "height": 32 - }, - "swamp0.png": { - "x": 128, - "y": 96, - "width": 32, - "height": 32 - }, - "dirt2.png": { - "x": 160, - "y": 96, - "width": 32, - "height": 32 - }, - "floor_sand_stone6.png": { - "x": 192, - "y": 96, - "width": 32, - "height": 32 - }, - "pedestal_s.png": { - "x": 224, - "y": 96, - "width": 32, - "height": 32 - }, - "pedestal_full.png": { - "x": 256, - "y": 96, - "width": 32, - "height": 32 - }, - "volcanic_floor4.png": { - "x": 288, - "y": 96, - "width": 32, - "height": 32 - }, - "pebble_brown4.png": { - "x": 320, - "y": 96, - "width": 32, - "height": 32 - }, - "dirt1.png": { - "x": 352, - "y": 96, - "width": 32, - "height": 32 - }, - "sandstone_floor5.png": { - "x": 384, - "y": 96, - "width": 32, - "height": 32 - }, - "rough_red2.png": { - "x": 416, - "y": 96, - "width": 32, - "height": 32 - }, - "rect_gray0.png": { - "x": 448, - "y": 96, - "width": 32, - "height": 32 - }, - "rect_gray2.png": { - "x": 480, - "y": 96, - "width": 32, - "height": 32 - }, - "floor_nerves5.png": { - "x": 0, - "y": 128, - "width": 32, - "height": 32 - }, - "swamp2.png": { - "x": 32, - "y": 128, - "width": 32, - "height": 32 - }, - "grey_dirt7.png": { - "x": 64, - "y": 128, - "width": 32, - "height": 32 - }, - "cobble_blood8.png": { - "x": 96, - "y": 128, - "width": 32, - "height": 32 - }, - "grey_dirt0.png": { - "x": 128, - "y": 128, - "width": 32, - "height": 32 - }, - "cobble_blood1.png": { - "x": 160, - "y": 128, - "width": 32, - "height": 32 - }, - "volcanic_floor3.png": { - "x": 192, - "y": 128, - "width": 32, - "height": 32 - }, - "lair2.png": { - "x": 224, - "y": 128, - "width": 32, - "height": 32 - }, - "lava0.png": { - "x": 256, - "y": 128, - "width": 32, - "height": 32 - }, - "cobble_blood4.png": { - "x": 288, - "y": 128, - "width": 32, - "height": 32 - }, - "grey_dirt1.png": { - "x": 320, - "y": 128, - "width": 32, - "height": 32 - }, - "pedestal_nw.png": { - "x": 352, - "y": 128, - "width": 32, - "height": 32 - }, - "crystal_floor5.png": { - "x": 384, - "y": 128, - "width": 32, - "height": 32 - }, - "bog_green3.png": { - "x": 416, - "y": 128, - "width": 32, - "height": 32 - }, - "marble_floor2.png": { - "x": 448, - "y": 128, - "width": 32, - "height": 32 - }, - "mesh3.png": { - "x": 480, - "y": 128, - "width": 32, - "height": 32 - }, - "pedestal_w.png": { - "x": 0, - "y": 160, - "width": 32, - "height": 32 - }, - "swamp1.png": { - "x": 32, - "y": 160, - "width": 32, - "height": 32 - }, - "snake0.png": { - "x": 64, - "y": 160, - "width": 32, - "height": 32 - }, - "crystal_floor4.png": { - "x": 96, - "y": 160, - "width": 32, - "height": 32 - }, - "cobble_blood12.png": { - "x": 128, - "y": 160, - "width": 32, - "height": 32 - }, - "floor_vines4.png": { - "x": 160, - "y": 160, - "width": 32, - "height": 32 - }, - "floor_vines2.png": { - "x": 192, - "y": 160, - "width": 32, - "height": 32 - }, - "floor_nerves1.png": { - "x": 224, - "y": 160, - "width": 32, - "height": 32 - }, - "snake1.png": { - "x": 256, - "y": 160, - "width": 32, - "height": 32 - }, - "dirt_sw.png": { - "x": 288, - "y": 160, - "width": 32, - "height": 32 - }, - "dirt0.png": { - "x": 320, - "y": 160, - "width": 32, - "height": 32 - }, - "hive0.png": { - "x": 352, - "y": 160, - "width": 32, - "height": 32 - }, - "grey_dirt3.png": { - "x": 384, - "y": 160, - "width": 32, - "height": 32 - }, - "floor_nerves3.png": { - "x": 416, - "y": 160, - "width": 32, - "height": 32 - }, - "marble_floor5.png": { - "x": 448, - "y": 160, - "width": 32, - "height": 32 - }, - "bog_green1.png": { - "x": 480, - "y": 160, - "width": 32, - "height": 32 - }, - "sandstone_floor3.png": { - "x": 0, - "y": 192, - "width": 32, - "height": 32 - }, - "bog_green0.png": { - "x": 32, - "y": 192, - "width": 32, - "height": 32 - }, - "pedestal_n.png": { - "x": 64, - "y": 192, - "width": 32, - "height": 32 - }, - "hive1.png": { - "x": 96, - "y": 192, - "width": 32, - "height": 32 - }, - "pebble_brown6.png": { - "x": 128, - "y": 192, - "width": 32, - "height": 32 - }, - "floor_sand_stone2.png": { - "x": 160, - "y": 192, - "width": 32, - "height": 32 - }, - "cobble_blood3.png": { - "x": 192, - "y": 192, - "width": 32, - "height": 32 - }, - "sandstone_floor9.png": { - "x": 224, - "y": 192, - "width": 32, - "height": 32 - }, - "swamp3.png": { - "x": 256, - "y": 192, - "width": 32, - "height": 32 - }, - "ice0.png": { - "x": 288, - "y": 192, - "width": 32, - "height": 32 - }, - "marble_floor3.png": { - "x": 320, - "y": 192, - "width": 32, - "height": 32 - }, - "volcanic_floor5.png": { - "x": 352, - "y": 192, - "width": 32, - "height": 32 - }, - "floor_vines6.png": { - "x": 384, - "y": 192, - "width": 32, - "height": 32 - }, - "tutorial_pad.png": { - "x": 416, - "y": 192, - "width": 32, - "height": 32 - }, - "dirt_nw.png": { - "x": 448, - "y": 192, - "width": 32, - "height": 32 - }, - "floor_vines0.png": { - "x": 480, - "y": 192, - "width": 32, - "height": 32 - }, - "grey_dirt4.png": { - "x": 0, - "y": 224, - "width": 32, - "height": 32 - }, - "marble_floor6.png": { - "x": 32, - "y": 224, - "width": 32, - "height": 32 - }, - "grey_dirt6.png": { - "x": 64, - "y": 224, - "width": 32, - "height": 32 - }, - "crystal_floor1.png": { - "x": 96, - "y": 224, - "width": 32, - "height": 32 - }, - "cobble_blood9.png": { - "x": 128, - "y": 224, - "width": 32, - "height": 32 - }, - "ice3.png": { - "x": 160, - "y": 224, - "width": 32, - "height": 32 - }, - "floor_nerves4.png": { - "x": 192, - "y": 224, - "width": 32, - "height": 32 - }, - "dirt_w.png": { - "x": 224, - "y": 224, - "width": 32, - "height": 32 - }, - "pebble_brown5.png": { - "x": 256, - "y": 224, - "width": 32, - "height": 32 - }, - "lair3.png": { - "x": 288, - "y": 224, - "width": 32, - "height": 32 - }, - "rect_gray1.png": { - "x": 320, - "y": 224, - "width": 32, - "height": 32 - }, - "tomb3.png": { - "x": 352, - "y": 224, - "width": 32, - "height": 32 - }, - "floor_vines1.png": { - "x": 384, - "y": 224, - "width": 32, - "height": 32 - }, - "grey_dirt5.png": { - "x": 416, - "y": 224, - "width": 32, - "height": 32 - }, - "floor_vines5.png": { - "x": 448, - "y": 224, - "width": 32, - "height": 32 - }, - "sandstone_floor1.png": { - "x": 480, - "y": 224, - "width": 32, - "height": 32 - }, - "floor_sand_stone5.png": { - "x": 0, - "y": 256, - "width": 32, - "height": 32 - }, - "dirt_se.png": { - "x": 32, - "y": 256, - "width": 32, - "height": 32 - }, - "grass/grass_full.png": { - "x": 64, - "y": 256, - "width": 32, - "height": 32 - }, - "grass/grass1.png": { - "x": 96, - "y": 256, - "width": 32, - "height": 32 - }, - "grass/grass_flowers_yellow2.png": { - "x": 128, - "y": 256, - "width": 32, - "height": 32 - }, - "grass/grass_s.png": { - "x": 160, - "y": 256, - "width": 32, - "height": 32 - }, - "grass/grass_se.png": { - "x": 192, - "y": 256, - "width": 32, - "height": 32 - }, - "grass/grass_flowers_red2.png": { - "x": 224, - "y": 256, - "width": 32, - "height": 32 - }, - "grass/grass2.png": { - "x": 256, - "y": 256, - "width": 32, - "height": 32 - }, - "grass/grass0-dirt-mix2.png": { - "x": 288, - "y": 256, - "width": 32, - "height": 32 - }, - "grass/grass_flowers_blue3.png": { - "x": 320, - "y": 256, - "width": 32, - "height": 32 - }, - "grass/grass_flowers_blue2.png": { - "x": 352, - "y": 256, - "width": 32, - "height": 32 - }, - "grass/grass_flowers_blue1.png": { - "x": 384, - "y": 256, - "width": 32, - "height": 32 - }, - "grass/grass0-dirt-mix1.png": { - "x": 416, - "y": 256, - "width": 32, - "height": 32 - }, - "grass/grass_flowers_red1.png": { - "x": 448, - "y": 256, - "width": 32, - "height": 32 - }, - "grass/grass_flowers_yellow3.png": { - "x": 480, - "y": 256, - "width": 32, - "height": 32 - }, - "grass/grass_sw.png": { - "x": 0, - "y": 288, - "width": 32, - "height": 32 - }, - "grass/grass_flowers_yellow1.png": { - "x": 32, - "y": 288, - "width": 32, - "height": 32 - }, - "grass/grass_nw.png": { - "x": 64, - "y": 288, - "width": 32, - "height": 32 - }, - "grass/grass_w.png": { - "x": 96, - "y": 288, - "width": 32, - "height": 32 - }, - "grass/grass_n.png": { - "x": 128, - "y": 288, - "width": 32, - "height": 32 - }, - "grass/grass_e.png": { - "x": 160, - "y": 288, - "width": 32, - "height": 32 - }, - "grass/grass_ne.png": { - "x": 192, - "y": 288, - "width": 32, - "height": 32 - }, - "grass/grass0-dirt-mix3.png": { - "x": 224, - "y": 288, - "width": 32, - "height": 32 - }, - "grass/grass0.png": { - "x": 256, - "y": 288, - "width": 32, - "height": 32 - }, - "grass/grass_flowers_red3.png": { - "x": 288, - "y": 288, - "width": 32, - "height": 32 - }, - "crystal_floor2.png": { - "x": 320, - "y": 288, - "width": 32, - "height": 32 - }, - "tomb2.png": { - "x": 352, - "y": 288, - "width": 32, - "height": 32 - }, - "cobble_blood11.png": { - "x": 384, - "y": 288, - "width": 32, - "height": 32 - }, - "cobble_blood2.png": { - "x": 416, - "y": 288, - "width": 32, - "height": 32 - }, - "lava3.png": { - "x": 448, - "y": 288, - "width": 32, - "height": 32 - }, - "volcanic_floor0.png": { - "x": 480, - "y": 288, - "width": 32, - "height": 32 - }, - "mesh1.png": { - "x": 0, - "y": 320, - "width": 32, - "height": 32 - }, - "dirt_full.png": { - "x": 32, - "y": 320, - "width": 32, - "height": 32 - }, - "lava1.png": { - "x": 64, - "y": 320, - "width": 32, - "height": 32 - }, - "tomb1.png": { - "x": 96, - "y": 320, - "width": 32, - "height": 32 - }, - "dirt_s.png": { - "x": 128, - "y": 320, - "width": 32, - "height": 32 - }, - "marble_floor1.png": { - "x": 160, - "y": 320, - "width": 32, - "height": 32 - }, - "floor_sand_stone7.png": { - "x": 192, - "y": 320, - "width": 32, - "height": 32 - }, - "hive3.png": { - "x": 224, - "y": 320, - "width": 32, - "height": 32 - }, - "pebble_brown8.png": { - "x": 256, - "y": 320, - "width": 32, - "height": 32 - }, - "sandstone_floor8.png": { - "x": 288, - "y": 320, - "width": 32, - "height": 32 - } - } -} diff --git a/tests/spritesheet/floor_atlas.png b/tests/spritesheet/floor_atlas.png deleted file mode 100644 index 61a5e90a..00000000 Binary files a/tests/spritesheet/floor_atlas.png and /dev/null differ diff --git a/tests/spritesheet/test.cpp b/tests/spritesheet/test.cpp deleted file mode 100644 index 1955d63e..00000000 --- a/tests/spritesheet/test.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/** --------------------------------------------------------------------------- - * @file: test.cpp - * - * Copyright (c) 2017 Yann Herklotz Grave - * MIT License, see LICENSE file for more details. - * ---------------------------------------------------------------------------- - */ - -#include -#include - -#include "../testshared.h" - -using namespace yage; - -TEST(SpriteSheet, Load) -{ - yLogDebug << IoManager::parentDirectory(__FILE__) << '\n' << __FILE__; - SpriteSheet sp(IoManager::parentDirectory(__FILE__), IoManager::parentDirectory(__FILE__)); - ASSERT_TRUE(true); -} - -OPENGL_TEST_MAIN(LogLevel::DEBUG) diff --git a/tests/struct/test.cpp b/tests/struct/test.cpp deleted file mode 100644 index 0288f06b..00000000 --- a/tests/struct/test.cpp +++ /dev/null @@ -1,57 +0,0 @@ -/** --------------------------------------------------------------------------- - * @file: test.cpp - * - * Copyright (c) 2017 Yann Herklotz Grave - * MIT License, see LICENSE file for more details. - * ---------------------------------------------------------------------------- - */ - -#include -#include - -#include -#include - -TEST(StructTest, ColourDefault) -{ - yage::Colour c; - ASSERT_EQ(c.r, 0); - ASSERT_EQ(c.g, 0); - ASSERT_EQ(c.b, 0); - ASSERT_EQ(c.a, 0); -} - -TEST(StructTest, ColourConstructor) -{ - int r = rand() % 255, g = rand() % 255, b = rand() % 255, a = rand() % 255; - yage::Colour c(r, g, b, a); - - ASSERT_EQ(c.r, r); - ASSERT_EQ(c.g, g); - ASSERT_EQ(c.b, b); - ASSERT_EQ(c.a, a); -} - -TEST(StructTest, TextureDefault) -{ - yage::Texture t; - ASSERT_EQ(t.id, static_cast(0)); - ASSERT_EQ(t.width, 0); - ASSERT_EQ(t.height, 0); -} - -TEST(StructTest, TextureConstructor) -{ - int id = rand(), width = rand(), height = rand(); - yage::Texture t(static_cast(id), width, height); - ASSERT_EQ(t.id, static_cast(id)); - ASSERT_EQ(t.width, width); - ASSERT_EQ(t.height, height); -} - -int main(int argc, char **argv) -{ - testing::InitGoogleTest(&argc, argv); - srand(static_cast(time(nullptr))); - return RUN_ALL_TESTS(); -} diff --git a/tests/struct_test.cpp b/tests/struct_test.cpp new file mode 100644 index 00000000..0288f06b --- /dev/null +++ b/tests/struct_test.cpp @@ -0,0 +1,57 @@ +/** --------------------------------------------------------------------------- + * @file: test.cpp + * + * Copyright (c) 2017 Yann Herklotz Grave + * MIT License, see LICENSE file for more details. + * ---------------------------------------------------------------------------- + */ + +#include +#include + +#include +#include + +TEST(StructTest, ColourDefault) +{ + yage::Colour c; + ASSERT_EQ(c.r, 0); + ASSERT_EQ(c.g, 0); + ASSERT_EQ(c.b, 0); + ASSERT_EQ(c.a, 0); +} + +TEST(StructTest, ColourConstructor) +{ + int r = rand() % 255, g = rand() % 255, b = rand() % 255, a = rand() % 255; + yage::Colour c(r, g, b, a); + + ASSERT_EQ(c.r, r); + ASSERT_EQ(c.g, g); + ASSERT_EQ(c.b, b); + ASSERT_EQ(c.a, a); +} + +TEST(StructTest, TextureDefault) +{ + yage::Texture t; + ASSERT_EQ(t.id, static_cast(0)); + ASSERT_EQ(t.width, 0); + ASSERT_EQ(t.height, 0); +} + +TEST(StructTest, TextureConstructor) +{ + int id = rand(), width = rand(), height = rand(); + yage::Texture t(static_cast(id), width, height); + ASSERT_EQ(t.id, static_cast(id)); + ASSERT_EQ(t.width, width); + ASSERT_EQ(t.height, height); +} + +int main(int argc, char **argv) +{ + testing::InitGoogleTest(&argc, argv); + srand(static_cast(time(nullptr))); + return RUN_ALL_TESTS(); +} diff --git a/tests/syncqueue/test.cpp b/tests/syncqueue/test.cpp deleted file mode 100644 index f5c7d7c3..00000000 --- a/tests/syncqueue/test.cpp +++ /dev/null @@ -1,53 +0,0 @@ -/** --------------------------------------------------------------------------- - * @file: test.cpp - * - * Copyright (c) 2017 Yann Herklotz Grave - * MIT License, see LICENSE file for more details. - * ---------------------------------------------------------------------------- - */ - -#include - -#include -#include - -using namespace yage; - -SyncQueue queue; -std::atomic_int j(0); - -void push_to_queue1(int elements) -{ - for (int i = 0; i < elements; i++) { - queue.push(1); - j.fetch_add(1, std::memory_order_relaxed); - } - std::cout << "Done 1\n"; -} - -void push_to_queue2(int elements) -{ - for (int i = 0; i < elements; i++) { - queue.push(2); - j.fetch_add(1, std::memory_order_relaxed); - } - std::cout << "Done 2\n"; -} - -int main() -{ - std::thread first(push_to_queue1, 100000); - std::thread second(push_to_queue2, 100000); - - std::cout << "created threads, now adding in main\n"; - for (int i = 0; i < 1000000; ++i) { - queue.push(i); - j.fetch_add(1, std::memory_order_relaxed); - } - - std::cout << "now joining the threads\n"; - first.join(); - second.join(); - std::cout << "done\n" - << "iterations: " << j << "\n"; -} diff --git a/tests/testshared.h b/tests/testshared.h index 4418072c..e2d4a8d4 100644 --- a/tests/testshared.h +++ b/tests/testshared.h @@ -6,8 +6,7 @@ * ---------------------------------------------------------------------------- */ -#ifndef TEST_TESTSHARED_H -#define TEST_TESTSHARED_H +#pragma once #define OPENGL_TEST_MAIN(LOGLEVEL) \ int main(int argc, char **argv) \ @@ -29,5 +28,3 @@ testing::InitGoogleTest(&argc, argv); \ return RUN_ALL_TESTS(); \ } - -#endif diff --git a/tests/thread/test.cpp b/tests/thread/test.cpp deleted file mode 100644 index c9178abd..00000000 --- a/tests/thread/test.cpp +++ /dev/null @@ -1,29 +0,0 @@ -/** --------------------------------------------------------------------------- - * @file: test.cpp - * - * Copyright (c) 2017 Yann Herklotz Grave - * MIT License, see LICENSE file for more details. - * ---------------------------------------------------------------------------- - */ - -#include - -#include -#include - -int main() -{ - int n = 5; - - std::cout << "n before: " << n << "\n"; - - auto f = [&]() { n = 8; }; - - std::thread t1(f); - - std::cout << "n after: " << n << "\n"; - - t1.join(); - - std::cout << "n after thread: " << n << "\n"; -} diff --git a/tests/vector3/test.cpp b/tests/vector3/test.cpp deleted file mode 100644 index 2e4ba18b..00000000 --- a/tests/vector3/test.cpp +++ /dev/null @@ -1,62 +0,0 @@ -/** --------------------------------------------------------------------------- - * @file: test.cpp - * - * Copyright (c) 2017 Yann Herklotz Grave - * MIT License, see LICENSE file for more details. - * ---------------------------------------------------------------------------- - */ - -#include -#include - -#include -#include - -using namespace yage; - -TEST(Vector3, Initialize) -{ - Vector3i vec{{rand(), rand(), rand()}}; - ASSERT_EQ(vec.x, vec[0]); - ASSERT_EQ(vec.y, vec[1]); - ASSERT_EQ(vec.z, vec[2]); -} - -TEST(Vector3, Assigning_x) -{ - Vector3i vec{{rand(), rand(), rand()}}; - ASSERT_EQ(vec.x, vec[0]); - vec.x = rand(); - ASSERT_EQ(vec.x, vec[0]); - vec[0] = rand(); - ASSERT_EQ(vec.x, vec[0]); -} - -TEST(Vector3, Assigning_y) -{ - Vector3i vec{{rand(), rand(), rand()}}; - ASSERT_EQ(vec.y, vec[1]); - vec.x = rand(); - ASSERT_EQ(vec.y, vec[1]); - vec[1] = rand(); - ASSERT_EQ(vec.y, vec[1]); -} - -TEST(Vector3, Assigning_z) -{ - Vector3i vec{{rand(), rand(), rand()}}; - ASSERT_EQ(vec.z, vec[2]); - vec.z = rand(); - ASSERT_EQ(vec.z, vec[2]); - vec[2] = rand(); - ASSERT_EQ(vec.z, vec[2]); -} - -TEST(Vector3, Addition) {} - -int main(int argc, char **argv) -{ - testing::InitGoogleTest(&argc, argv); - srand(time(nullptr)); - return RUN_ALL_TESTS(); -} diff --git a/tests/vector3_test.cpp b/tests/vector3_test.cpp new file mode 100644 index 00000000..2e4ba18b --- /dev/null +++ b/tests/vector3_test.cpp @@ -0,0 +1,62 @@ +/** --------------------------------------------------------------------------- + * @file: test.cpp + * + * Copyright (c) 2017 Yann Herklotz Grave + * MIT License, see LICENSE file for more details. + * ---------------------------------------------------------------------------- + */ + +#include +#include + +#include +#include + +using namespace yage; + +TEST(Vector3, Initialize) +{ + Vector3i vec{{rand(), rand(), rand()}}; + ASSERT_EQ(vec.x, vec[0]); + ASSERT_EQ(vec.y, vec[1]); + ASSERT_EQ(vec.z, vec[2]); +} + +TEST(Vector3, Assigning_x) +{ + Vector3i vec{{rand(), rand(), rand()}}; + ASSERT_EQ(vec.x, vec[0]); + vec.x = rand(); + ASSERT_EQ(vec.x, vec[0]); + vec[0] = rand(); + ASSERT_EQ(vec.x, vec[0]); +} + +TEST(Vector3, Assigning_y) +{ + Vector3i vec{{rand(), rand(), rand()}}; + ASSERT_EQ(vec.y, vec[1]); + vec.x = rand(); + ASSERT_EQ(vec.y, vec[1]); + vec[1] = rand(); + ASSERT_EQ(vec.y, vec[1]); +} + +TEST(Vector3, Assigning_z) +{ + Vector3i vec{{rand(), rand(), rand()}}; + ASSERT_EQ(vec.z, vec[2]); + vec.z = rand(); + ASSERT_EQ(vec.z, vec[2]); + vec[2] = rand(); + ASSERT_EQ(vec.z, vec[2]); +} + +TEST(Vector3, Addition) {} + +int main(int argc, char **argv) +{ + testing::InitGoogleTest(&argc, argv); + srand(time(nullptr)); + return RUN_ALL_TESTS(); +} diff --git a/tests/vector4/test.cpp b/tests/vector4/test.cpp deleted file mode 100644 index 3705e86f..00000000 --- a/tests/vector4/test.cpp +++ /dev/null @@ -1,67 +0,0 @@ -/** --------------------------------------------------------------------------- - * @file: test.cpp - * - * Copyright (c) 2017 Yann Herklotz Grave - * MIT License, see LICENSE file for more details. - * ---------------------------------------------------------------------------- - */ - -#include -#include - -#include -#include - -using namespace yage; - -TEST(Vector4, Initialize) -{ - Vector4i vec{{rand(), rand(), rand(), rand()}}; - ASSERT_EQ(vec.x, vec[0]); - ASSERT_EQ(vec.y, vec[1]); - ASSERT_EQ(vec.z, vec[2]); - ASSERT_EQ(vec.w, vec[3]); -} - -TEST(Vector4, Assigning_x) -{ - Vector4i vec{{rand(), rand(), rand(), rand()}}; - vec.x = rand(); - ASSERT_EQ(vec.x, vec[0]); - vec[0] = rand(); - ASSERT_EQ(vec.x, vec[0]); -} - -TEST(Vector4, Assigning_y) -{ - Vector4i vec{{rand(), rand(), rand(), rand()}}; - vec.y = rand(); - ASSERT_EQ(vec.y, vec[1]); - vec[1] = rand(); - ASSERT_EQ(vec.y, vec[1]); -} - -TEST(Vector4, Assigning_z) -{ - Vector4i vec{{rand(), rand(), rand(), rand()}}; - vec.z = rand(); - ASSERT_EQ(vec.z, vec[2]); - vec[2] = rand(); - ASSERT_EQ(vec.z, vec[2]); -} - -TEST(Vector4, Assigning_w) -{ - Vector4i vec{{rand(), rand(), rand(), rand()}}; - vec.w = rand(); - ASSERT_EQ(vec.w, vec[3]); - vec[3] = rand(); - ASSERT_EQ(vec.w, vec[3]); -} - -int main(int argc, char **argv) -{ - testing::InitGoogleTest(&argc, argv); - srand(time(nullptr)); - return RUN_ALL_TESTS(); -} diff --git a/tests/vector4_test.cpp b/tests/vector4_test.cpp new file mode 100644 index 00000000..3705e86f --- /dev/null +++ b/tests/vector4_test.cpp @@ -0,0 +1,67 @@ +/** --------------------------------------------------------------------------- + * @file: test.cpp + * + * Copyright (c) 2017 Yann Herklotz Grave + * MIT License, see LICENSE file for more details. + * ---------------------------------------------------------------------------- + */ + +#include +#include + +#include +#include + +using namespace yage; + +TEST(Vector4, Initialize) +{ + Vector4i vec{{rand(), rand(), rand(), rand()}}; + ASSERT_EQ(vec.x, vec[0]); + ASSERT_EQ(vec.y, vec[1]); + ASSERT_EQ(vec.z, vec[2]); + ASSERT_EQ(vec.w, vec[3]); +} + +TEST(Vector4, Assigning_x) +{ + Vector4i vec{{rand(), rand(), rand(), rand()}}; + vec.x = rand(); + ASSERT_EQ(vec.x, vec[0]); + vec[0] = rand(); + ASSERT_EQ(vec.x, vec[0]); +} + +TEST(Vector4, Assigning_y) +{ + Vector4i vec{{rand(), rand(), rand(), rand()}}; + vec.y = rand(); + ASSERT_EQ(vec.y, vec[1]); + vec[1] = rand(); + ASSERT_EQ(vec.y, vec[1]); +} + +TEST(Vector4, Assigning_z) +{ + Vector4i vec{{rand(), rand(), rand(), rand()}}; + vec.z = rand(); + ASSERT_EQ(vec.z, vec[2]); + vec[2] = rand(); + ASSERT_EQ(vec.z, vec[2]); +} + +TEST(Vector4, Assigning_w) +{ + Vector4i vec{{rand(), rand(), rand(), rand()}}; + vec.w = rand(); + ASSERT_EQ(vec.w, vec[3]); + vec[3] = rand(); + ASSERT_EQ(vec.w, vec[3]); +} + +int main(int argc, char **argv) +{ + testing::InitGoogleTest(&argc, argv); + srand(time(nullptr)); + return RUN_ALL_TESTS(); +} diff --git a/tests/window/test.cpp b/tests/window/test.cpp deleted file mode 100644 index d9402d49..00000000 --- a/tests/window/test.cpp +++ /dev/null @@ -1,21 +0,0 @@ -/** --------------------------------------------------------------------------- - * @file: test.cpp - * - * Copyright (c) 2017 Yann Herklotz Grave - * MIT License, see LICENSE file for more details. - * ---------------------------------------------------------------------------- - */ - -#include -#include - -TEST(Window, Open) -{ - ASSERT_TRUE(true); -} - -int main(int argc, char **argv) -{ - testing::InitGoogleTest(&argc, argv); - return RUN_ALL_TESTS(); -} diff --git a/tests/yage/test.cpp b/tests/yage/test.cpp deleted file mode 100644 index 8129306b..00000000 --- a/tests/yage/test.cpp +++ /dev/null @@ -1,26 +0,0 @@ -/** --------------------------------------------------------------------------- - * @file: test.cpp - * - * Copyright (c) 2017 Yann Herklotz Grave - * MIT License, see LICENSE file for more details. - * ---------------------------------------------------------------------------- - */ - -#include -#include - -TEST(YAGE, InitQuit) -{ - try { - yage::init(); - yage::quit(); - } catch (std::runtime_error e) { - // ASSERT_TRUE(false); - } -} - -int main(int argc, char **argv) -{ - testing::InitGoogleTest(&argc, argv); - return RUN_ALL_TESTS(); -} diff --git a/tests/yage_test.cpp b/tests/yage_test.cpp new file mode 100644 index 00000000..7f495036 --- /dev/null +++ b/tests/yage_test.cpp @@ -0,0 +1,22 @@ +/** --------------------------------------------------------------------------- + * @file: test.cpp + * + * Copyright (c) 2017 Yann Herklotz Grave + * MIT License, see LICENSE file for more details. + * ---------------------------------------------------------------------------- + */ + +#include +#include + +TEST(YAGE, InitQuit) +{ + yage::init(); + yage::quit(); +} + +int main(int argc, char **argv) +{ + testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} -- cgit