diff --git a/Tests/auxiliary/CMakeLists.txt b/Tests/auxiliary/CMakeLists.txt index c6f4c12b3..e8e60431f 100644 --- a/Tests/auxiliary/CMakeLists.txt +++ b/Tests/auxiliary/CMakeLists.txt @@ -1,17 +1,52 @@ SET( KSParserTests_SRCS testcsvparser.cpp testfwparser.cpp ) +#ADD_EXECUTABLE( auxiliary_tests +# auxiliary_tests.cpp +# testcsvparser.cpp +# testfwparser.cpp +# testdms.cpp +# testcachingdms.cpp +# testcolorscheme.cpp +# testbinhelper.cpp +# testfov.cpp +# testgeolocation.cpp +# testksuserdb.cpp) +#TARGET_LINK_LIBRARIES( auxiliary_tests ${TEST_LIBRARIES}) +#ADD_TEST( NAME AuxiliaryTests COMMAND auxiliary_tests ) + ADD_EXECUTABLE( testcsvparser testcsvparser.cpp ) TARGET_LINK_LIBRARIES( testcsvparser ${TEST_LIBRARIES}) ADD_TEST( NAME CSVParserTest COMMAND testcsvparser ) ADD_EXECUTABLE( testfwparser testfwparser.cpp ) TARGET_LINK_LIBRARIES( testfwparser ${TEST_LIBRARIES}) ADD_TEST( NAME FixedWidthParserTest COMMAND testfwparser ) ADD_EXECUTABLE( testdms testdms.cpp ) TARGET_LINK_LIBRARIES( testdms ${TEST_LIBRARIES}) ADD_TEST( NAME DMSTest COMMAND testdms ) ADD_EXECUTABLE( testcachingdms testcachingdms.cpp ) TARGET_LINK_LIBRARIES( testcachingdms ${TEST_LIBRARIES}) ADD_TEST( NAME TestCachingDms COMMAND testcachingdms ) + +ADD_EXECUTABLE( testcolorscheme testcolorscheme.cpp ) +TARGET_LINK_LIBRARIES( testcolorscheme ${TEST_LIBRARIES}) +ADD_TEST( NAME TestColorscheme COMMAND testcolorscheme ) + +ADD_EXECUTABLE( testbinhelper testbinhelper.cpp ) +TARGET_LINK_LIBRARIES( testbinhelper ${TEST_LIBRARIES}) +ADD_TEST( NAME TestBinHelper COMMAND testbinhelper ) + +ADD_EXECUTABLE( testfov testfov.cpp ) +TARGET_LINK_LIBRARIES( testfov ${TEST_LIBRARIES}) +ADD_TEST( NAME TestFOV COMMAND testfov ) + +ADD_EXECUTABLE( testgeolocation testgeolocation.cpp ) +TARGET_LINK_LIBRARIES( testgeolocation ${TEST_LIBRARIES}) +ADD_TEST( NAME TestGeolocation COMMAND testgeolocation ) + +ADD_EXECUTABLE( testksuserdb testksuserdb.cpp ) +TARGET_LINK_LIBRARIES( testksuserdb ${TEST_LIBRARIES}) +ADD_TEST( NAME TestKSUserDB COMMAND testksuserdb ) + diff --git a/Tests/auxiliary/auxiliary_tests.cpp b/Tests/auxiliary/auxiliary_tests.cpp new file mode 100644 index 000000000..e3d77ad68 --- /dev/null +++ b/Tests/auxiliary/auxiliary_tests.cpp @@ -0,0 +1,47 @@ +/* KStars class tests + Copyright (C) 2020 + Eric Dejouhanet + + This application 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. + */ + +#include +#include + +#include "testcsvparser.h" +#include "testfwparser.h" +#include "testdms.h" +#include "testcachingdms.h" +#include "testcolorscheme.h" +#include "testbinhelper.h" +#include "testfov.h" +#include "testgeolocation.h" +#include "testksuserdb.h" + +#define RUN(result, TestClass) do { \ + TestClass tc; \ + result |= QTest::qExec(&tc, argc, argv); } while(false) + +int main(int argc, char *argv[]) +{ + QCoreApplication app(argc, argv); + app.setAttribute(Qt::AA_Use96Dpi, true); + QTEST_SET_MAIN_SOURCE_PATH \ + + int result = 0; + + RUN(result, TestCSVParser); + RUN(result, TestFWParser); + RUN(result, TestDMS); + RUN(result, TestCachingDms); + RUN(result, TestColorScheme); + RUN(result, TestBinHelper); + RUN(result, TestFOV); + RUN(result, TestGeolocation); + RUN(result, TestKSUserDB); + + return result; +} diff --git a/Tests/auxiliary/testbinhelper.cpp b/Tests/auxiliary/testbinhelper.cpp new file mode 100644 index 000000000..b877488e5 --- /dev/null +++ b/Tests/auxiliary/testbinhelper.cpp @@ -0,0 +1,42 @@ +/* KStars class tests + Copyright (C) 2020 + Eric Dejouhanet + + This application 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. + */ + +#include "testbinhelper.h" + +TestBinHelper::TestBinHelper(QObject *parent) : QObject(parent) +{ +} + +void TestBinHelper::initTestCase() +{ +} + +void TestBinHelper::cleanupTestCase() +{ +} + +void TestBinHelper::init() +{ +} + +void TestBinHelper::cleanup() +{ +} + +void TestBinHelper::testLoadBinary_data() +{ +} + +void TestBinHelper::testLoadBinary() +{ + QSKIP("Not implemented yet."); +} + +QTEST_GUILESS_MAIN(TestBinHelper) diff --git a/Tests/auxiliary/testbinhelper.h b/Tests/auxiliary/testbinhelper.h new file mode 100644 index 000000000..b86e5eeb8 --- /dev/null +++ b/Tests/auxiliary/testbinhelper.h @@ -0,0 +1,34 @@ +/* KStars UI tests + Copyright (C) 2020 + Eric Dejouhanet + + This application 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. + */ + +#ifndef TESTBINHELPER_H +#define TESTBINHELPER_H + +#include +#include + +class TestBinHelper : public QObject +{ + Q_OBJECT +public: + explicit TestBinHelper(QObject *parent = nullptr); + +private slots: + void initTestCase(); + void cleanupTestCase(); + + void init(); + void cleanup(); + + void testLoadBinary_data(); + void testLoadBinary(); +}; + +#endif // TESTBINHELPER_H diff --git a/Tests/auxiliary/testcolorscheme.cpp b/Tests/auxiliary/testcolorscheme.cpp new file mode 100644 index 000000000..5ee0dc890 --- /dev/null +++ b/Tests/auxiliary/testcolorscheme.cpp @@ -0,0 +1,42 @@ +/* KStars class tests + Copyright (C) 2020 + Eric Dejouhanet + + This application 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. + */ + +#include "testcolorscheme.h" + +TestColorScheme::TestColorScheme(QObject *parent) : QObject(parent) +{ +} + +void TestColorScheme::initTestCase() +{ +} + +void TestColorScheme::cleanupTestCase() +{ +} + +void TestColorScheme::init() +{ +} + +void TestColorScheme::cleanup() +{ +} + +void TestColorScheme::testSchemeColors_data() +{ +} + +void TestColorScheme::testSchemeColors() +{ + QSKIP("Not implemented yet."); +} + +QTEST_GUILESS_MAIN(TestColorScheme) diff --git a/Tests/auxiliary/testcolorscheme.h b/Tests/auxiliary/testcolorscheme.h new file mode 100644 index 000000000..6a96a8d3c --- /dev/null +++ b/Tests/auxiliary/testcolorscheme.h @@ -0,0 +1,34 @@ +/* KStars UI tests + Copyright (C) 2020 + Eric Dejouhanet + + This application 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. + */ + +#ifndef TESTCOLORSCHEME_H +#define TESTCOLORSCHEME_H + +#include +#include + +class TestColorScheme : public QObject +{ + Q_OBJECT +public: + explicit TestColorScheme(QObject *parent = nullptr); + +private slots: + void initTestCase(); + void cleanupTestCase(); + + void init(); + void cleanup(); + + void testSchemeColors_data(); + void testSchemeColors(); +}; + +#endif // TESTCOLORSCHEME_H diff --git a/Tests/auxiliary/testfov.cpp b/Tests/auxiliary/testfov.cpp new file mode 100644 index 000000000..1d3432b0d --- /dev/null +++ b/Tests/auxiliary/testfov.cpp @@ -0,0 +1,38 @@ +/* KStars class tests + Copyright (C) 2020 + Eric Dejouhanet + + This application 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. + */ + +#include "testfov.h" + +TestFOV::TestFOV(QObject *parent) : QObject(parent) +{ +} + +void TestFOV::initTestCase() +{ +} + +void TestFOV::cleanupTestCase() +{ +} + +void TestFOV::init() +{ +} + +void TestFOV::cleanup() +{ +} + +void TestFOV::testFOVCreation() +{ + QSKIP("Not implemented yet."); +} + +QTEST_GUILESS_MAIN(TestFOV) diff --git a/Tests/auxiliary/testfov.h b/Tests/auxiliary/testfov.h new file mode 100644 index 000000000..b63844813 --- /dev/null +++ b/Tests/auxiliary/testfov.h @@ -0,0 +1,33 @@ +/* KStars UI tests + Copyright (C) 2020 + Eric Dejouhanet + + This application 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. + */ + +#ifndef TESTFOV_H +#define TESTFOV_H + +#include +#include + +class TestFOV : public QObject +{ + Q_OBJECT +public: + explicit TestFOV(QObject *parent = nullptr); + +private slots: + void initTestCase(); + void cleanupTestCase(); + + void init(); + void cleanup(); + + void testFOVCreation(); +}; + +#endif // TESTFOV_H diff --git a/Tests/auxiliary/testgeolocation.cpp b/Tests/auxiliary/testgeolocation.cpp new file mode 100644 index 000000000..488c4015b --- /dev/null +++ b/Tests/auxiliary/testgeolocation.cpp @@ -0,0 +1,52 @@ +/* KStars class tests + Copyright (C) 2020 + Eric Dejouhanet + + This application 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. + */ + +#include "testgeolocation.h" + +TestGeolocation::TestGeolocation(QObject *parent) : QObject(parent) +{ +} + +void TestGeolocation::initTestCase() +{ +} + +void TestGeolocation::cleanupTestCase() +{ +} + +void TestGeolocation::init() +{ +} + +void TestGeolocation::cleanup() +{ +} + +void TestGeolocation::testGeolocation_data() +{ +} + +void TestGeolocation::testGeolocation() +{ + QSKIP("Not implemented yet."); +} + +void TestGeolocation::testParseCityDatabase() +{ + QSKIP("Not implemented yet."); +} + +void TestGeolocation::testCoordinates() +{ + QSKIP("Not implemented yet."); +} + +QTEST_GUILESS_MAIN(TestGeolocation) diff --git a/Tests/auxiliary/testgeolocation.h b/Tests/auxiliary/testgeolocation.h new file mode 100644 index 000000000..a9948985a --- /dev/null +++ b/Tests/auxiliary/testgeolocation.h @@ -0,0 +1,36 @@ +/* KStars UI tests + Copyright (C) 2020 + Eric Dejouhanet + + This application 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. + */ + +#ifndef TESTGEOLOCATION_H +#define TESTGEOLOCATION_H + +#include +#include + +class TestGeolocation : public QObject +{ + Q_OBJECT +public: + explicit TestGeolocation(QObject *parent = nullptr); + +private slots: + void initTestCase(); + void cleanupTestCase(); + + void init(); + void cleanup(); + + void testGeolocation_data(); + void testGeolocation(); + void testParseCityDatabase(); + void testCoordinates(); +}; + +#endif // TESTGEOLOCATION_H diff --git a/Tests/auxiliary/testksuserdb.cpp b/Tests/auxiliary/testksuserdb.cpp new file mode 100644 index 000000000..c18475873 --- /dev/null +++ b/Tests/auxiliary/testksuserdb.cpp @@ -0,0 +1,88 @@ +/* KStars class tests + Copyright (C) 2020 + Eric Dejouhanet + + This application 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. + */ + +#include "testksuserdb.h" + +TestKSUserDB::TestKSUserDB(QObject *parent) : QObject(parent) +{ +} + +void TestKSUserDB::initTestCase() +{ +} + +void TestKSUserDB::cleanupTestCase() +{ +} + +void TestKSUserDB::init() +{ +} + +void TestKSUserDB::cleanup() +{ +} + +void TestKSUserDB::testCreateScopes_data() +{ +} + +void TestKSUserDB::testCreateScopes() +{ + QSKIP("Not implemented yet."); +} + +void TestKSUserDB::testCreateEyepieces_data() +{ +} + +void TestKSUserDB::testCreateEyepieces() +{ + QSKIP("Not implemented yet."); +} + +void TestKSUserDB::testCreateLenses_data() +{ +} + +void TestKSUserDB::testCreateLenes() +{ + QSKIP("Not implemented yet."); +} + +void TestKSUserDB::testCreateFilters_data() +{ +} + +void TestKSUserDB::testCreateFilters() +{ + QSKIP("Not implemented yet."); +} + +void TestKSUserDB::testCreateProfiles_data() +{ +} + +void TestKSUserDB::testCreateProfilees() +{ + QSKIP("Not implemented yet."); +} + +void TestKSUserDB::testCreateDatabase() +{ + QSKIP("Not implemented yet."); +} + +void TestKSUserDB::testCoordinates() +{ + QSKIP("Not implemented yet."); +} + +QTEST_GUILESS_MAIN(TestKSUserDB) diff --git a/Tests/auxiliary/testksuserdb.h b/Tests/auxiliary/testksuserdb.h new file mode 100644 index 000000000..88183039a --- /dev/null +++ b/Tests/auxiliary/testksuserdb.h @@ -0,0 +1,44 @@ +/* KStars UI tests + Copyright (C) 2020 + Eric Dejouhanet + + This application 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. + */ + +#ifndef TESTKSUSERDB_H +#define TESTKSUSERDB_H + +#include +#include + +class TestKSUserDB : public QObject +{ + Q_OBJECT +public: + explicit TestKSUserDB(QObject *parent = nullptr); + +private slots: + void initTestCase(); + void cleanupTestCase(); + + void init(); + void cleanup(); + + void testCreateScopes_data(); + void testCreateScopes(); + void testCreateEyepieces_data(); + void testCreateEyepieces(); + void testCreateLenses_data(); + void testCreateLenes(); + void testCreateFilters_data(); + void testCreateFilters(); + void testCreateProfiles_data(); + void testCreateProfilees(); + void testCreateDatabase(); + void testCoordinates(); +}; + +#endif // TESTKSUSERDB_H