##// END OF EJS Templates
Inits unit test
Alexandre Leroux -
r742:79898921a450
parent child
Show More
@@ -0,0 +1,50
1 #include "CosinusProvider.h"
2
3 #include <SqpApplication.h>
4
5 #include <QObject>
6 #include <QtTest>
7
8 namespace {
9
10 /// Path for the tests
11 const auto TESTS_RESOURCES_PATH = QFileInfo{
12 QString{MOCKPLUGIN_TESTS_RESOURCES_DIR},
13 "TestCosinusAcquisition"}.absoluteFilePath();
14
15 } // namespace
16
17 /**
18 * @brief The TestCosinusAcquisition class tests acquisition in SciQlop (operations like zooms in,
19 * zooms out, pans) of data from CosinusProvider
20 * @sa CosinusProvider
21 */
22 class TestCosinusAcquisition : public QObject {
23 Q_OBJECT
24
25 private slots:
26 /// Input data for @sa testAcquisition()
27 void testAcquisition_data();
28 void testAcquisition();
29 };
30
31 void TestCosinusAcquisition::testAcquisition_data()
32 {
33 /// @todo
34 }
35
36 void TestCosinusAcquisition::testAcquisition()
37 {
38 /// @todo
39 }
40
41 int main(int argc, char *argv[])
42 {
43 SqpApplication app{argc, argv};
44 app.setAttribute(Qt::AA_Use96Dpi, true);
45 TestCosinusAcquisition testObject{};
46 QTEST_SET_MAIN_SOURCE_PATH
47 return QTest::qExec(&testObject, argc, argv);
48 }
49
50 #include "TestCosinusAcquisition.moc"
@@ -4,6 +4,7 SET(SQPMOCKPLUGIN_LIBRARY_NAME "${LIBRARY_PREFFIX}_mockplugin${DEBUG_SUFFIX}")
4 SET(SOURCES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src")
4 SET(SOURCES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src")
5 SET(INCLUDES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include")
5 SET(INCLUDES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include")
6 SET(RESOURCES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/resources")
6 SET(RESOURCES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/resources")
7 SET(TESTS_RESOURCES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/tests-resources")
7
8
8 # Include mockplugin directory
9 # Include mockplugin directory
9 INCLUDE_DIRECTORIES(${INCLUDES_DIR})
10 INCLUDE_DIRECTORIES(${INCLUDES_DIR})
@@ -94,7 +95,7 IF(BUILD_TESTS)
94 INCLUDE_DIRECTORIES(${SOURCES_DIR})
95 INCLUDE_DIRECTORIES(${SOURCES_DIR})
95 FILE (GLOB_RECURSE TESTS_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/Test*.cpp)
96 FILE (GLOB_RECURSE TESTS_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/Test*.cpp)
96 FILE (GLOB_RECURSE TESTS_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/Test*.h)
97 FILE (GLOB_RECURSE TESTS_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/Test*.h)
97 SET( TEST_LIBRARIES ${SQPGUI_LIBRARY_NAME})
98 SET( TEST_LIBRARIES ${SQPMOCKPLUGIN_LIBRARY_NAME})
98
99
99 FOREACH( testFile ${TESTS_SOURCES} )
100 FOREACH( testFile ${TESTS_SOURCES} )
100 GET_FILENAME_COMPONENT( testDirectory ${testFile} DIRECTORY )
101 GET_FILENAME_COMPONENT( testDirectory ${testFile} DIRECTORY )
@@ -124,6 +125,8 IF(BUILD_TESTS)
124 LIST(APPEND testFilesToFormat ${TESTS_HEADERS})
125 LIST(APPEND testFilesToFormat ${TESTS_HEADERS})
125 LIST(APPEND FORMATTING_INPUT_FILES ${testFilesToFormat})
126 LIST(APPEND FORMATTING_INPUT_FILES ${testFilesToFormat})
126 SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES)
127 SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES)
128
129 ADD_DEFINITIONS(-DMOCKPLUGIN_TESTS_RESOURCES_DIR="${TESTS_RESOURCES_DIR}")
127 ENDIF(BUILD_TESTS)
130 ENDIF(BUILD_TESTS)
128
131
129 #
132 #
General Comments 0
You need to be logged in to leave comments. Login now