From: Steve Brokenshire Date: Wed, 16 Nov 2016 20:02:08 +0000 (+0000) Subject: Updated unit testing files X-Git-Tag: release-0.02~94 X-Git-Url: http://Server1/repobrowser/?p=xestiacalendar%2F.git;a=commitdiff_plain;h=e76460d5b9e97605b67cc8f7fe3d883f2fd1462b Updated unit testing files --- diff --git a/source/tests/build.sh b/source/tests/build.sh index 9973318..8c45912 100755 --- a/source/tests/build.sh +++ b/source/tests/build.sh @@ -1,5 +1,16 @@ #!/bin/sh +# Build the library first. + +g++ -ggdb --std=c++11 -c ../libraries/CalendarDataStorage/CalendarDataStorage.cpp \ + -o ../libraries/CalendarDataStorage/CalendarDataStorage-test.o \ + -lsqlite3 +ar rcs libCalendarDataStorage-test.a ../libraries/CalendarDataStorage/CalendarDataStorage-test.o + +echo "Building main unit test app..." + +# Build the unit testing application. + g++ `xml2-config --cflags --libs` -ggdb --std=c++11 -lcurl -lgtest -pthread \ xestiacalendar_test.cpp xestiacalendar_testcommon.cpp xestiacalendar_populate.cpp \ ../objects/calendarevent/CalendarEvent.cpp \ @@ -20,4 +31,5 @@ xestiacalendar_test.cpp xestiacalendar_testcommon.cpp xestiacalendar_populate.cp ../common/monthviewgen.cpp \ ../objects/CalDAV/CalDAV.cpp \ ../objects/CalDAV/CalDAV-XMLProcessing.cpp \ --DXESTIACAL_UNITTEST -o xestiacalendar_test +-DXESTIACAL_UNITTEST -o xestiacalendar_test \ +-L. -lCalendarDataStorage-test -lsqlite3 diff --git a/source/tests/xestiacalendar_test.cpp b/source/tests/xestiacalendar_test.cpp index 58d42c7..05a0b85 100644 --- a/source/tests/xestiacalendar_test.cpp +++ b/source/tests/xestiacalendar_test.cpp @@ -34,6 +34,7 @@ #include "xestiacalendar_icalfreebusysave.h" #include "xestiacalendar_icaltimezoneload.h" #include "xestiacalendar_icaltimezonesave.h" +#include "xestiacalendar_calendardatastorage.h" #include "xestiacalendar_caldav.h" enum MenuOpts { @@ -47,6 +48,7 @@ enum MenuOpts { TESTS_ICALSAVEFREEBUSY, TESTS_ICALLOADTIMEZONE, TESTS_ICALSAVETIMEZONE, + TESTS_CALENDARDATASTORAGE, TESTS_CALDAV, TESTS_COMMONFUNCTIONS, TESTS_EXTRA, @@ -79,6 +81,7 @@ void printmenu(){ std::cout << TESTS_ICALSAVEFREEBUSY << ". iCalendar FreeBusy Component Save" << std::endl; std::cout << TESTS_ICALLOADTIMEZONE << ". iCalendar Timezone Component Load" << std::endl; std::cout << TESTS_ICALSAVETIMEZONE << ". iCalendar Timezone Component Save" << std::endl; + std::cout << TESTS_CALENDARDATASTORAGE << ". Calendar Data Storage" << std::endl; std::cout << TESTS_CALDAV << ". CalDAV Object" << std::endl; std::cout << TESTS_COMMONFUNCTIONS << ". Common Functions" << std::endl; std::cout << TESTS_EXTRA << ". Extra Functions Menu" << std::endl; @@ -247,6 +250,11 @@ int main(int argc, char* argv[]){ ::testing::GTEST_FLAG(filter) = "iCalendarSaveTimezone*"; TestResult = RUN_ALL_TESTS(); break; + case TESTS_CALENDARDATASTORAGE: + printn("Running Calendar Data Storage tests..."); + ::testing::GTEST_FLAG(filter) = "CalendarDataStorage*"; + TestResult = RUN_ALL_TESTS(); + break; case TESTS_CALDAV: printn("Running CalDAV tests..."); ::testing::GTEST_FLAG(filter) = "CalDAV*";