From 64922ecc62c791647ace858a51214d7bad7d8c9b Mon Sep 17 00:00:00 2001 From: Seiji Emery Date: Fri, 19 Jun 2015 21:39:34 -0700 Subject: [PATCH] Setup cmake build files for QtTest-based unit tests. --- tests/CMakeLists.txt | 3 +- tests/audio/CMakeLists.txt | 14 ++-- tests/jitter/CMakeLists.txt | 12 ++-- tests/networking/CMakeLists.txt | 12 ++-- tests/octree/CMakeLists.txt | 12 ++-- tests/physics/CMakeLists.txt | 32 ++++----- tests/physics/src/BulletUtilTests.cpp | 21 +++--- tests/physics/src/BulletUtilTests.h | 11 +++- tests/physics/src/CollisionInfoTests.cpp | 6 +- tests/physics/src/CollisionInfoTests.h | 10 ++- tests/physics/src/MeshMassPropertiesTests.cpp | 16 ++--- tests/physics/src/MeshMassPropertiesTests.h | 12 +++- tests/physics/src/PhysicsTestUtil.cpp | 22 ------- tests/physics/src/PhysicsTestUtil.h | 7 +- tests/physics/src/ShapeColliderTests.cpp | 66 +++++++++---------- tests/physics/src/ShapeColliderTests.h | 10 ++- tests/physics/src/ShapeInfoTests.cpp | 20 +++--- tests/physics/src/ShapeInfoTests.h | 10 ++- tests/physics/src/ShapeManagerTests.cpp | 16 ++--- tests/physics/src/ShapeManagerTests.h | 11 +++- tests/physics/src/main.cpp | 48 +++++++++++--- tests/render-utils/CMakeLists.txt | 16 +++-- tests/shared/CMakeLists.txt | 13 ++-- tests/ui/CMakeLists.txt | 28 ++++---- 24 files changed, 247 insertions(+), 181 deletions(-) delete mode 100644 tests/physics/src/PhysicsTestUtil.cpp diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index b6b57ca530..cc399c1406 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -3,7 +3,8 @@ file(GLOB TEST_SUBDIRS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_S list(REMOVE_ITEM TEST_SUBDIRS "CMakeFiles") foreach(DIR ${TEST_SUBDIRS}) if(IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/${DIR}") + set(TEST_PROJ_NAME ${DIR}) + message(STATUS "Adding " ${DIR}) add_subdirectory(${DIR}) - set_target_properties("${DIR}-tests" PROPERTIES FOLDER "Tests") endif() endforeach() \ No newline at end of file diff --git a/tests/audio/CMakeLists.txt b/tests/audio/CMakeLists.txt index a106fc9ea9..5922f07b09 100644 --- a/tests/audio/CMakeLists.txt +++ b/tests/audio/CMakeLists.txt @@ -1,8 +1,12 @@ -set(TARGET_NAME audio-tests) -setup_hifi_project() +message(STATUS "TEST_PROJ_NAME = " ${TEST_PROJ_NAME}) -# link in the shared libraries -link_hifi_libraries(shared audio networking) +# Declare dependencies +macro (SETUP_TESTCASE_DEPENDENCIES) + # link in the shared libraries + link_hifi_libraries(shared audio networking) -copy_dlls_beside_windows_executable() \ No newline at end of file + copy_dlls_beside_windows_executable() +endmacro () + +setup_hifi_testcase() \ No newline at end of file diff --git a/tests/jitter/CMakeLists.txt b/tests/jitter/CMakeLists.txt index 377dcc1081..76f306a2dc 100644 --- a/tests/jitter/CMakeLists.txt +++ b/tests/jitter/CMakeLists.txt @@ -1,8 +1,10 @@ -set(TARGET_NAME jitter-tests) -setup_hifi_project() +# Declare dependencies +macro (setup_testcase_dependencies) + # link in the shared libraries + link_hifi_libraries(shared networking) -# link in the shared libraries -link_hifi_libraries(shared networking) + copy_dlls_beside_windows_executable() +endmacro() -copy_dlls_beside_windows_executable() \ No newline at end of file +setup_hifi_testcase() \ No newline at end of file diff --git a/tests/networking/CMakeLists.txt b/tests/networking/CMakeLists.txt index 6b9d3738d4..51fd639672 100644 --- a/tests/networking/CMakeLists.txt +++ b/tests/networking/CMakeLists.txt @@ -1,8 +1,10 @@ -set(TARGET_NAME networking-tests) -setup_hifi_project() +# Declare dependencies +macro (setup_testcase_dependencies) + # link in the shared libraries + link_hifi_libraries(shared networking) -# link in the shared libraries -link_hifi_libraries(shared networking) + copy_dlls_beside_windows_executable() +endmacro () -copy_dlls_beside_windows_executable() \ No newline at end of file +setup_hifi_testcase() \ No newline at end of file diff --git a/tests/octree/CMakeLists.txt b/tests/octree/CMakeLists.txt index b5fb43c260..178d4911d9 100644 --- a/tests/octree/CMakeLists.txt +++ b/tests/octree/CMakeLists.txt @@ -1,8 +1,10 @@ -set(TARGET_NAME octree-tests) -setup_hifi_project(Script Network) +# Declare dependencies +macro (setup_testcase_dependencies) + # link in the shared libraries + link_hifi_libraries(shared octree gpu model fbx networking environment entities avatars audio animation script-engine physics) -# link in the shared libraries -link_hifi_libraries(shared octree gpu model fbx networking environment entities avatars audio animation script-engine physics) + copy_dlls_beside_windows_executable() +endmacro () -copy_dlls_beside_windows_executable() \ No newline at end of file +setup_hifi_testcase(Script Network) \ No newline at end of file diff --git a/tests/physics/CMakeLists.txt b/tests/physics/CMakeLists.txt index 888b158035..7ad6d12d66 100644 --- a/tests/physics/CMakeLists.txt +++ b/tests/physics/CMakeLists.txt @@ -1,17 +1,19 @@ -set(TARGET_NAME physics-tests) -setup_hifi_project() +# Declare dependencies +macro (ADD_TESTCASE_DEPENDENCIES) + add_dependency_external_projects(glm) + find_package(GLM REQUIRED) + target_include_directories(${TARGET_NAME} PUBLIC ${GLM_INCLUDE_DIRS}) + + add_dependency_external_projects(bullet) + + find_package(Bullet REQUIRED) + + target_include_directories(${TARGET_NAME} SYSTEM PRIVATE ${BULLET_INCLUDE_DIRS}) + target_link_libraries(${TARGET_NAME} ${BULLET_LIBRARIES}) + + link_hifi_libraries(shared physics) + copy_dlls_beside_windows_executable() +endmacro () -add_dependency_external_projects(glm) -find_package(GLM REQUIRED) -target_include_directories(${TARGET_NAME} PUBLIC ${GLM_INCLUDE_DIRS}) - -add_dependency_external_projects(bullet) - -find_package(Bullet REQUIRED) -target_include_directories(${TARGET_NAME} SYSTEM PRIVATE ${BULLET_INCLUDE_DIRS}) -target_link_libraries(${TARGET_NAME} ${BULLET_LIBRARIES}) - -link_hifi_libraries(shared physics) - -copy_dlls_beside_windows_executable() \ No newline at end of file +setup_hifi_testcase(Script) \ No newline at end of file diff --git a/tests/physics/src/BulletUtilTests.cpp b/tests/physics/src/BulletUtilTests.cpp index b7fc9a1991..22a974b98c 100644 --- a/tests/physics/src/BulletUtilTests.cpp +++ b/tests/physics/src/BulletUtilTests.cpp @@ -19,10 +19,12 @@ void BulletUtilTests::fromBulletToGLM() { btVector3 bV(1.23f, 4.56f, 7.89f); glm::vec3 gV = bulletToGLM(bV); - if (gV.x != bV.getX()) { - std::cout << __FILE__ << ":" << __LINE__ - << " ERROR: x mismatch bullet.x = " << bV.getX() << " != glm.x = " << gV.x << std::endl; - } + + QCOMPARE(gV.x, bV.getX()); +// if (gV.x != bV .getX()) { +// std::cout << __FILE__ << ":" << __LINE__ +// << " ERROR: x mismatch bullet.x = " << bV.getX() << " != glm.x = " << gV.x << std::endl; +// } if (gV.y != bV.getY()) { std::cout << __FILE__ << ":" << __LINE__ << " ERROR: x mismatch bullet.y = " << bV.getY() << " != glm.y = " << gV.y << std::endl; @@ -96,7 +98,10 @@ void BulletUtilTests::fromGLMToBullet() { } } -void BulletUtilTests::runAllTests() { - fromBulletToGLM(); - fromGLMToBullet(); -} +QTEST_MAIN(BulletUtilTests) + + +//void BulletUtilTests::runAllTests() { +// fromBulletToGLM(); +// fromGLMToBullet(); +//} diff --git a/tests/physics/src/BulletUtilTests.h b/tests/physics/src/BulletUtilTests.h index b885777bdd..733352905b 100644 --- a/tests/physics/src/BulletUtilTests.h +++ b/tests/physics/src/BulletUtilTests.h @@ -12,10 +12,15 @@ #ifndef hifi_BulletUtilTests_h #define hifi_BulletUtilTests_h -namespace BulletUtilTests { +#include + +class BulletUtilTests : public QObject { + Q_OBJECT + +private slots: void fromBulletToGLM(); void fromGLMToBullet(); - void runAllTests(); -} +// void runAllTests(); +}; #endif // hifi_BulletUtilTests_h diff --git a/tests/physics/src/CollisionInfoTests.cpp b/tests/physics/src/CollisionInfoTests.cpp index 0aa84c3afa..a86be327cf 100644 --- a/tests/physics/src/CollisionInfoTests.cpp +++ b/tests/physics/src/CollisionInfoTests.cpp @@ -106,7 +106,9 @@ void CollisionInfoTests::translateThenRotate() { } */ -void CollisionInfoTests::runAllTests() { +QTEST_MAIN(CollisionInfoTests) + +//void CollisionInfoTests::runAllTests() { // CollisionInfoTests::rotateThenTranslate(); // CollisionInfoTests::translateThenRotate(); -} +//} diff --git a/tests/physics/src/CollisionInfoTests.h b/tests/physics/src/CollisionInfoTests.h index 54c4e89e95..5c2289c26d 100644 --- a/tests/physics/src/CollisionInfoTests.h +++ b/tests/physics/src/CollisionInfoTests.h @@ -12,12 +12,16 @@ #ifndef hifi_CollisionInfoTests_h #define hifi_CollisionInfoTests_h -namespace CollisionInfoTests { +#include +class CollisionInfoTests : public QObject { + Q_OBJECT + +private slots: // void rotateThenTranslate(); // void translateThenRotate(); - void runAllTests(); -} +// void runAllTests(); +}; #endif // hifi_CollisionInfoTests_h diff --git a/tests/physics/src/MeshMassPropertiesTests.cpp b/tests/physics/src/MeshMassPropertiesTests.cpp index ebb762aa55..7b1fb17a52 100644 --- a/tests/physics/src/MeshMassPropertiesTests.cpp +++ b/tests/physics/src/MeshMassPropertiesTests.cpp @@ -449,11 +449,11 @@ void MeshMassPropertiesTests::testBoxAsMesh() { #endif // VERBOSE_UNIT_TESTS } -void MeshMassPropertiesTests::runAllTests() { - testParallelAxisTheorem(); - testTetrahedron(); - testOpenTetrahedonMesh(); - testClosedTetrahedronMesh(); - testBoxAsMesh(); - //testWithCube(); -} +//void MeshMassPropertiesTests::runAllTests() { +// testParallelAxisTheorem(); +// testTetrahedron(); +// testOpenTetrahedonMesh(); +// testClosedTetrahedronMesh(); +// testBoxAsMesh(); +// //testWithCube(); +//} diff --git a/tests/physics/src/MeshMassPropertiesTests.h b/tests/physics/src/MeshMassPropertiesTests.h index 07cd774d34..ce56d3f8c7 100644 --- a/tests/physics/src/MeshMassPropertiesTests.h +++ b/tests/physics/src/MeshMassPropertiesTests.h @@ -11,12 +11,18 @@ #ifndef hifi_MeshMassPropertiesTests_h #define hifi_MeshMassPropertiesTests_h -namespace MeshMassPropertiesTests{ + +#include + +class MeshMassPropertiesTests : public QObject { + Q_OBJECT + +private slots: void testParallelAxisTheorem(); void testTetrahedron(); void testOpenTetrahedonMesh(); void testClosedTetrahedronMesh(); void testBoxAsMesh(); - void runAllTests(); -} +// void runAllTests(); +}; #endif // hifi_MeshMassPropertiesTests_h diff --git a/tests/physics/src/PhysicsTestUtil.cpp b/tests/physics/src/PhysicsTestUtil.cpp deleted file mode 100644 index a11d4f2add..0000000000 --- a/tests/physics/src/PhysicsTestUtil.cpp +++ /dev/null @@ -1,22 +0,0 @@ -// -// PhysicsTestUtil.cpp -// tests/physics/src -// -// Created by Andrew Meadows on 02/21/2014. -// Copyright 2014 High Fidelity, Inc. -// -// Distributed under the Apache License, Version 2.0. -// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html -// - -#include - -#include "PhysicsTestUtil.h" -#include "StreamUtils.h" - -std::ostream& operator<<(std::ostream& s, const CollisionInfo& c) { - s << "[penetration=" << c._penetration - << ", contactPoint=" << c._contactPoint - << ", addedVelocity=" << c._addedVelocity; - return s; -} diff --git a/tests/physics/src/PhysicsTestUtil.h b/tests/physics/src/PhysicsTestUtil.h index 0e43084a05..25f7e97181 100644 --- a/tests/physics/src/PhysicsTestUtil.h +++ b/tests/physics/src/PhysicsTestUtil.h @@ -21,6 +21,11 @@ const glm::vec3 xAxis(1.0f, 0.0f, 0.0f); const glm::vec3 yAxis(0.0f, 1.0f, 0.0f); const glm::vec3 zAxis(0.0f, 0.0f, 1.0f); -std::ostream& operator<<(std::ostream& s, const CollisionInfo& c); +inline std::ostream& operator<<(std::ostream& s, const CollisionInfo& c) { + return s << "[penetration=" << c._penetration + << ", contactPoint=" << c._contactPoint + << ", addedVelocity=" << c._addedVelocity + << "]"; +} #endif // hifi_PhysicsTestUtil_h diff --git a/tests/physics/src/ShapeColliderTests.cpp b/tests/physics/src/ShapeColliderTests.cpp index e89211af3a..560de79fe8 100644 --- a/tests/physics/src/ShapeColliderTests.cpp +++ b/tests/physics/src/ShapeColliderTests.cpp @@ -2507,36 +2507,36 @@ void ShapeColliderTests::measureTimeOfCollisionDispatch() { */ } -void ShapeColliderTests::runAllTests() { - ShapeCollider::initDispatchTable(); - - //measureTimeOfCollisionDispatch(); - - sphereMissesSphere(); - sphereTouchesSphere(); - - sphereMissesCapsule(); - sphereTouchesCapsule(); - - capsuleMissesCapsule(); - capsuleTouchesCapsule(); - - sphereMissesAACube(); - sphereTouchesAACubeFaces(); - sphereTouchesAACubeEdges(); - sphereTouchesAACubeCorners(); - - capsuleMissesAACube(); - capsuleTouchesAACube(); - - rayHitsSphere(); - rayBarelyHitsSphere(); - rayBarelyMissesSphere(); - rayHitsCapsule(); - rayMissesCapsule(); - rayHitsPlane(); - rayMissesPlane(); - - rayHitsAACube(); - rayMissesAACube(); -} +//void ShapeColliderTests::runAllTests() { +// ShapeCollider::initDispatchTable(); +// +// //measureTimeOfCollisionDispatch(); +// +// sphereMissesSphere(); +// sphereTouchesSphere(); +// +// sphereMissesCapsule(); +// sphereTouchesCapsule(); +// +// capsuleMissesCapsule(); +// capsuleTouchesCapsule(); +// +// sphereMissesAACube(); +// sphereTouchesAACubeFaces(); +// sphereTouchesAACubeEdges(); +// sphereTouchesAACubeCorners(); +// +// capsuleMissesAACube(); +// capsuleTouchesAACube(); +// +// rayHitsSphere(); +// rayBarelyHitsSphere(); +// rayBarelyMissesSphere(); +// rayHitsCapsule(); +// rayMissesCapsule(); +// rayHitsPlane(); +// rayMissesPlane(); +// +// rayHitsAACube(); +// rayMissesAACube(); +//} diff --git a/tests/physics/src/ShapeColliderTests.h b/tests/physics/src/ShapeColliderTests.h index fa6887f685..8da4c96639 100644 --- a/tests/physics/src/ShapeColliderTests.h +++ b/tests/physics/src/ShapeColliderTests.h @@ -12,8 +12,12 @@ #ifndef hifi_ShapeColliderTests_h #define hifi_ShapeColliderTests_h -namespace ShapeColliderTests { +#include +class ShapeColliderTests : public QObject { + Q_OBJECT + +private slots: void sphereMissesSphere(); void sphereTouchesSphere(); @@ -43,7 +47,7 @@ namespace ShapeColliderTests { void measureTimeOfCollisionDispatch(); - void runAllTests(); -} +// void runAllTests(); +}; #endif // hifi_ShapeColliderTests_h diff --git a/tests/physics/src/ShapeInfoTests.cpp b/tests/physics/src/ShapeInfoTests.cpp index 365d6d6008..864a2f61cb 100644 --- a/tests/physics/src/ShapeInfoTests.cpp +++ b/tests/physics/src/ShapeInfoTests.cpp @@ -234,13 +234,13 @@ void ShapeInfoTests::testCapsuleShape() { */ } -void ShapeInfoTests::runAllTests() { -//#define MANUAL_TEST -#ifdef MANUAL_TEST - testHashFunctions(); -#endif // MANUAL_TEST - testBoxShape(); - testSphereShape(); - testCylinderShape(); - testCapsuleShape(); -} +//void ShapeInfoTests::runAllTests() { +////#define MANUAL_TEST +//#ifdef MANUAL_TEST +// testHashFunctions(); +//#endif // MANUAL_TEST +// testBoxShape(); +// testSphereShape(); +// testCylinderShape(); +// testCapsuleShape(); +//} diff --git a/tests/physics/src/ShapeInfoTests.h b/tests/physics/src/ShapeInfoTests.h index b786ca92d5..bb2bff4f51 100644 --- a/tests/physics/src/ShapeInfoTests.h +++ b/tests/physics/src/ShapeInfoTests.h @@ -12,13 +12,17 @@ #ifndef hifi_ShapeInfoTests_h #define hifi_ShapeInfoTests_h -namespace ShapeInfoTests { +#include + +class ShapeInfoTests : public QObject { + Q_OBJECT +private slots: void testHashFunctions(); void testBoxShape(); void testSphereShape(); void testCylinderShape(); void testCapsuleShape(); - void runAllTests(); -} +// void runAllTests(); +}; #endif // hifi_ShapeInfoTests_h diff --git a/tests/physics/src/ShapeManagerTests.cpp b/tests/physics/src/ShapeManagerTests.cpp index 9ac75981dd..b9a5bb497d 100644 --- a/tests/physics/src/ShapeManagerTests.cpp +++ b/tests/physics/src/ShapeManagerTests.cpp @@ -248,11 +248,11 @@ void ShapeManagerTests::addCapsuleShape() { */ } -void ShapeManagerTests::runAllTests() { - testShapeAccounting(); - addManyShapes(); - addBoxShape(); - addSphereShape(); - addCylinderShape(); - addCapsuleShape(); -} +//void ShapeManagerTests::runAllTests() { +// testShapeAccounting(); +// addManyShapes(); +// addBoxShape(); +// addSphereShape(); +// addCylinderShape(); +// addCapsuleShape(); +//} diff --git a/tests/physics/src/ShapeManagerTests.h b/tests/physics/src/ShapeManagerTests.h index 98703fda1e..885eb2ceb1 100644 --- a/tests/physics/src/ShapeManagerTests.h +++ b/tests/physics/src/ShapeManagerTests.h @@ -12,14 +12,19 @@ #ifndef hifi_ShapeManagerTests_h #define hifi_ShapeManagerTests_h -namespace ShapeManagerTests { +#include + +class ShapeManagerTests : public QObject { + Q_OBJECT + +private slots: void testShapeAccounting(); void addManyShapes(); void addBoxShape(); void addSphereShape(); void addCylinderShape(); void addCapsuleShape(); - void runAllTests(); -} +// void runAllTests(); +}; #endif // hifi_ShapeManagerTests_h diff --git a/tests/physics/src/main.cpp b/tests/physics/src/main.cpp index f63925bb34..49677023d0 100644 --- a/tests/physics/src/main.cpp +++ b/tests/physics/src/main.cpp @@ -8,17 +8,45 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#include "ShapeColliderTests.h" +#include +//#include + +//#include "ShapeColliderTests.h" #include "ShapeInfoTests.h" #include "ShapeManagerTests.h" -#include "BulletUtilTests.h" +//#include "BulletUtilTests.h" #include "MeshMassPropertiesTests.h" -int main(int argc, char** argv) { - ShapeColliderTests::runAllTests(); - ShapeInfoTests::runAllTests(); - ShapeManagerTests::runAllTests(); - BulletUtilTests::runAllTests(); - MeshMassPropertiesTests::runAllTests(); - return 0; -} +//int main(int argc, char** argv) { +// ShapeColliderTests::runAllTests(); +// ShapeInfoTests::runAllTests(); +// ShapeManagerTests::runAllTests(); +// BulletUtilTests::runAllTests(); +// MeshMassPropertiesTests::runAllTests(); +// return 0; +//} + +//QTEST_MAIN(BulletUtilTests) + +// Custom main function to run multiple unit tests. Just copy + paste this into future tests. +//#define RUN_TEST(Test) { Test test; runTest(test); } +#define RUN_TEST(Test) { runTest(new Test()); } +int main (int argc, const char ** argv) { + QStringList args; + for (int i = 0; i < argc; ++i) + args.append(QString { argv[i] }); + int status = 0; + + auto runTest = [&status, args] (QObject * test) { + status |= QTest::qExec(test, args); + }; + + // Run test classes +// RUN_TEST(ShapeColliderTests) + RUN_TEST(ShapeInfoTests) + RUN_TEST(ShapeManagerTests) +// RUN_TEST(BulletUtilTests) + RUN_TEST(MeshMassPropertiesTests) + + return status; +} \ No newline at end of file diff --git a/tests/render-utils/CMakeLists.txt b/tests/render-utils/CMakeLists.txt index 0452fd629c..a72b1eac94 100644 --- a/tests/render-utils/CMakeLists.txt +++ b/tests/render-utils/CMakeLists.txt @@ -1,10 +1,12 @@ -set(TARGET_NAME render-utils-tests) - -setup_hifi_project(Quick Gui OpenGL) -#include_oglplus() +# Declare dependencies +macro (setup_testcase_dependencies) + #include_oglplus() -# link in the shared libraries -link_hifi_libraries(render-utils gpu shared) + # link in the shared libraries + link_hifi_libraries(render-utils gpu shared) -copy_dlls_beside_windows_executable() \ No newline at end of file + copy_dlls_beside_windows_executable() +endmacro () + +setup_hifi_testcase(Quick Gui OpenGL) \ No newline at end of file diff --git a/tests/shared/CMakeLists.txt b/tests/shared/CMakeLists.txt index 9ae00756e8..2fca6ea754 100644 --- a/tests/shared/CMakeLists.txt +++ b/tests/shared/CMakeLists.txt @@ -1,8 +1,11 @@ -set(TARGET_NAME shared-tests) -setup_hifi_project() +# Declare dependencies +macro (setup_testcase_dependencies) -# link in the shared libraries -link_hifi_libraries(shared) + # link in the shared libraries + link_hifi_libraries(shared) -copy_dlls_beside_windows_executable() \ No newline at end of file + copy_dlls_beside_windows_executable() +endmacro () + +setup_hifi_testcase() \ No newline at end of file diff --git a/tests/ui/CMakeLists.txt b/tests/ui/CMakeLists.txt index 3ff8555fa2..d432d5783b 100644 --- a/tests/ui/CMakeLists.txt +++ b/tests/ui/CMakeLists.txt @@ -1,15 +1,17 @@ -set(TARGET_NAME ui-tests) - -setup_hifi_project(Widgets OpenGL Network Qml Quick Script) -if (WIN32) - add_dependency_external_projects(glew) - find_package(GLEW REQUIRED) - target_include_directories(${TARGET_NAME} PRIVATE ${GLEW_INCLUDE_DIRS}) - target_link_libraries(${TARGET_NAME} ${GLEW_LIBRARIES} wsock32.lib opengl32.lib Winmm.lib) -endif() +# Declare testcase dependencies +macro (setup_testcase_dependencies) + if (WIN32) + add_dependency_external_projects(glew) + find_package(GLEW REQUIRED) + target_include_directories(${TARGET_NAME} PRIVATE ${GLEW_INCLUDE_DIRS}) + target_link_libraries(${TARGET_NAME} ${GLEW_LIBRARIES} wsock32.lib opengl32.lib Winmm.lib) + endif() + + # link in the shared libraries + link_hifi_libraries(ui render-utils gpu shared) + + copy_dlls_beside_windows_executable() +endmacro() -# link in the shared libraries -link_hifi_libraries(ui render-utils gpu shared) - -copy_dlls_beside_windows_executable() \ No newline at end of file +setup_hifi_testcase(Widgets OpenGL Network Qml Quick Script) \ No newline at end of file