Improve test macro.
Add include guards to the test header.
This commit is contained in:
parent
6a828ec244
commit
7597b56620
@ -3,10 +3,11 @@
|
|||||||
# Also sets LATEST_TEST to point to the output executable of the test for easy
|
# Also sets LATEST_TEST to point to the output executable of the test for easy
|
||||||
# ADD_TEST()ing
|
# ADD_TEST()ing
|
||||||
MACRO(CREATE_TEST headerfile sourcefile executablename)
|
MACRO(CREATE_TEST headerfile sourcefile executablename)
|
||||||
|
UNSET(test_moc_SRCS) #clear out the MOCs from previous tests
|
||||||
QT4_WRAP_CPP(test_moc_SRCS ${headerfile})
|
QT4_WRAP_CPP(test_moc_SRCS ${headerfile})
|
||||||
ADD_EXECUTABLE(${executablename} ${sourcefile} ${test_moc_SRCS})
|
ADD_EXECUTABLE(${executablename} ${sourcefile} ${test_moc_SRCS})
|
||||||
TARGET_LINK_LIBRARIES(${executablename} PolyVoxCore PolyVoxUtil ${QT_LIBRARIES})
|
TARGET_LINK_LIBRARIES(${executablename} PolyVoxCore PolyVoxUtil ${QT_LIBRARIES})
|
||||||
SET(LATEST_TEST ${EXECUTABLE_OUTPUT_PATH}/${executablename})
|
SET(LATEST_TEST ${CMAKE_CURRENT_BINARY_DIR}/${executablename})
|
||||||
ENDMACRO(CREATE_TEST)
|
ENDMACRO(CREATE_TEST)
|
||||||
|
|
||||||
# Find the QTestLib stuff
|
# Find the QTestLib stuff
|
||||||
@ -17,7 +18,6 @@ INCLUDE(${QT_USE_FILE})
|
|||||||
|
|
||||||
INCLUDE_DIRECTORIES(${PolyVox_SOURCE_DIR}/PolyVoxCore/include ${CMAKE_CURRENT_BINARY_DIR})
|
INCLUDE_DIRECTORIES(${PolyVox_SOURCE_DIR}/PolyVoxCore/include ${CMAKE_CURRENT_BINARY_DIR})
|
||||||
|
|
||||||
|
|
||||||
# Volume tests
|
# Volume tests
|
||||||
CREATE_TEST(testvolume.h testvolume.cpp testvolume)
|
CREATE_TEST(testvolume.h testvolume.cpp testvolume)
|
||||||
ADD_TEST(VolumeSizeTest ${LATEST_TEST} testSize)
|
ADD_TEST(VolumeSizeTest ${LATEST_TEST} testSize)
|
||||||
|
@ -23,8 +23,9 @@ freely, subject to the following restrictions:
|
|||||||
|
|
||||||
#include "testvolume.h"
|
#include "testvolume.h"
|
||||||
|
|
||||||
|
#include <Volume.h>
|
||||||
|
|
||||||
#include <QtTest>
|
#include <QtTest>
|
||||||
#include "Volume.h"
|
|
||||||
|
|
||||||
using namespace PolyVox;
|
using namespace PolyVox;
|
||||||
|
|
||||||
|
@ -21,6 +21,9 @@ freely, subject to the following restrictions:
|
|||||||
distribution.
|
distribution.
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
|
#ifndef __PolyVox_TestVolume_H__
|
||||||
|
#define __PolyVox_TestVolume_H__
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
|
||||||
class TestVolume: public QObject
|
class TestVolume: public QObject
|
||||||
@ -30,3 +33,5 @@ class TestVolume: public QObject
|
|||||||
private slots:
|
private slots:
|
||||||
void testSize();
|
void testSize();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user