diff --git a/plugins/Observability/src/CMakeLists.txt b/plugins/Observability/src/CMakeLists.txt index 64e1d825673cc..fa1ca96184f42 100644 --- a/plugins/Observability/src/CMakeLists.txt +++ b/plugins/Observability/src/CMakeLists.txt @@ -32,6 +32,12 @@ ENDIF() ADD_LIBRARY(Observability-static STATIC ${Observability_SRCS} ${Observability_RES_CXX} ${ObservabilityDialog_UIS_H}) TARGET_LINK_LIBRARIES(Observability-static Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Widgets) + +IF(ENABLE_TESTING) + add_definitions("-DWITH_TESTING_ON") + ADD_SUBDIRECTORY(test) +ENDIF(ENABLE_TESTING) + SET_TARGET_PROPERTIES(Observability-static PROPERTIES OUTPUT_NAME "Observability") SET_TARGET_PROPERTIES(Observability-static PROPERTIES COMPILE_FLAGS "-DQT_STATICPLUGIN") ADD_DEPENDENCIES(AllStaticPlugins Observability-static) diff --git a/plugins/Observability/src/test/CMakeLists.txt b/plugins/Observability/src/test/CMakeLists.txt new file mode 100644 index 0000000000000..64711b9a7dd94 --- /dev/null +++ b/plugins/Observability/src/test/CMakeLists.txt @@ -0,0 +1,10 @@ +set(CMAKE_INCLUDE_CURRENT_DIR ON) +set(CMAKE_AUTOMOC ON) + +FIND_PACKAGE(Qt${QT_VERSION_MAJOR} COMPONENTS Test REQUIRED) + +ADD_EXECUTABLE(testObservability testObservability.hpp testObservability.cpp) +TARGET_LINK_LIBRARIES(testObservability Qt${QT_VERSION_MAJOR}::Test Observability-static stelMain) +ADD_TEST(testObservability testObservability) +SET_TARGET_PROPERTIES(testObservability PROPERTIES FOLDER "plugins/Observability/test") + diff --git a/plugins/Observability/src/test/testObservability.cpp b/plugins/Observability/src/test/testObservability.cpp new file mode 100644 index 0000000000000..f0c42c03b9fc1 --- /dev/null +++ b/plugins/Observability/src/test/testObservability.cpp @@ -0,0 +1,33 @@ +/* + * Stellarium + * Copyright (C) 2020 Georg Zotti + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA. + */ + +#include "testObservability.hpp" + +#include +#include +#include +#include +#include + +QTEST_GUILESS_MAIN(TestObservability) + +void TestObservability::testDummy() +{ +} + diff --git a/plugins/Observability/src/test/testObservability.hpp b/plugins/Observability/src/test/testObservability.hpp new file mode 100644 index 0000000000000..4078c7e0d9dd6 --- /dev/null +++ b/plugins/Observability/src/test/testObservability.hpp @@ -0,0 +1,33 @@ +/* + * Stellarium + * Copyright (C) 2020 Georg Zotti + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA. + */ + + +#ifndef TESTOBSERVABILITY_HPP +#define TESTOBSERVABILITY_HPP + +#include + +class TestObservability : public QObject +{ +Q_OBJECT +private slots: + void testDummy(); +}; + +#endif // _TESTOBSERVABILITY_HPP