Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
unit-test: Refactor unit testing building/running/info collecting for build server
authorSteve Brokenshire <sbrokenshire@xestia.co.uk>
Sat, 14 Sep 2019 15:30:20 +0000 (16:30 +0100)
committerSteve Brokenshire <sbrokenshire@xestia.co.uk>
Sat, 14 Sep 2019 17:09:31 +0000 (18:09 +0100)
35 files changed:
source/aclocal.m4
source/configure
source/configure.ac
source/tests/AlertIcon-32.png [deleted file]
source/tests/AlertIcon.png [deleted file]
source/tests/CalendarDataStorageTests/CalendarDataStorageTests.cpp [moved from source/tests/xestiacalendar_calendardatastorage.h with 94% similarity]
source/tests/CalendarDataStorageTests/main.cpp [new file with mode: 0644]
source/tests/CommonFunctionsTests/CommonFunctionsTests.cpp [moved from source/tests/xestiacalendar_commonfunctions.h with 98% similarity]
source/tests/CommonFunctionsTests/main.cpp [new file with mode: 0644]
source/tests/Makefile.in [new file with mode: 0644]
source/tests/PriorityIcon-32.png [deleted file]
source/tests/PriorityIcon.png [deleted file]
source/tests/build-gui.sh [deleted file]
source/tests/build.sh [deleted file]
source/tests/iCalendarEvent-Save2.ics [new file with mode: 0644]
source/tests/iCalendarEventTests/iCalendarEventLoad.cpp [moved from source/tests/xestiacalendar_icaleventload.h with 98% similarity]
source/tests/iCalendarEventTests/iCalendarEventSave.cpp [moved from source/tests/xestiacalendar_icaleventsave.h with 95% similarity]
source/tests/iCalendarEventTests/main.cpp [new file with mode: 0644]
source/tests/iCalendarFreeBusyTests/iCalendarFreeBusyLoad.cpp [moved from source/tests/xestiacalendar_icalfreebusyload.h with 97% similarity]
source/tests/iCalendarFreeBusyTests/iCalendarFreeBusySave.cpp [moved from source/tests/xestiacalendar_icalfreebusysave.h with 94% similarity]
source/tests/iCalendarFreeBusyTests/main.cpp [new file with mode: 0644]
source/tests/iCalendarJournalTests/iCalendarJournalLoad.cpp [moved from source/tests/xestiacalendar_icaljournalload.h with 98% similarity]
source/tests/iCalendarJournalTests/iCalendarJournalSave.cpp [moved from source/tests/xestiacalendar_icaljournalsave.h with 95% similarity]
source/tests/iCalendarJournalTests/main.cpp [new file with mode: 0644]
source/tests/iCalendarTaskTests/iCalendarTaskLoad.cpp [moved from source/tests/xestiacalendar_icaltaskload.h with 99% similarity]
source/tests/iCalendarTaskTests/iCalendarTaskSave.cpp [moved from source/tests/xestiacalendar_icaltasksave.h with 97% similarity]
source/tests/iCalendarTaskTests/main.cpp [new file with mode: 0644]
source/tests/iCalendarTimeZoneTests/iCalendarTimeZoneLoad.cpp [moved from source/tests/xestiacalendar_icaltimezoneload.h with 98% similarity]
source/tests/iCalendarTimeZoneTests/iCalendarTimeZoneSave.cpp [moved from source/tests/xestiacalendar_icaltimezonesave.h with 94% similarity]
source/tests/iCalendarTimeZoneTests/main.cpp [new file with mode: 0644]
source/tests/xestiacalendar_test.cpp [deleted file]
source/tests/xestiacalendar_testcommon.cpp [deleted file]
source/tests/xestiacalendar_testcommon.h [deleted file]
source/tests/xestiacalendar_testxccalendarday.cpp [deleted file]
source/tests/xestiacalendar_testxccalendarmonthview.cpp [deleted file]

index 1f84e49..f829a9d 100644 (file)
@@ -1,6 +1,6 @@
-# generated automatically by aclocal 1.13.4 -*- Autoconf -*-
+# generated automatically by aclocal 1.15.1 -*- Autoconf -*-
 
-# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+# Copyright (C) 1996-2017 Free Software Foundation, Inc.
 
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1074,7 +1074,7 @@ AC_DEFUN([AM_PATH_WXRC], [WXRC_CHECK([$1],[$2])])
 
 # AM_COND_IF                                            -*- Autoconf -*-
 
-# Copyright (C) 2008-2013 Free Software Foundation, Inc.
+# Copyright (C) 2008-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1111,7 +1111,7 @@ fi[]dnl
 
 # AM_CONDITIONAL                                            -*- Autoconf -*-
 
-# Copyright (C) 1997-2013 Free Software Foundation, Inc.
+# Copyright (C) 1997-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1142,7 +1142,7 @@ AC_CONFIG_COMMANDS_PRE(
 Usually this means the macro was only invoked conditionally.]])
 fi])])
 
-# Copyright (C) 2006-2013 Free Software Foundation, Inc.
+# Copyright (C) 2006-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
index c1eecfb..9eef490 100755 (executable)
@@ -4850,9 +4850,8 @@ fi
 #      [AC_SUBST([GTEST], ["   @echo \"Google Test was not found on the system. Unable to build tests.\""])])
 #AM_COND_IF([GTEST_FOUND], [echo "Google Test found on the system. Enabling Unit Tests."]);
 
-ac_config_files="$ac_config_files Makefile"
+ac_config_files="$ac_config_files Makefile tests/Makefile"
 
-#AC_CONFIG_FILES([Makefile tests/Makefile])
 cat >confcache <<\_ACEOF
 # This file is a shell script that caches the results of configure
 # tests run on this system so they can be shared between configure
@@ -5575,6 +5574,7 @@ for ac_config_target in $ac_config_targets
 do
   case $ac_config_target in
     "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+    "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;;
 
   *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
   esac
index 6b0fbee..92a5e8f 100644 (file)
@@ -187,6 +187,5 @@ AM_COND_IF([DEBUG], [echo "Debugging mode has been enabled."])
 #      [AC_SUBST([GTEST], ["   @echo \"Google Test was not found on the system. Unable to build tests.\""])])
 #AM_COND_IF([GTEST_FOUND], [echo "Google Test found on the system. Enabling Unit Tests."]);
 
-AC_CONFIG_FILES([Makefile])
-#AC_CONFIG_FILES([Makefile tests/Makefile])
+AC_CONFIG_FILES([Makefile tests/Makefile])
 AC_OUTPUT
diff --git a/source/tests/AlertIcon-32.png b/source/tests/AlertIcon-32.png
deleted file mode 100644 (file)
index a7fb665..0000000
Binary files a/source/tests/AlertIcon-32.png and /dev/null differ
diff --git a/source/tests/AlertIcon.png b/source/tests/AlertIcon.png
deleted file mode 100644 (file)
index 80106cb..0000000
Binary files a/source/tests/AlertIcon.png and /dev/null differ
 // with Xestia Calendar. If not, see <http://www.gnu.org/licenses/> 
 
 #include "../libraries/CalendarDataStorage/CalendarDataStorage.h"
+#include <gtest/gtest.h>
+
+class CalendarDataStorageTests : public ::testing::Test
+{
+private:
+    virtual void SetUp()
+    {
+    }
+    
+    virtual void TearDown()
+    {
+    }
+};
 
 Colour defaultColour;
 
-TEST(CalendarDataStorage, Setup_Tables){
+TEST_F(CalendarDataStorageTests, Setup_Tables){
        
        CalendarDataStorage setupTablesTest;
        
@@ -28,7 +41,7 @@ TEST(CalendarDataStorage, Setup_Tables){
        
 }
 
-TEST(CalendarDataStorage, Add_One_Account){
+TEST_F(CalendarDataStorageTests, Add_One_Account){
        
        CalendarDataStorage addOneEntryTest;
        
@@ -36,7 +49,7 @@ TEST(CalendarDataStorage, Add_One_Account){
        
 }
 
-TEST(CalendarDataStorage, Add_Two_Accounts){
+TEST_F(CalendarDataStorageTests, Add_Two_Accounts){
        
        CalendarDataStorage addTwoEntryTest;
 
@@ -45,7 +58,7 @@ TEST(CalendarDataStorage, Add_Two_Accounts){
        
 }
 
-TEST(CalendarDataStorage, Add_Three_Accounts){
+TEST_F(CalendarDataStorageTests, Add_Three_Accounts){
        
        CalendarDataStorage addThreeEntryTest;
        
@@ -55,7 +68,7 @@ TEST(CalendarDataStorage, Add_Three_Accounts){
        
 }
 
-TEST(CalendarDataStorage, Add_Account_With_No_Name_And_Return_No_Name_Message){
+TEST_F(CalendarDataStorageTests, Add_Account_With_No_Name_And_Return_No_Name_Message){
        
        CalendarDataStorage failNameTest;
 
@@ -63,7 +76,7 @@ TEST(CalendarDataStorage, Add_Account_With_No_Name_And_Return_No_Name_Message){
        
 }
 
-TEST(CalendarDataStorage, Add_Account_With_Same_Name_Twice_And_Return_Failed_Message){
+TEST_F(CalendarDataStorageTests, Add_Account_With_Same_Name_Twice_And_Return_Failed_Message){
        
        CalendarDataStorage duplicateNameTest;
 
@@ -72,7 +85,7 @@ TEST(CalendarDataStorage, Add_Account_With_Same_Name_Twice_And_Return_Failed_Mes
        
 }
 
-TEST(CalendarDataStorage, Get_Account_Information){
+TEST_F(CalendarDataStorageTests, Get_Account_Information){
        
        CalendarDataStorage accountInformationTest;
        
@@ -83,7 +96,7 @@ TEST(CalendarDataStorage, Get_Account_Information){
        
 }
 
-TEST(CalendarDataStorage, Get_Account_Information_That_Does_Not_Exist_Return_No_Account_Message){
+TEST_F(CalendarDataStorageTests, Get_Account_Information_That_Does_Not_Exist_Return_No_Account_Message){
 
        CalendarDataStorage noAccountTest;
        
@@ -91,7 +104,7 @@ TEST(CalendarDataStorage, Get_Account_Information_That_Does_Not_Exist_Return_No_
        
 }
 
-TEST(CalendarDataStorage, Get_Two_Accounts_Information){
+TEST_F(CalendarDataStorageTests, Get_Two_Accounts_Information){
        
        CalendarDataStorage accountInformationTest;
        
@@ -110,7 +123,7 @@ TEST(CalendarDataStorage, Get_Two_Accounts_Information){
        
 }
 
-TEST(CalendarDataStorage, Get_Three_Accounts_Information){
+TEST_F(CalendarDataStorageTests, Get_Three_Accounts_Information){
        
        CalendarDataStorage accountInformationTest;
        
@@ -135,7 +148,7 @@ TEST(CalendarDataStorage, Get_Three_Accounts_Information){
        
 }
 
-TEST(CalendarDataStorage, Get_List_Of_One_Account){
+TEST_F(CalendarDataStorageTests, Get_List_Of_One_Account){
        
        CalendarDataStorage accountInformationTest;
        
@@ -153,7 +166,7 @@ TEST(CalendarDataStorage, Get_List_Of_One_Account){
        
 }
 
-TEST(CalendarDataStorage, Get_List_Of_Two_Accounts){
+TEST_F(CalendarDataStorageTests, Get_List_Of_Two_Accounts){
        
        CalendarDataStorage accountInformationTest;
        
@@ -177,7 +190,7 @@ TEST(CalendarDataStorage, Get_List_Of_Two_Accounts){
        
 }
 
-TEST(CalendarDataStorage, Get_List_Of_Three_Accounts){
+TEST_F(CalendarDataStorageTests, Get_List_Of_Three_Accounts){
        
        CalendarDataStorage accountInformationTest;
        
@@ -207,7 +220,7 @@ TEST(CalendarDataStorage, Get_List_Of_Three_Accounts){
 
 }
 
-TEST(CalendarDataStorage, Update_One_Account){
+TEST_F(CalendarDataStorageTests, Update_One_Account){
        
        CalendarDataStorage updateAccountTest;
        
@@ -222,7 +235,7 @@ TEST(CalendarDataStorage, Update_One_Account){
        
 }
 
-TEST(CalendarDataStorage, Update_One_Account_Set_Account_Name_To_No_Name_Return_No_Name_Message){
+TEST_F(CalendarDataStorageTests, Update_One_Account_Set_Account_Name_To_No_Name_Return_No_Name_Message){
 
        CalendarDataStorage updateAccountTest;
        
@@ -235,7 +248,7 @@ TEST(CalendarDataStorage, Update_One_Account_Set_Account_Name_To_No_Name_Return_
        
 }
 
-TEST(CalendarDataStorage, Update_One_Account_Set_Account_Name_To_Existing_Account_Return_Failed_Message){
+TEST_F(CalendarDataStorageTests, Update_One_Account_Set_Account_Name_To_Existing_Account_Return_Failed_Message){
 
        CalendarDataStorage updateAccountTest;
        
@@ -249,7 +262,7 @@ TEST(CalendarDataStorage, Update_One_Account_Set_Account_Name_To_Existing_Accoun
        
 }
 
-TEST(CalendarDataStorage, Update_One_Account_That_Does_Not_Exist_Return_No_Account_Message){
+TEST_F(CalendarDataStorageTests, Update_One_Account_That_Does_Not_Exist_Return_No_Account_Message){
 
        CalendarDataStorage updateAccountTest;
        
@@ -257,7 +270,7 @@ TEST(CalendarDataStorage, Update_One_Account_That_Does_Not_Exist_Return_No_Accou
        
 }
 
-TEST(CalendarDataStorage, Update_Two_Accounts){
+TEST_F(CalendarDataStorageTests, Update_Two_Accounts){
        
        CalendarDataStorage updateAccountTest;
        
@@ -281,7 +294,7 @@ TEST(CalendarDataStorage, Update_Two_Accounts){
        
 }
 
-TEST(CalendarDataStorage, Update_Three_Accounts){
+TEST_F(CalendarDataStorageTests, Update_Three_Accounts){
        
        CalendarDataStorage updateAccountTest;
        
@@ -312,7 +325,7 @@ TEST(CalendarDataStorage, Update_Three_Accounts){
 
 }
 
-TEST(CalendarDataStorage, Delete_One_Account){
+TEST_F(CalendarDataStorageTests, Delete_One_Account){
        
        CalendarDataStorage deleteAccountTest;
        
@@ -322,7 +335,7 @@ TEST(CalendarDataStorage, Delete_One_Account){
        
 }
 
-TEST(CalendarDataStorage, Delete_Two_Accounts){
+TEST_F(CalendarDataStorageTests, Delete_Two_Accounts){
        
        CalendarDataStorage deleteAccountTest;
        
@@ -334,7 +347,7 @@ TEST(CalendarDataStorage, Delete_Two_Accounts){
        
 }
 
-TEST(CalendarDataStorage, Delete_Three_Accounts){
+TEST_F(CalendarDataStorageTests, Delete_Three_Accounts){
        
        CalendarDataStorage deleteAccountTest;
        
@@ -348,7 +361,7 @@ TEST(CalendarDataStorage, Delete_Three_Accounts){
        
 }
 
-TEST(CalendarDataStorage, Delete_Account_That_Does_Not_Exist_Return_No_Account_Message){
+TEST_F(CalendarDataStorageTests, Delete_Account_That_Does_Not_Exist_Return_No_Account_Message){
 
        CalendarDataStorage deleteAccountTest;
        
@@ -356,7 +369,7 @@ TEST(CalendarDataStorage, Delete_Account_That_Does_Not_Exist_Return_No_Account_M
        
 }
 
-TEST(CalendarDataStorage, Add_One_Calendar_To_One_Account){
+TEST_F(CalendarDataStorageTests, Add_One_Calendar_To_One_Account){
        
        CalendarDataStorage addCalendarTest;
        
@@ -366,7 +379,7 @@ TEST(CalendarDataStorage, Add_One_Calendar_To_One_Account){
        
 }
 
-TEST(CalendarDataStorage, Add_Two_Calendars_To_One_Account){
+TEST_F(CalendarDataStorageTests, Add_Two_Calendars_To_One_Account){
        
        CalendarDataStorage addCalendarTest;
        
@@ -377,7 +390,7 @@ TEST(CalendarDataStorage, Add_Two_Calendars_To_One_Account){
        
 }
 
-TEST(CalendarDataStorage, Add_Three_Calendars_To_One_Account){
+TEST_F(CalendarDataStorageTests, Add_Three_Calendars_To_One_Account){
        
        CalendarDataStorage addCalendarTest;
        
@@ -389,7 +402,7 @@ TEST(CalendarDataStorage, Add_Three_Calendars_To_One_Account){
        
 }
 
-TEST(CalendarDataStorage, Add_Calendar_To_Account_That_Does_Not_Exist_Return_No_Account_Message){
+TEST_F(CalendarDataStorageTests, Add_Calendar_To_Account_That_Does_Not_Exist_Return_No_Account_Message){
 
        CalendarDataStorage addCalendarTest;
 
@@ -397,7 +410,7 @@ TEST(CalendarDataStorage, Add_Calendar_To_Account_That_Does_Not_Exist_Return_No_
        
 }
        
-TEST(CalendarDataStorage, Add_One_Calendar_To_Two_Accounts){
+TEST_F(CalendarDataStorageTests, Add_One_Calendar_To_Two_Accounts){
        
        CalendarDataStorage addCalendarTest;
        
@@ -410,7 +423,7 @@ TEST(CalendarDataStorage, Add_One_Calendar_To_Two_Accounts){
        
 }
 
-TEST(CalendarDataStorage, Add_Two_Calendars_To_Two_Accounts){
+TEST_F(CalendarDataStorageTests, Add_Two_Calendars_To_Two_Accounts){
        
        CalendarDataStorage addCalendarTest;
        
@@ -425,7 +438,7 @@ TEST(CalendarDataStorage, Add_Two_Calendars_To_Two_Accounts){
        
 }
 
-TEST(CalendarDataStorage, Add_Three_Calendars_To_Two_Accounts){
+TEST_F(CalendarDataStorageTests, Add_Three_Calendars_To_Two_Accounts){
        
        CalendarDataStorage addCalendarTest;
        
@@ -442,7 +455,7 @@ TEST(CalendarDataStorage, Add_Three_Calendars_To_Two_Accounts){
        
 }
 
-TEST(CalendarDataStorage, Add_One_Calendar_To_Three_Accounts){
+TEST_F(CalendarDataStorageTests, Add_One_Calendar_To_Three_Accounts){
        
        CalendarDataStorage addCalendarTest;
        
@@ -458,7 +471,7 @@ TEST(CalendarDataStorage, Add_One_Calendar_To_Three_Accounts){
        
 }
 
-TEST(CalendarDataStorage, Add_Two_Calendars_To_Three_Accounts){
+TEST_F(CalendarDataStorageTests, Add_Two_Calendars_To_Three_Accounts){
        
        CalendarDataStorage addCalendarTest;
        
@@ -477,7 +490,7 @@ TEST(CalendarDataStorage, Add_Two_Calendars_To_Three_Accounts){
        
 }
 
-TEST(CalendarDataStorage, Add_Three_Calendars_To_Three_Accounts){
+TEST_F(CalendarDataStorageTests, Add_Three_Calendars_To_Three_Accounts){
        
        CalendarDataStorage addCalendarTest;
        
@@ -499,7 +512,7 @@ TEST(CalendarDataStorage, Add_Three_Calendars_To_Three_Accounts){
        
 }
 
-TEST(CalendarDataStorage, Get_Calendar_Information_From_One_Account){
+TEST_F(CalendarDataStorageTests, Get_Calendar_Information_From_One_Account){
        
        CalendarDataStorage getCalendarTest;
        
@@ -551,7 +564,7 @@ TEST(CalendarDataStorage, Get_Calendar_Information_From_One_Account){
 
 }
 
-TEST(CalendarDataStorage, Get_Calendar_Information_From_Two_Accounts){
+TEST_F(CalendarDataStorageTests, Get_Calendar_Information_From_Two_Accounts){
        
        CalendarDataStorage getCalendarTest;
        
@@ -647,7 +660,7 @@ TEST(CalendarDataStorage, Get_Calendar_Information_From_Two_Accounts){
 
 }
 
-TEST(CalendarDataStorage, Get_Calendar_Information_From_Three_Accounts){
+TEST_F(CalendarDataStorageTests, Get_Calendar_Information_From_Three_Accounts){
        
        CalendarDataStorage getCalendarTest;
        
@@ -789,7 +802,7 @@ TEST(CalendarDataStorage, Get_Calendar_Information_From_Three_Accounts){
 
 }
 
-TEST(CalendarDataStorage, Update_One_Calendar_With_One_Account){
+TEST_F(CalendarDataStorageTests, Update_One_Calendar_With_One_Account){
        
        CalendarDataStorage updateCalendarTest;
        
@@ -805,7 +818,7 @@ TEST(CalendarDataStorage, Update_One_Calendar_With_One_Account){
        
 }
 
-TEST(CalendarDataStorage, Update_One_Calendar_With_Two_Accounts){
+TEST_F(CalendarDataStorageTests, Update_One_Calendar_With_Two_Accounts){
        
        CalendarDataStorage updateCalendarTest;
        
@@ -829,7 +842,7 @@ TEST(CalendarDataStorage, Update_One_Calendar_With_Two_Accounts){
        
 }
 
-TEST(CalendarDataStorage, Update_One_Calendar_With_Three_Accounts){
+TEST_F(CalendarDataStorageTests, Update_One_Calendar_With_Three_Accounts){
        
        CalendarDataStorage updateCalendarTest;
        
@@ -859,7 +872,7 @@ TEST(CalendarDataStorage, Update_One_Calendar_With_Three_Accounts){
        
 }
 
-TEST(CalendarDataStorage, Update_Two_Calendars_With_One_Account){
+TEST_F(CalendarDataStorageTests, Update_Two_Calendars_With_One_Account){
        
        CalendarDataStorage updateCalendarTest;
        
@@ -882,7 +895,7 @@ TEST(CalendarDataStorage, Update_Two_Calendars_With_One_Account){
        
 }
 
-TEST(CalendarDataStorage, Update_Two_Calendars_With_Two_Accounts){
+TEST_F(CalendarDataStorageTests, Update_Two_Calendars_With_Two_Accounts){
        
        CalendarDataStorage updateCalendarTest;
        
@@ -916,7 +929,7 @@ TEST(CalendarDataStorage, Update_Two_Calendars_With_Two_Accounts){
 
 }
 
-TEST(CalendarDataStorage, Update_Two_Calendars_With_Three_Accounts){
+TEST_F(CalendarDataStorageTests, Update_Two_Calendars_With_Three_Accounts){
        
        CalendarDataStorage updateCalendarTest;
        
@@ -962,7 +975,7 @@ TEST(CalendarDataStorage, Update_Two_Calendars_With_Three_Accounts){
 }
 
 
-TEST(CalendarDataStorage, Update_Three_Calendars_With_One_Account){
+TEST_F(CalendarDataStorageTests, Update_Three_Calendars_With_One_Account){
        
        CalendarDataStorage updateCalendarTest;
        
@@ -990,7 +1003,7 @@ TEST(CalendarDataStorage, Update_Three_Calendars_With_One_Account){
 
 }
 
-TEST(CalendarDataStorage, Update_Three_Calendars_With_Two_Accounts){
+TEST_F(CalendarDataStorageTests, Update_Three_Calendars_With_Two_Accounts){
        
        CalendarDataStorage updateCalendarTest;
        
@@ -1034,7 +1047,7 @@ TEST(CalendarDataStorage, Update_Three_Calendars_With_Two_Accounts){
 
 }
 
-TEST(CalendarDataStorage, Update_Three_Calendars_With_Three_Accounts){
+TEST_F(CalendarDataStorageTests, Update_Three_Calendars_With_Three_Accounts){
        
        CalendarDataStorage updateCalendarTest;
        
@@ -1094,7 +1107,7 @@ TEST(CalendarDataStorage, Update_Three_Calendars_With_Three_Accounts){
 
 }
 
-TEST(CalendarDataStorage, Delete_One_Calendar){
+TEST_F(CalendarDataStorageTests, Delete_One_Calendar){
        
        CalendarDataStorage deleteCalendarTest;
        int calendarID = 0;
@@ -1109,7 +1122,7 @@ TEST(CalendarDataStorage, Delete_One_Calendar){
        
 }
 
-TEST(CalendarDataStorage, Delete_Two_Calendars){
+TEST_F(CalendarDataStorageTests, Delete_Two_Calendars){
        
        CalendarDataStorage deleteCalendarTest;
        int calendarID1 = 0;
@@ -1129,7 +1142,7 @@ TEST(CalendarDataStorage, Delete_Two_Calendars){
        
 }
 
-TEST(CalendarDataStorage, Delete_Three_Calendars){
+TEST_F(CalendarDataStorageTests, Delete_Three_Calendars){
        
        CalendarDataStorage deleteCalendarTest;
        int calendarID1 = 0;
@@ -1154,7 +1167,7 @@ TEST(CalendarDataStorage, Delete_Three_Calendars){
        
 }
 
-TEST(CalendarDataStorage, Add_One_Event){
+TEST_F(CalendarDataStorageTests, Add_One_Event){
        
        CalendarDataStorage addEventTest;
        
@@ -1168,7 +1181,7 @@ TEST(CalendarDataStorage, Add_One_Event){
        
 }
 
-TEST(CalendarDataStorage, Add_Two_Events){
+TEST_F(CalendarDataStorageTests, Add_Two_Events){
        
        CalendarDataStorage addEventTest;
        
@@ -1187,7 +1200,7 @@ TEST(CalendarDataStorage, Add_Two_Events){
        
 }
 
-TEST(CalendarDataStorage, Add_Three_Events){
+TEST_F(CalendarDataStorageTests, Add_Three_Events){
        
        CalendarDataStorage addEventTest;
        
@@ -1211,7 +1224,7 @@ TEST(CalendarDataStorage, Add_Three_Events){
        
 }
 
-TEST(CalendarDataStorage, Add_One_Event_And_Get_Event_Basic_Information){
+TEST_F(CalendarDataStorageTests, Add_One_Event_And_Get_Event_Basic_Information){
        
        CalendarDataStorage addEventTest;       
 
@@ -1241,7 +1254,7 @@ TEST(CalendarDataStorage, Add_One_Event_And_Get_Event_Basic_Information){
 
 }
 
-TEST(CalendarDataStorage, Add_One_Event_And_Get_Event_Basic_Information_With_Duration){
+TEST_F(CalendarDataStorageTests, Add_One_Event_And_Get_Event_Basic_Information_With_Duration){
        
        CalendarDataStorage addEventTest;       
 
@@ -1278,7 +1291,7 @@ TEST(CalendarDataStorage, Add_One_Event_And_Get_Event_Basic_Information_With_Dur
 
 }
 
-TEST(CalendarDataStorage, Add_Two_Events_And_Get_Event_Basic_Information){
+TEST_F(CalendarDataStorageTests, Add_Two_Events_And_Get_Event_Basic_Information){
        
        CalendarDataStorage addEventTest;       
 
@@ -1334,7 +1347,7 @@ TEST(CalendarDataStorage, Add_Two_Events_And_Get_Event_Basic_Information){
        
 }
 
-TEST(CalendarDataStorage, Add_The_Same_Three_Events_And_Get_Event_Information){
+TEST_F(CalendarDataStorageTests, Add_The_Same_Three_Events_And_Get_Event_Information){
        
        CalendarDataStorage addEventTest;
 
@@ -1405,7 +1418,7 @@ TEST(CalendarDataStorage, Add_The_Same_Three_Events_And_Get_Event_Information){
        
 }
 
-TEST(CalendarDataStorage, Add_Three_Events_And_Get_Event_Information){
+TEST_F(CalendarDataStorageTests, Add_Three_Events_And_Get_Event_Information){
        
        CalendarDataStorage addEventTest;
 
@@ -1481,7 +1494,7 @@ TEST(CalendarDataStorage, Add_Three_Events_And_Get_Event_Information){
        
 }
 
-TEST(CalendarDataStorage, Delete_One_Event){
+TEST_F(CalendarDataStorageTests, Delete_One_Event){
        
        CalendarDataStorage deleteEventTest;
 
@@ -1495,7 +1508,7 @@ TEST(CalendarDataStorage, Delete_One_Event){
        
 }
 
-TEST(CalendarDataStorage, Delete_Two_Events){
+TEST_F(CalendarDataStorageTests, Delete_Two_Events){
        
        CalendarDataStorage deleteEventTest;
 
@@ -1512,7 +1525,7 @@ TEST(CalendarDataStorage, Delete_Two_Events){
        
 }
 
-TEST(CalendarDataStorage, Delete_Three_Events){
+TEST_F(CalendarDataStorageTests, Delete_Three_Events){
        
        CalendarDataStorage deleteEventTest;
 
@@ -1532,7 +1545,7 @@ TEST(CalendarDataStorage, Delete_Three_Events){
        
 }
 
-TEST(CalendarDataStorage, Delete_One_Calendar_And_Events){
+TEST_F(CalendarDataStorageTests, Delete_One_Calendar_And_Events){
 
        CalendarDataStorage deleteEventTest;
        
@@ -1550,7 +1563,7 @@ TEST(CalendarDataStorage, Delete_One_Calendar_And_Events){
        
 }
 
-TEST(CalendarDataStorage, Delete_Two_Calendars_And_Events){
+TEST_F(CalendarDataStorageTests, Delete_Two_Calendars_And_Events){
 
        CalendarDataStorage deleteEventTest;
        
@@ -1584,7 +1597,7 @@ TEST(CalendarDataStorage, Delete_Two_Calendars_And_Events){
        
 }
 
-TEST(CalendarDataStorage, Delete_Three_Calendars_And_Events){
+TEST_F(CalendarDataStorageTests, Delete_Three_Calendars_And_Events){
 
        CalendarDataStorage deleteEventTest;
        
@@ -1631,7 +1644,7 @@ TEST(CalendarDataStorage, Delete_Three_Calendars_And_Events){
        
 }
 
-TEST(CalendarDataStorage, Delete_One_Account_And_Associated_Data){
+TEST_F(CalendarDataStorageTests, Delete_One_Account_And_Associated_Data){
        
        CalendarDataStorage deleteAccountTest;
        
@@ -1655,7 +1668,7 @@ TEST(CalendarDataStorage, Delete_One_Account_And_Associated_Data){
        
 }
 
-TEST(CalendarDataStorage, Delete_Two_Accounts_And_Associated_Data){
+TEST_F(CalendarDataStorageTests, Delete_Two_Accounts_And_Associated_Data){
        
        CalendarDataStorage deleteAccountTest;
        
@@ -1703,7 +1716,7 @@ TEST(CalendarDataStorage, Delete_Two_Accounts_And_Associated_Data){
 
 }
 
-TEST(CalendarDataStorage, Delete_Three_Accounts_And_Associated_Data){
+TEST_F(CalendarDataStorageTests, Delete_Three_Accounts_And_Associated_Data){
        
        CalendarDataStorage deleteAccountTest;
        
@@ -1770,7 +1783,7 @@ TEST(CalendarDataStorage, Delete_Three_Accounts_And_Associated_Data){
 
 }
 
-TEST(CalendarDataStorage, Get_List_Of_Events_For_One_Account){
+TEST_F(CalendarDataStorageTests, Get_List_Of_Events_For_One_Account){
 
        CalendarDataStorage getEventsListTest;
        
@@ -1794,7 +1807,7 @@ TEST(CalendarDataStorage, Get_List_Of_Events_For_One_Account){
        
 }
 
-TEST(CalendarDataStorage, Get_List_Of_Events_For_Two_Accounts){
+TEST_F(CalendarDataStorageTests, Get_List_Of_Events_For_Two_Accounts){
 
        CalendarDataStorage getEventsListTest;
        
@@ -1832,7 +1845,7 @@ TEST(CalendarDataStorage, Get_List_Of_Events_For_Two_Accounts){
        
 }
 
-TEST(CalendarDataStorage, Get_List_Of_Events_For_Three_Accounts){
+TEST_F(CalendarDataStorageTests, Get_List_Of_Events_For_Three_Accounts){
 
        CalendarDataStorage getEventsListTest;
        
@@ -1882,7 +1895,7 @@ TEST(CalendarDataStorage, Get_List_Of_Events_For_Three_Accounts){
 
 }
 
-TEST(CalendarDataStorage, Get_List_Of_Calendars_For_One_Account){
+TEST_F(CalendarDataStorageTests, Get_List_Of_Calendars_For_One_Account){
        
        CalendarDataStorage getEventsListTest;
        
@@ -1908,7 +1921,7 @@ TEST(CalendarDataStorage, Get_List_Of_Calendars_For_One_Account){
        
 }
 
-TEST(CalendarDataStorage, Get_List_Of_Calendars_For_Two_Accounts){
+TEST_F(CalendarDataStorageTests, Get_List_Of_Calendars_For_Two_Accounts){
        
        CalendarDataStorage getEventsListTest;
        
@@ -1951,7 +1964,7 @@ TEST(CalendarDataStorage, Get_List_Of_Calendars_For_Two_Accounts){
 
 }
 
-TEST(CalendarDataStorage, Get_List_Of_Calendars_For_Three_Accounts){
+TEST_F(CalendarDataStorageTests, Get_List_Of_Calendars_For_Three_Accounts){
        
        CalendarDataStorage getEventsListTest;
        
@@ -2011,7 +2024,7 @@ TEST(CalendarDataStorage, Get_List_Of_Calendars_For_Three_Accounts){
 
 }
 
-TEST(CalendarDataStorage, Add_One_Checksum){
+TEST_F(CalendarDataStorageTests, Add_One_Checksum){
        
        CalendarDataStorage checksumTest;
        
@@ -2023,7 +2036,7 @@ TEST(CalendarDataStorage, Add_One_Checksum){
        
 }
 
-TEST(CalendarDataStorage, Add_Two_Checksus){
+TEST_F(CalendarDataStorageTests, Add_Two_Checksus){
        
        CalendarDataStorage checksumTest;
        
@@ -2032,7 +2045,7 @@ TEST(CalendarDataStorage, Add_Two_Checksus){
        
 }
 
-TEST(CalendarDataStorage, Add_Three_Checksus){
+TEST_F(CalendarDataStorageTests, Add_Three_Checksus){
        
        CalendarDataStorage checksumTest;
        
@@ -2042,7 +2055,7 @@ TEST(CalendarDataStorage, Add_Three_Checksus){
        
 }
 
-TEST(CalendarDataStorage, Add_One_Checksum_And_Get_One_Checksum){
+TEST_F(CalendarDataStorageTests, Add_One_Checksum_And_Get_One_Checksum){
        
        CalendarDataStorage checksumTest;
        
@@ -2057,7 +2070,7 @@ TEST(CalendarDataStorage, Add_One_Checksum_And_Get_One_Checksum){
        
 }
 
-TEST(CalendarDataStorage, Add_Two_Checksums_And_Get_Two_Checksums){
+TEST_F(CalendarDataStorageTests, Add_Two_Checksums_And_Get_Two_Checksums){
        
        CalendarDataStorage checksumTest;
        
@@ -2078,7 +2091,7 @@ TEST(CalendarDataStorage, Add_Two_Checksums_And_Get_Two_Checksums){
        
 }
 
-TEST(CalendarDataStorage, Add_Three_Checksums_And_Get_Three_Checksums){
+TEST_F(CalendarDataStorageTests, Add_Three_Checksums_And_Get_Three_Checksums){
        
        CalendarDataStorage checksumTest;
        
@@ -2105,7 +2118,7 @@ TEST(CalendarDataStorage, Add_Three_Checksums_And_Get_Three_Checksums){
        
 }
 
-TEST(CalendarDataStorage, Add_One_Checksum_Update_One_Checksum_And_Get_One_Checksum){
+TEST_F(CalendarDataStorageTests, Add_One_Checksum_Update_One_Checksum_And_Get_One_Checksum){
        
        CalendarDataStorage checksumTest;
        
@@ -2131,7 +2144,7 @@ TEST(CalendarDataStorage, Add_One_Checksum_Update_One_Checksum_And_Get_One_Check
        
 }
 
-TEST(CalendarDataStorage, Add_Two_Checksums_Update_Two_Checksums_And_Get_Two_Checksums){
+TEST_F(CalendarDataStorageTests, Add_Two_Checksums_Update_Two_Checksums_And_Get_Two_Checksums){
        
        CalendarDataStorage checksumTest;
        
@@ -2169,7 +2182,7 @@ TEST(CalendarDataStorage, Add_Two_Checksums_Update_Two_Checksums_And_Get_Two_Che
        
 }
 
-TEST(CalendarDataStorage, Add_Three_Checksums_Update_Three_Checksums_And_Get_Three_Checksums){
+TEST_F(CalendarDataStorageTests, Add_Three_Checksums_Update_Three_Checksums_And_Get_Three_Checksums){
        
        CalendarDataStorage checksumTest;
        
diff --git a/source/tests/CalendarDataStorageTests/main.cpp b/source/tests/CalendarDataStorageTests/main.cpp
new file mode 100644 (file)
index 0000000..0f36e87
--- /dev/null
@@ -0,0 +1,8 @@
+#include <gtest/gtest.h>
+
+int main(int argc, char **argv)
+{    
+    ::testing::GTEST_FLAG(shuffle) = true;
+    ::testing::InitGoogleTest(&argc, argv); 
+    return RUN_ALL_TESTS();
+}
 #include "../common/text.h"
 #include "../common/colour.h"
 #include "../common/monthviewgen.h"
-
-TEST(CommonFunctions, FileTests){
+#include <gtest/gtest.h>
+
+class CommonFunctionsTests : public ::testing::Test
+{
+private:
+    virtual void SetUp()
+    {
+    }
+    
+    virtual void TearDown()
+    {
+    }
+};
+
+TEST_F(CommonFunctionsTests, FileTests){
        
        ASSERT_EQ(false, FileExists("iCalendarEvent-Missing.vcf"));
        ASSERT_EQ(true, FileExists("iCalendarEvent-InvalidPermissions.vcf"));
        
 }
 
-TEST(CommonFunctions, ProcessTextVectorsTests){
+TEST_F(CommonFunctionsTests, ProcessTextVectorsTests){
        
        // Setup the objects to be used for processing.
        
@@ -175,7 +188,7 @@ TEST(CommonFunctions, ProcessTextVectorsTests){
 
 }
 
-TEST(CommonFunctions, SplitValuesTests){
+TEST_F(CommonFunctionsTests, SplitValuesTests){
        
        map<string, string> textExample1TestResult;
        
@@ -187,7 +200,7 @@ TEST(CommonFunctions, SplitValuesTests){
        
 }
 
-TEST(CommonFunctions, SplitNameValueTests){
+TEST_F(CommonFunctionsTests, SplitNameValueTests){
        
        PropertyNameValue nameValueResult;
                
@@ -201,7 +214,7 @@ TEST(CommonFunctions, SplitNameValueTests){
        
 }
 
-TEST(CommonFunctions, HexToInt){
+TEST_F(CommonFunctionsTests, HexToInt){
        
        string value1 = "10";           // 16
        string value2 = "50";           // 80
@@ -262,7 +275,7 @@ TEST(CommonFunctions, HexToInt){
 
 }
 
-TEST(CommonFunctions, SplitPathFilename){
+TEST_F(CommonFunctionsTests, SplitPathFilename){
        
        // Setup the file split.
        
@@ -295,7 +308,7 @@ TEST(CommonFunctions, SplitPathFilename){
 
 }
 
-TEST(CommonFunctions, ColourStruct){
+TEST_F(CommonFunctionsTests, ColourStruct){
        
        Colour colour1;
        Colour colour2;
@@ -363,7 +376,7 @@ TEST(CommonFunctions, ColourStruct){
        ASSERT_EQ(32, colour8.alpha);
 }
 
-TEST(CommonFunctions, OutputText){
+TEST_F(CommonFunctionsTests, OutputText){
        
        string inputText1 = "This is an example text.";
        string outputText1 = "This is an example text.";
@@ -438,7 +451,7 @@ TEST(CommonFunctions, OutputText){
 
 }
 
-TEST(CommonFunctions, PreviousMonthNumberofDays){
+TEST_F(CommonFunctionsTests, PreviousMonthNumberofDays){
 
        // Test the year 2015 (does not have a leap year).
        
@@ -496,7 +509,7 @@ TEST(CommonFunctions, PreviousMonthNumberofDays){
        
 }
 
-TEST(CommonFunctions, monthViewGenerator){
+TEST_F(CommonFunctionsTests, monthViewGenerator){
        
        XCCalendarMonthViewGrid monthView = GenerateMonthGrid(6, 2016);
 
diff --git a/source/tests/CommonFunctionsTests/main.cpp b/source/tests/CommonFunctionsTests/main.cpp
new file mode 100644 (file)
index 0000000..0f36e87
--- /dev/null
@@ -0,0 +1,8 @@
+#include <gtest/gtest.h>
+
+int main(int argc, char **argv)
+{    
+    ::testing::GTEST_FLAG(shuffle) = true;
+    ::testing::InitGoogleTest(&argc, argv); 
+    return RUN_ALL_TESTS();
+}
diff --git a/source/tests/Makefile.in b/source/tests/Makefile.in
new file mode 100644 (file)
index 0000000..2fd4c19
--- /dev/null
@@ -0,0 +1,184 @@
+CPP=g++
+STRIP=strip
+CPPFLAGS=`xml2-config --cflags` `wx-config --cxxflags` -I.. -I../objects -std=c++11 -pthread -DXESTIACAL_UNITTEST -ggdb -O0 -g --coverage -fprofile-arcs -ftest-coverage
+CPPLIBS=`wx-config --libs` `curl-config --libs` -lsfml-audio -lxml2 -lgtest -coverage -lsqlite3
+MAKE=make
+OBJDIR=.
+
+ICALEVENTTESTS_OUT=xestiacalendar_icaleventtests
+ICALJOURNALTESTS_OUT=xestiacalendar_icaleventtests
+ICALTASKTESTS_OUT=xestiacalendar_icaltasktests
+ICALFREEBUSYTESTS_OUT=xestiacalendar_icalfreebusytests
+ICALTIMEZONETESTS_OUT=xestiacalendar_icaltimezonetests
+COMMONFUNCTIONSTESTS_OUT=xestiacalendar_commonfunctionstests
+CALENDARDATASTORAGETESTS_OUT=xestiacalendar_calendardatastoragetests
+
+ICALEVENTTESTS_OBJS=iCalendarEventTests/iCalendarEventLoad.cpp \
+       iCalendarEventTests/iCalendarEventSave.cpp \
+       ../objects/calendarobject/CalendarObject.cpp \
+       ../objects/calendarobject/CalendarObject-Save.cpp \
+       ../objects/calendarevent/CalendarEvent.cpp \
+       ../objects/calendarevent/CalendarEvent-Save.cpp \
+       ../common/file.cpp \
+       ../common/text.cpp \
+       iCalendarEventTests/main.cpp
+
+ICALJOURNALTESTS_OBJS=iCalendarJournalTests/iCalendarJournalLoad.cpp \
+       iCalendarJournalTests/iCalendarJournalSave.cpp \
+       ../objects/calendarobject/CalendarObject.cpp \
+       ../objects/calendarobject/CalendarObject-Save.cpp \
+       ../objects/calendarjournal/CalendarJournal.cpp \
+       ../objects/calendarjournal/CalendarJournal-Save.cpp \
+       ../common/file.cpp \
+       ../common/text.cpp \
+       iCalendarJournalTests/main.cpp
+
+ICALTASKTESTS_OBJS=iCalendarTaskTests/iCalendarTaskLoad.cpp \
+       iCalendarTaskTests/iCalendarTaskSave.cpp \
+       ../objects/calendarobject/CalendarObject.cpp \
+       ../objects/calendarobject/CalendarObject-Save.cpp \
+       ../objects/calendartask/CalendarTask.cpp \
+       ../objects/calendartask/CalendarTask-Save.cpp \
+       ../common/file.cpp \
+       ../common/text.cpp \
+       iCalendarTaskTests/main.cpp
+       
+ICALFREEBUSYTESTS_OBJS=iCalendarFreeBusyTests/iCalendarFreeBusyLoad.cpp \
+       iCalendarFreeBusyTests/iCalendarFreeBusySave.cpp \
+       ../objects/calendarobject/CalendarObject.cpp \
+       ../objects/calendarobject/CalendarObject-Save.cpp \
+       ../objects/calendarfreebusy/CalendarFreeBusy.cpp \
+       ../objects/calendarfreebusy/CalendarFreeBusy-Save.cpp \
+       ../common/file.cpp \
+       ../common/text.cpp \
+       iCalendarFreeBusyTests/main.cpp
+
+ICALTIMEZONETESTS_OBJS=iCalendarTimeZoneTests/iCalendarTimeZoneLoad.cpp \
+       iCalendarTimeZoneTests/iCalendarTimeZoneSave.cpp \
+       ../objects/calendarobject/CalendarObject.cpp \
+       ../objects/calendarobject/CalendarObject-Save.cpp \
+       ../objects/calendartimezone/CalendarTimezone.cpp \
+       ../objects/calendartimezone/CalendarTimezone-Save.cpp \
+       ../common/file.cpp \
+       ../common/text.cpp \
+       iCalendarTimeZoneTests/main.cpp
+
+COMMONFUNCTIONSTESTS_OBJS=CommonFunctionsTests/CommonFunctionsTests.cpp \
+       ../common/file.cpp \
+       ../common/text.cpp \
+       ../common/monthviewgen.cpp \
+       CommonFunctionsTests/main.cpp
+
+CALENDARDATASTORAGETESTS_OBJS=CalendarDataStorageTests/CalendarDataStorageTests.cpp \
+       ../libraries/CalendarDataStorage/CalendarDataStorage.cpp \
+       ../objects/calendarobject/CalendarObject.cpp \
+       ../objects/calendarobject/CalendarObject-Save.cpp \
+       ../objects/calendarevent/CalendarEvent.cpp \
+       ../objects/calendarevent/CalendarEvent-Save.cpp \
+       ../common/random.cpp \
+       ../common/file.cpp \
+       ../common/text.cpp \
+       CalendarDataStorageTests/main.cpp
+
+setupbrokenfiles:
+       chmod 000 iCalendarEvent-InvalidPermissions.vcf
+       chmod 000 iCalendarJournal-InvalidPermissions.vcf
+       chmod 000 iCalendarTask-InvalidPermissions.vcf
+       chmod 000 iCalendarFreeBusy-InvalidPermissions.vcf
+       chmod 000 iCalendarTimezone-InvalidPermissions.vcf
+
+resetbrokenfiles:
+       chmod 660 iCalendarEvent-InvalidPermissions.vcf
+       chmod 660 iCalendarJournal-InvalidPermissions.vcf
+       chmod 660 iCalendarTask-InvalidPermissions.vcf
+       chmod 660 iCalendarFreeBusy-InvalidPermissions.vcf
+       chmod 660 iCalendarTimezone-InvalidPermissions.vcf
+
+icaleventtests-objs: $(ICALEVENTTESTS_OBJS)
+
+icaleventtests-exec: icaleventtests-objs
+       $(CPP) $(CPPFLAGS) $(ICALEVENTTESTS_OBJS) -o $(ICALEVENTTESTS_OUT) $(CPPLIBS)
+
+icaleventtests-coverage: icaleventtests-exec
+       gcov iCalendarEventTests/*.cpp
+       ./$(ICALEVENTTESTS_OUT) --gtest_output=xml:icaleventtests.xml
+       lcov -c --directory . --output-file xestiacalendar_icaleventtests.info
+
+icaljournaltests-objs: $(ICALJOURNALTESTS_OBJS)
+
+icaljournaltests-exec: icaljournaltests-objs
+       $(CPP) $(CPPFLAGS) $(ICALJOURNALTESTS_OBJS) -o $(ICALJOURNALTESTS_OUT) $(CPPLIBS)
+
+icaljournaltests-coverage: icaljournaltests-exec
+       gcov iCalendarJournalTests/*.cpp
+       ./$(ICALJOURNALTESTS_OUT) --gtest_output=xml:icaljournaltests.xml
+       lcov -c --directory . --output-file xestiacalendar_icaljournaltests.info
+
+icaltasktests-objs: $(ICALTASKTESTS_OBJS)
+
+icaltasktests-exec: icaltasktests-objs
+       $(CPP) $(CPPFLAGS) $(ICALTASKTESTS_OBJS) -o $(ICALTASKTESTS_OUT) $(CPPLIBS)
+
+icaltasktests-coverage: icaltasktests-exec
+       gcov iCalendarTaskTests/*.cpp
+       ./$(ICALTASKTESTS_OUT) --gtest_output=xml:icaltasktests.xml
+       lcov -c --directory . --output-file xestiacalendar_icaltasktests.info
+
+icalfreebusytests-objs: $(ICALFREEBUSYTESTS_OBJS)
+
+icalfreebusytests-exec: icalfreebusytests-objs
+       $(CPP) $(CPPFLAGS) $(ICALFREEBUSYTESTS_OBJS) -o $(ICALFREEBUSYTESTS_OUT) $(CPPLIBS)
+
+icalfreebusytests-coverage: icalfreebusytests-exec
+       gcov iCalendarFreeBusyTests/*.cpp
+       ./$(ICALFREEBUSYTESTS_OUT) --gtest_output=xml:icalfreebusytests.xml
+       lcov -c --directory . --output-file xestiacalendar_icalfreebusytests.info
+
+icaltimezonetests-objs: $(ICALTIMEZONETESTS_OBJS)
+
+icaltimezonetests-exec: icaltimezonetests-objs
+       $(CPP) $(CPPFLAGS) $(ICALTIMEZONETESTS_OBJS) -o $(ICALTIMEZONETESTS_OUT) $(CPPLIBS)
+
+icaltimezonetests-coverage: icaltimezonetests-exec
+       gcov iCalendarTimeZoneTests/*.cpp
+       ./$(ICALTIMEZONETESTS_OUT) --gtest_output=xml:icaltimezonetests.xml
+       lcov -c --directory . --output-file xestiacalendar_icaltimezonetests.info
+
+commonfunctionstests-objs: $(COMMONFUNCTIONSTESTS_OBJS)
+
+commonfunctionstests-exec: commonfunctionstests-objs
+       $(CPP) $(CPPFLAGS) $(COMMONFUNCTIONSTESTS_OBJS) -o $(COMMONFUNCTIONSTESTS_OUT) $(CPPLIBS)
+
+commonfunctionstests-coverage: commonfunctionstests-exec
+       gcov CommonFunctionsTests/*.cpp
+       ./$(COMMONFUNCTIONSTESTS_OUT) --gtest_output=xml:commonfunctionstests.xml
+       lcov -c --directory . --output-file xestiacalendar_commonfunctionstests.info
+
+calendardatastoragetests-objs: $(CALENDARDATASTORAGETESTS_OBJS)
+
+calendardatastoragetests-exec: calendardatastoragetests-objs
+       $(CPP) $(CPPFLAGS) $(CALENDARDATASTORAGETESTS_OBJS) -o $(CALENDARDATASTORAGETESTS_OUT) $(CPPLIBS)
+
+calendardatastoragetests-coverage: calendardatastoragetests-exec
+       gcov iCalendarTimeZoneTests/*.cpp
+       ./$(CALENDARDATASTORAGETESTS_OUT) --gtest_output=xml:calendardatastoragetests.xml
+       lcov -c --directory . --output-file xestiacalendar_calendardatastoragetests.info
+
+clean: resetbrokenfiles
+       rm -rf *.gcda *.gcno *.xml *.info
+       rm -rf $(ICALEVENTTESTS_OUT) $(ICALJOURNALTESTS_OUT) $(ICALTASKTESTS_OUT) $(ICALFREEBUSYTESTS_OUT) $(ICALTIMEZONETESTS_OUT) $(COMMONFUNCTIONSTESTS_OUT) $(CALENDARDATASTORAGETESTS_OUT)
+       rm -rf Output report
+
+codecoverage: setupbrokenfiles icaleventtests-coverage icaljournaltests-coverage \
+                               icaltasktests-coverage icalfreebusytests-coverage icaltimezonetests-coverage \
+                               commonfunctionstests-coverage calendardatastoragetests-coverage
+       lcov -a xestiacalendar_icaleventtests.info -o xestiacalendar_tests.info
+       lcov -a xestiacalendar_icaljournaltests.info -o xestiacalendar_tests.info
+       lcov -a xestiacalendar_icaltasktests.info -o xestiacalendar_tests.info
+       lcov -a xestiacalendar_icalfreebusytests.info -o xestiacalendar_tests.info
+       lcov -a xestiacalendar_icaltimezonetests.info -o xestiacalendar_tests.info      
+       lcov -a xestiacalendar_commonfunctionstests.info -o xestiacalendar_tests.info   
+       lcov -a xestiacalendar_calendardatastoragetests.info -o xestiacalendar_tests.info
+       lcov -r xestiacalendar_tests.info '/usr/include/*' -o xestiacalendar_tests.info
+       lcov -r xestiacalendar_tests.info '*tests/*' -o xestiacalendar_tests.info
+       genhtml xestiacalendar_tests.info -output-directory report
diff --git a/source/tests/PriorityIcon-32.png b/source/tests/PriorityIcon-32.png
deleted file mode 100644 (file)
index ba5080d..0000000
Binary files a/source/tests/PriorityIcon-32.png and /dev/null differ
diff --git a/source/tests/PriorityIcon.png b/source/tests/PriorityIcon.png
deleted file mode 100644 (file)
index ceae322..0000000
Binary files a/source/tests/PriorityIcon.png and /dev/null differ
diff --git a/source/tests/build-gui.sh b/source/tests/build-gui.sh
deleted file mode 100755 (executable)
index c86a60c..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/bin/sh
-
-g++ `wx-config --libs --cxxflags` -ggdb --std=c++11 \
-xestiacalendar_testxccalendarday.cpp \
-../widgets/XCCalendarDay.cpp \
-../widgets/XCCalendarDayEntry.cpp \
--DXESTIACAL_UNITTEST -o xestiacalendar_testgui_xccalendarday
-
-g++ `wx-config --libs --cxxflags` -ggdb --std=c++11 \
-xestiacalendar_testxccalendarmonthview.cpp \
-../widgets/XCCalendarMonthView.cpp \
-../widgets/XCCalendarMonthViewDayTitle.cpp \
-../widgets/XCCalendarDay.cpp \
-../widgets/XCCalendarDayEntry.cpp \
-../common/monthviewgen.cpp \
--DXESTIACAL_UNITTEST -o xestiacalendar_testgui_xccalendarmonthview
diff --git a/source/tests/build.sh b/source/tests/build.sh
deleted file mode 100755 (executable)
index 3fe9257..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/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 \
-../objects/calendarevent/CalendarEvent-Save.cpp \
-../objects/calendartask/CalendarTask.cpp \
-../objects/calendartask/CalendarTask-Save.cpp \
-../objects/calendarjournal/CalendarJournal.cpp \
-../objects/calendarjournal/CalendarJournal-Save.cpp \
-../objects/calendarfreebusy/CalendarFreeBusy.cpp \
-../objects/calendarfreebusy/CalendarFreeBusy-Save.cpp \
-../objects/calendartimezone/CalendarTimezone.cpp \
-../objects/calendartimezone/CalendarTimezone-Save.cpp \
-../objects/calendarobject/CalendarObject.cpp \
-../objects/calendarobject/CalendarObject-Save.cpp \
-../common/file.cpp \
-../common/text.cpp \
-../common/uuid.cpp \
-../common/monthviewgen.cpp \
-../common/random.cpp \
-../objects/CalDAV/CalDAV.cpp \
-../objects/CalDAV/CalDAV-XMLProcessing.cpp \
--DXESTIACAL_UNITTEST -o xestiacalendar_test \
--L. -lCalendarDataStorage-test -lsqlite3
diff --git a/source/tests/iCalendarEvent-Save2.ics b/source/tests/iCalendarEvent-Save2.ics
new file mode 100644 (file)
index 0000000..e69de29
@@ -1,6 +1,6 @@
-// xestiacalendar_icaleventload.h - Xestia Calendar iCalendar Event Component Unit Tests
+// iCalendarEventLoad.cpp - Xestia Calendar iCalendar Event Component Unit Tests
 //
-// (c) 2016-2017 Xestia Software Development.
+// (c) 2016-2019 Xestia Software Development.
 //
 // This file is part of Xestia Calendar.
 //
 // You should have received a copy of the GNU General Public License along
 // with Xestia Calendar. If not, see <http://www.gnu.org/licenses/>
 
-#include "../objects/calendarevent/CalendarEvent.h"
+#include "../../objects/calendarevent/CalendarEvent.h"
+#include <gtest/gtest.h>
 
-TEST(iCalendarEvent, BasicTests){
+class iCalendarEventLoadTests : public ::testing::Test
+{
+private:
+    virtual void SetUp()
+    {
+    }
+    
+    virtual void TearDown()
+    {
+    }
+};
+
+TEST_F(iCalendarEventLoadTests, BasicTests){
 
        CalendarEventObject testEvent;
        
@@ -28,7 +41,7 @@ TEST(iCalendarEvent, BasicTests){
        
 }
 
-TEST(iCalendarEvent, BaseObjectVerifyTests){
+TEST_F(iCalendarEventLoadTests, BaseObjectVerifyTests){
 
        CalendarEventObject testEvent;
        testEvent.LoadFile("iCalendarEvent-Load1.vcf");
@@ -46,7 +59,7 @@ TEST(iCalendarEvent, BaseObjectVerifyTests){
        
 }
 
-TEST(iCalendarEvent, ObjectDataTests){
+TEST_F(iCalendarEventLoadTests, ObjectDataTests){
        
        CalendarEventObject testEvent;
        ASSERT_EQ(CALENDAROBJECTLOAD_OK, testEvent.LoadFile("iCalendarEvent-Load2.vcf"));
@@ -1072,7 +1085,7 @@ TEST(iCalendarEvent, ObjectDataTests){
        
 }
 
-TEST(iCalendarEvent, AlarmTests){
+TEST_F(iCalendarEventLoadTests, AlarmTests){
 
        CalendarEventObject testEvent;
        ASSERT_EQ(CALENDAROBJECTLOAD_OK, testEvent.LoadFile("iCalendarEvent-Load2.vcf"));
@@ -1,6 +1,6 @@
-// xestiacalendar_icaleventsave.h - Xestia Calendar iCalendar Event Component Save Unit Tests
+// iCalendarEventSave.cpp - Xestia Calendar iCalendar Event Component Save Unit Tests
 //
-// (c) 2016-2017 Xestia Software Development.
+// (c) 2016-2019 Xestia Software Development.
 //
 // This file is part of Xestia Calendar.
 //
 // You should have received a copy of the GNU General Public License along
 // with Xestia Calendar. If not, see <http://www.gnu.org/licenses/>
 
-#include "../objects/calendarevent/CalendarEvent.h"
+#include "../../objects/calendarevent/CalendarEvent.h"
+#include <gtest/gtest.h>
 
-TEST(iCalendarSaveEvent, SaveEventTests){
+class iCalendarEventSaveTests : public ::testing::Test
+{
+private:
+    virtual void SetUp()
+    {
+    }
+    
+    virtual void TearDown()
+    {
+    }
+};
+
+TEST_F(iCalendarEventSaveTests, SaveEventTests){
 
        CalendarEventObject testEvent;
        CalendarEventObject testEvent2;
diff --git a/source/tests/iCalendarEventTests/main.cpp b/source/tests/iCalendarEventTests/main.cpp
new file mode 100644 (file)
index 0000000..0f36e87
--- /dev/null
@@ -0,0 +1,8 @@
+#include <gtest/gtest.h>
+
+int main(int argc, char **argv)
+{    
+    ::testing::GTEST_FLAG(shuffle) = true;
+    ::testing::InitGoogleTest(&argc, argv); 
+    return RUN_ALL_TESTS();
+}
 // with Xestia Calendar. If not, see <http://www.gnu.org/licenses/>
 
 #include "../objects/calendarfreebusy/CalendarFreeBusy.h"
+#include <gtest/gtest.h>
 
-TEST(iCalendarFreeBusy, BasicTests){
+class iCalendarFreeBusyLoadTests : public ::testing::Test
+{
+private:
+    virtual void SetUp()
+    {
+    }
+    
+    virtual void TearDown()
+    {
+    }
+};
+
+TEST_F(iCalendarFreeBusyLoadTests, BasicTests){
 
        CalendarFreeBusyObject testFreeBusy;
        
@@ -28,7 +41,7 @@ TEST(iCalendarFreeBusy, BasicTests){
        
 }
 
-TEST(iCalendarFreeBusy, ObjectDataTests){
+TEST_F(iCalendarFreeBusyLoadTests, ObjectDataTests){
        
        CalendarFreeBusyObject testFreeBusy;
        ASSERT_EQ(CALENDAROBJECTLOAD_OK, testFreeBusy.LoadFile("iCalendarFreeBusy-Load2.vcf"));
 // with Xestia Calendar. If not, see <http://www.gnu.org/licenses/>
 
 #include "../objects/calendarfreebusy/CalendarFreeBusy.h"
+#include <gtest/gtest.h>
 
-TEST(iCalendarSaveFreeBusy, SaveFreeBusyTests){
+class iCalendarFreeBusySaveTests : public ::testing::Test
+{
+private:
+    virtual void SetUp()
+    {
+    }
+    
+    virtual void TearDown()
+    {
+    }
+};
+
+TEST_F(iCalendarFreeBusySaveTests, SaveFreeBusyTests){
        
        CalendarFreeBusyObject testFreeBusy;
        CalendarFreeBusyObject testFreeBusy2;
diff --git a/source/tests/iCalendarFreeBusyTests/main.cpp b/source/tests/iCalendarFreeBusyTests/main.cpp
new file mode 100644 (file)
index 0000000..0f36e87
--- /dev/null
@@ -0,0 +1,8 @@
+#include <gtest/gtest.h>
+
+int main(int argc, char **argv)
+{    
+    ::testing::GTEST_FLAG(shuffle) = true;
+    ::testing::InitGoogleTest(&argc, argv); 
+    return RUN_ALL_TESTS();
+}
 // You should have received a copy of the GNU General Public License along
 // with Xestia Calendar. If not, see <http://www.gnu.org/licenses/>
 
-#include "../objects/calendarjournal/CalendarJournal.h"
-
-TEST(iCalendarJournal, BasicTests){
+#include "calendarjournal/CalendarJournal.h"
+#include <gtest/gtest.h>
+
+class iCalendarJournalLoadTests : public ::testing::Test
+{
+private:
+    virtual void SetUp()
+    {
+    }
+    
+    virtual void TearDown()
+    {
+    }
+};
+
+TEST_F(iCalendarJournalLoadTests, BasicTests){
 
        CalendarJournalObject testJournal;
        
@@ -28,7 +41,7 @@ TEST(iCalendarJournal, BasicTests){
        
 }
 
-TEST(iCalendarJournal, ObjectDataTests){
+TEST_F(iCalendarJournalLoadTests, ObjectDataTests){
        
        CalendarJournalObject testJournal;
        ASSERT_EQ(CALENDAROBJECTLOAD_OK, testJournal.LoadFile("iCalendarJournal-Load2.vcf"));
 // You should have received a copy of the GNU General Public License along
 // with Xestia Calendar. If not, see <http://www.gnu.org/licenses/>
 
-#include "../objects/calendarjournal/CalendarJournal.h"
+#include "calendarjournal/CalendarJournal.h"
+#include <gtest/gtest.h>
 
-TEST(iCalendarSaveJournal, SaveEventTests){
+class iCalendarJournalSaveTests : public ::testing::Test
+{
+private:
+    virtual void SetUp()
+    {
+    }
+    
+    virtual void TearDown()
+    {
+    }
+};
+
+TEST_F(iCalendarJournalSaveTests, SaveEventTests){
 
        CalendarJournalObject testJournal;
        CalendarJournalObject testJournal2;
diff --git a/source/tests/iCalendarJournalTests/main.cpp b/source/tests/iCalendarJournalTests/main.cpp
new file mode 100644 (file)
index 0000000..0f36e87
--- /dev/null
@@ -0,0 +1,8 @@
+#include <gtest/gtest.h>
+
+int main(int argc, char **argv)
+{    
+    ::testing::GTEST_FLAG(shuffle) = true;
+    ::testing::InitGoogleTest(&argc, argv); 
+    return RUN_ALL_TESTS();
+}
 // with Xestia Calendar. If not, see <http://www.gnu.org/licenses/>
 
 #include "../objects/calendartask/CalendarTask.h"
-
-TEST(iCalendarTask, BasicTests){
+#include <gtest/gtest.h>
+
+class iCalendarTaskLoadTests : public ::testing::Test
+{
+private:
+    virtual void SetUp()
+    {
+    }
+    
+    virtual void TearDown()
+    {
+    }
+};
+
+TEST_F(iCalendarTaskLoadTests, BasicTests){
 
        CalendarTaskObject testTask;
        
@@ -28,7 +41,7 @@ TEST(iCalendarTask, BasicTests){
        
 }
 
-TEST(iCalendarTask, ObjectDataTests){
+TEST_F(iCalendarTaskLoadTests, ObjectDataTests){
 
        CalendarTaskObject testTask;
        ASSERT_EQ(CALENDAROBJECTLOAD_OK, testTask.LoadFile("iCalendarTask-Load2.vcf"));
@@ -1058,7 +1071,7 @@ TEST(iCalendarTask, ObjectDataTests){
        
 }
 
-TEST(iCalendarTask, AlarmTests){
+TEST_F(iCalendarTaskLoadTests, AlarmTests){
 
        CalendarTaskObject testTask;
        ASSERT_EQ(CALENDAROBJECTLOAD_OK, testTask.LoadFile("iCalendarTask-Load2.vcf"));
 // with Xestia Calendar. If not, see <http://www.gnu.org/licenses/>
 
 #include "../objects/calendartask/CalendarTask.h"
+#include <gtest/gtest.h>
 
-TEST(iCalendarSaveTask, SaveTaskTests){
+class iCalendarTaskSaveTests : public ::testing::Test
+{
+private:
+    virtual void SetUp()
+    {
+    }
+    
+    virtual void TearDown()
+    {
+    }
+};
+
+TEST_F(iCalendarTaskSaveTests, SaveTaskTests){
 
        CalendarTaskObject testTask;
        CalendarTaskObject testTask2;
diff --git a/source/tests/iCalendarTaskTests/main.cpp b/source/tests/iCalendarTaskTests/main.cpp
new file mode 100644 (file)
index 0000000..0f36e87
--- /dev/null
@@ -0,0 +1,8 @@
+#include <gtest/gtest.h>
+
+int main(int argc, char **argv)
+{    
+    ::testing::GTEST_FLAG(shuffle) = true;
+    ::testing::InitGoogleTest(&argc, argv); 
+    return RUN_ALL_TESTS();
+}
 // with Xestia Calendar. If not, see <http://www.gnu.org/licenses/>
 
 #include "../objects/calendartimezone/CalendarTimezone.h"
-
-TEST(iCalendarTimezone, BasicTests){
+#include <gtest/gtest.h>
+
+class iCalendarTimezoneLoadTests : public ::testing::Test
+{
+private:
+    virtual void SetUp()
+    {
+    }
+    
+    virtual void TearDown()
+    {
+    }
+};
+
+TEST_F(iCalendarTimezoneLoadTests, BasicTests){
 
        CalendarTimezoneObject testTimezone;
        
@@ -28,7 +41,7 @@ TEST(iCalendarTimezone, BasicTests){
        
 }
 
-TEST(iCalendarTimezone, ObjectDataTests){
+TEST_F(iCalendarTimezoneLoadTests, ObjectDataTests){
        
        CalendarTimezoneObject testTimezone;
        ASSERT_EQ(CALENDAROBJECTLOAD_OK, testTimezone.LoadFile("iCalendarTimezone-Load2.vcf"));
 // with Xestia Calendar. If not, see <http://www.gnu.org/licenses/>
 
 #include "../objects/calendartimezone/CalendarTimezone.h"
+#include <gtest/gtest.h>
 
-TEST(iCalendarSaveTimezone, SaveTimezoneTests){
+class iCalendarTimezoneSaveTests : public ::testing::Test
+{
+private:
+    virtual void SetUp()
+    {
+    }
+    
+    virtual void TearDown()
+    {
+    }
+};
+
+TEST_F(iCalendarTimezoneSaveTests, SaveTimezoneTests){
 
        CalendarTimezoneObject testTimezone;
        CalendarTimezoneObject testTimezone2;
diff --git a/source/tests/iCalendarTimeZoneTests/main.cpp b/source/tests/iCalendarTimeZoneTests/main.cpp
new file mode 100644 (file)
index 0000000..0f36e87
--- /dev/null
@@ -0,0 +1,8 @@
+#include <gtest/gtest.h>
+
+int main(int argc, char **argv)
+{    
+    ::testing::GTEST_FLAG(shuffle) = true;
+    ::testing::InitGoogleTest(&argc, argv); 
+    return RUN_ALL_TESTS();
+}
diff --git a/source/tests/xestiacalendar_test.cpp b/source/tests/xestiacalendar_test.cpp
deleted file mode 100644 (file)
index 2e4737b..0000000
+++ /dev/null
@@ -1,282 +0,0 @@
-// xestiacalendar_test.cpp - Xestia Calendar Unit Testing Suite.
-//
-// (c) 2016-2017 Xestia Software Development.
-//
-// This file is part of Xestia Calendar.
-//
-// Xestia Calendar 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, version 3 of the license.
-//
-// Xestia Calendar 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 Xestia Calendar. If not, see <http://www.gnu.org/licenses/>
-
-#include <curl/curl.h>
-#include <gtest/gtest.h>
-#include <iostream>
-#include <string>
-#include <stdexcept>
-
-#include "xestiacalendar_commonfunctions.h"
-#include "xestiacalendar_populate.h"
-#include "xestiacalendar_icaleventload.h"
-#include "xestiacalendar_icaleventsave.h"
-#include "xestiacalendar_icaltaskload.h"
-#include "xestiacalendar_icaltasksave.h"
-#include "xestiacalendar_icaljournalload.h"
-#include "xestiacalendar_icaljournalsave.h"
-#include "xestiacalendar_icalfreebusyload.h"
-#include "xestiacalendar_icalfreebusysave.h"
-#include "xestiacalendar_icaltimezoneload.h"
-#include "xestiacalendar_icaltimezonesave.h"
-#include "xestiacalendar_calendardatastorage.h"
-#include "xestiacalendar_caldav.h"
-
-enum MenuOpts {
-       TESTS_ICALLOADEVENT = 1,
-       TESTS_ICALSAVEEVENT,
-       TESTS_ICALLOADTODO,
-       TESTS_ICALSAVETODO,
-       TESTS_ICALLOADJOURNAL,
-       TESTS_ICALSAVEJOURNAL,
-       TESTS_ICALLOADFREEBUSY,
-       TESTS_ICALSAVEFREEBUSY,
-       TESTS_ICALLOADTIMEZONE,
-       TESTS_ICALSAVETIMEZONE,
-       TESTS_CALENDARDATASTORAGE,
-       TESTS_CALDAV,
-       TESTS_COMMONFUNCTIONS,
-       TESTS_EXTRA,
-       TESTS_QUIT
-};
-
-enum ExtraMenuOpts{
-       EXTRA_POPULATECALDAV = 1,
-       EXTRA_RETURN
-};
-
-void printn(std::string text){
-// printn: Print a line and end with a newline (\n).
-
-       std::cout << text << std::endl;
-
-}
-
-void printmenu(){
-// printmenu: Print the menu.
-
-       std::cout << "Select an option:" << std::endl << std::endl;
-       std::cout << TESTS_ICALLOADEVENT << ". iCalendar Event Component Load" << std::endl;
-       std::cout << TESTS_ICALSAVEEVENT << ". iCalendar Event Component Save" << std::endl;
-       std::cout << TESTS_ICALLOADTODO << ". iCalendar Task Component Load" << std::endl;
-       std::cout << TESTS_ICALSAVETODO << ". iCalendar Task Component Save" << std::endl;
-       std::cout << TESTS_ICALLOADJOURNAL << ". iCalendar Journal Component Load" << std::endl;
-       std::cout << TESTS_ICALSAVEJOURNAL << ". iCalendar Journal Component Save" << std::endl;
-       std::cout << TESTS_ICALLOADFREEBUSY << ". iCalendar FreeBusy Component Load" << std::endl;
-       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;
-       std::cout << TESTS_QUIT << ". Quit" << std::endl;
-       std::cout << std::endl;
-
-}
-
-void printextramenu(){
-
-       std::cout << "Extra Functions Menu" << std::endl << std::endl;
-       std::cout << "Select an option:" << std::endl << std::endl;     
-       std::cout << EXTRA_POPULATECALDAV << ". Populate CalDAV calendar" << std::endl;
-       std::cout << EXTRA_RETURN << ". Return to previous menu" << std::endl;
-       std::cout << std::endl;
-       
-}
-
-void runextramenu(){
-       
-       bool exitEnabled = false;
-       std::string stringOption = "";
-       int testResult = 0;
-
-       while(exitEnabled == false){
-       
-               printextramenu();
-
-               // Get user input.
-
-               std::cout << "Select Option: "; 
-               std::cin >> stringOption;
-               
-               int intOption = -1;
-               
-               // Check if input is a number.
-               
-               try{
-                       intOption = stoi(stringOption);
-               }
-               
-               // Return to the top of the while statement if input
-               // really isn't a number.
-               
-               catch(std::invalid_argument e){
-                       printn("Error: Selected option is not a number.");
-                       continue;
-               }
-               
-               // Find which option has been selected from the
-               // input.
-               
-               switch(intOption){
-               
-                       case EXTRA_POPULATECALDAV:
-                               printn("Populating CalDAV calendar...");
-                               populatecaldav();
-                               break;
-                       case EXTRA_RETURN:
-                               return;
-                               break;
-                       default:
-                               printn("Invalid menu number given."); 
-                               break;
-               
-               }
-       
-       }
-       
-}
-
-int main(int argc, char* argv[]){
-
-       // Initialise the several libraries that have
-       // been included.
-       
-       ::testing::InitGoogleTest(&argc, argv);
-       curl_global_init(CURL_GLOBAL_ALL);
-       
-       printn("Xestia Calendar Unit Testing Application");
-       printn("(c)2016 Xestia Software Development");
-       printn("Note: Unit testing is currently in development");
-       printn("");
-
-       bool exitEnabled = false;
-       std::string stringOption = "";
-       int testResult = 0;
-
-       while(exitEnabled == false){
-       
-               printmenu();
-
-               // Get user input.
-
-               std::cout << "Select Option: "; 
-               std::cin >> stringOption;
-               
-               int intOption = -1;
-               
-               // Check if input is a number.
-               
-               try{
-                       intOption = stoi(stringOption);
-               }
-               
-               // Return to the top of the while statement if input
-               // really isn't a number.
-               
-               catch(std::invalid_argument e){
-                       printn("Error: Selected option is not a number.");
-                       continue;
-               }
-               
-               // Find which option has been selected from the
-               // input.
-               
-               switch(intOption){
-               
-                       case TESTS_ICALLOADEVENT:
-                               printn("Running iCalendar Event Component tests...");
-                               ::testing::GTEST_FLAG(filter) = "iCalendarEvent*";
-                               testResult = RUN_ALL_TESTS();
-                               break;
-                       case TESTS_ICALSAVEEVENT:
-                               printn("Running iCalendar Event Component Save tests...");
-                               ::testing::GTEST_FLAG(filter) = "iCalendarSaveEvent*";
-                               testResult = RUN_ALL_TESTS();
-                               break;
-                       case TESTS_ICALLOADTODO:
-                               printn("Running iCalendar Task Component tests...");
-                               ::testing::GTEST_FLAG(filter) = "iCalendarTask*";
-                               testResult = RUN_ALL_TESTS();
-                               break;
-                       case TESTS_ICALSAVETODO:
-                               printn("Running iCalendar Task Component Save tests...");
-                               ::testing::GTEST_FLAG(filter) = "iCalendarSaveTask*";
-                               testResult = RUN_ALL_TESTS();
-                               break;
-                       case TESTS_ICALLOADJOURNAL:
-                               printn("Running iCalendar Journal Component tests...");
-                               ::testing::GTEST_FLAG(filter) = "iCalendarJournal*";
-                               testResult = RUN_ALL_TESTS();
-                               break;
-                       case TESTS_ICALSAVEJOURNAL:
-                               printn("Running iCalendar Journal Component Save tests...");
-                               ::testing::GTEST_FLAG(filter) = "iCalendarSaveJournal*";
-                               testResult = RUN_ALL_TESTS();
-                               break;
-                       case TESTS_ICALLOADFREEBUSY:
-                               printn("Running iCalendar Free Busy Component tests...");
-                               ::testing::GTEST_FLAG(filter) = "iCalendarFreeBusy*";
-                               testResult = RUN_ALL_TESTS();
-                               break;
-                       case TESTS_ICALSAVEFREEBUSY:
-                               printn("Running iCalendar Free Busy Component Save tests...");
-                               ::testing::GTEST_FLAG(filter) = "iCalendarSaveFreeBusy*";
-                               testResult = RUN_ALL_TESTS();
-                               break;
-                       case TESTS_ICALLOADTIMEZONE:
-                               printn("Running iCalendar Timezone Component tests...");
-                               ::testing::GTEST_FLAG(filter) = "iCalendarTimezone*";
-                               testResult = RUN_ALL_TESTS();
-                               break;
-                       case TESTS_ICALSAVETIMEZONE:
-                               printn("Running iCalendar Timezone Component Save tests...");
-                               ::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*";
-                               testResult = RUN_ALL_TESTS();
-                               break;
-                       case TESTS_COMMONFUNCTIONS:
-                               printn("Running Commmon Functions tests...");
-                               ::testing::GTEST_FLAG(filter) = "CommonFunctions*";
-                               testResult = RUN_ALL_TESTS();
-                               break;
-                       case TESTS_EXTRA:
-                               runextramenu();
-                               break;
-                       case TESTS_QUIT:
-                               return 0;
-                               break;
-                       default:
-                               printn("Invalid menu number given."); 
-                               break;
-               
-               }
-       
-       }
-
-}
diff --git a/source/tests/xestiacalendar_testcommon.cpp b/source/tests/xestiacalendar_testcommon.cpp
deleted file mode 100644 (file)
index 1dd9843..0000000
+++ /dev/null
@@ -1,206 +0,0 @@
-// xestiacalendar_testcommon.cpp - Xestia Calendar Unit Test Common Functions.
-//
-// (c) 2016-2017 Xestia Software Development.
-//
-// This file is part of Xestia Calendar.
-//
-// Xestia Calendar 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, version 3 of the license.
-//
-// Xestia Calendar 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 Xestia Calendar. If not, see <http://www.gnu.org/licenses/>
-
-#include <fstream>
-
-#include "xestiacalendar_testcommon.h"
-#include "../common/file.h"
-
-ProcessConnectionDataFileResult ProcessConnectionDataFile(string dataFilename, 
-       CalDAVConnectionData *connData){
-               
-       ProcessConnectionDataFileResult processResult = PROCESSCONNECTIONDATAFILE_UNITTESTFAIL;
-               
-       // Check if the file exists and return 
-       // PROCESSCONNECTIONDATAFILE_MISSING if not.
-       
-       if (!FileExists(dataFilename)){
-               return PROCESSCONNECTIONDATAFILE_MISSING;
-       }
-       
-       ifstream fileStream;
-       string receivedStringData = "";
-       
-       fileStream.open(dataFilename, ifstream::in);
-       
-       if (fileStream.rdstate() & ifstream::failbit){
-               return PROCESSCONNECTIONDATAFILE_CANNOTOPEN;
-       }
-
-       if (fileStream.rdstate() & ifstream::badbit){
-               return PROCESSCONNECTIONDATAFILE_CANNOTOPEN;
-       }
-       
-       // Process the file.
-       
-       char *bufferRead = new char[256];
-       
-       while (!fileStream.eof()){
-               
-               fileStream.getline(bufferRead, 256);
-               receivedStringData.append(bufferRead);
-               receivedStringData.append("\n");
-               
-       }
-       
-       delete[] bufferRead;
-       
-       bool newLine = false;
-       bool skipMode = false;
-       bool equalFound = false;
-       bool quoteMode = false;
-       bool serverNameFound = false;
-       bool serverUserFound = false;
-       bool serverPassFound = false;
-       bool serverSSLFound = false;
-       bool serverPortFound = false;
-       bool serverPrefixFound = false;
-       char bufferChar = 0;
-       int stringDataSize = receivedStringData.size();
-       int seekCount = 0;
-       string propertyName;
-       string propertyValue;
-
-       while (seekCount < stringDataSize){
-
-               if (receivedStringData[seekCount] == '='){
-               
-                       equalFound = true;              
-               
-               } else if (receivedStringData[seekCount] == '\n'){
-               
-                       // Newline reached. Check for what type of
-                       // data it is.
-               
-                       // Chceck that the equals sign has been found,
-                       // there is a values in the property name
-                       // and property value before doing anything.
-                                               
-                       if (equalFound == true &&
-                               propertyName.size() > 0 &&
-                               propertyValue.size() > 0){
-                       
-                               if (propertyName == "server" && serverNameFound == false){
-                               
-                                       // Setup the server hostname.
-                               
-                                       connData->hostname = propertyValue;
-                                       serverNameFound = true;
-                               
-                               } else if (propertyName == "port" && serverPortFound == false){
-                               
-                                       // Setup the server port.
-                               
-                                       int portNum;
-                                       bool portNumValid = true;
-                               
-                                       try{
-                                               portNum = stoi(propertyValue);
-                                       }
-                                       
-                                       catch(const invalid_argument &oor){
-                                               portNumValid = false;
-                                       }
-                                       
-                                       // Port Number is valid so add to the
-                                       // CalDAVConnectionData handle.
-                                       
-                                       if (portNumValid == true){
-                                               connData->port = portNum;
-                                               serverPortFound = true;
-                                       }
-                               
-                               } else if (propertyName == "user" && serverUserFound == false){
-                               
-                                       // Setup the server user.
-                                       
-                                       connData->username = propertyValue;
-                                       serverUserFound = true;
-                               
-                               } else if (propertyName == "pass" && serverPassFound == false){
-                               
-                                       // Setup the server pass.
-                                       
-                                       connData->password = propertyValue;
-                                       serverPassFound = true;                         
-                               
-                               } else if (propertyName == "ssl" && serverSSLFound == false){
-                               
-                                       // Setup the server SSL status.
-                                       
-                                       if (propertyValue == "true"){
-                                               connData->useSSL = true;
-                                       } else {
-                                               connData->useSSL = false;                                       
-                                       }
-                                       
-                                       serverSSLFound = true;
-                               
-                               } else if (propertyName == "prefix" && serverPrefixFound == false){
-                               
-                                       // Setup the server prefix.
-                               
-                                       connData->prefix = propertyValue;
-                                       serverPrefixFound = true;
-                               
-                               }
-                               
-                       }
-                       
-                       // Reset the variables.
-               
-                       equalFound = false;
-                       propertyName.clear();
-                       propertyValue.clear();
-               
-               } else {
-               
-                       // No special character so add it to the 
-                       // Property name or value depending on 
-                       // if the equal sign has been found.
-               
-                       bufferChar = receivedStringData[seekCount];
-               
-                       if (equalFound == true){
-                               propertyValue += bufferChar;
-                       } else {
-                               propertyName += bufferChar;
-                       }
-                       
-                       bufferChar = 0;
-               
-               }
-
-               seekCount++;
-
-       }
-       
-       // Check that the CalDAV connection data object 
-       // contains valid data.
-       
-       bool calDAVConnDataResult = CalDAVObjectValidSettings(connData);
-       
-       if (calDAVConnDataResult == false){
-               processResult = PROCESSCONNECTIONDATAFILE_INVALID;
-       } else {
-               processResult = PROCESSCONNECTIONDATAFILE_OK;
-       }
-       
-       return processResult;
-               
-}
\ No newline at end of file
diff --git a/source/tests/xestiacalendar_testcommon.h b/source/tests/xestiacalendar_testcommon.h
deleted file mode 100644 (file)
index 8c0681c..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-// xestiacalendar_testcommon.h - Xestia Calendar Unit Test Common Functions Header.
-//
-// (c) 2016-2017 Xestia Software Development.
-//
-// This file is part of Xestia Calendar.
-//
-// Xestia Calendar 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, version 3 of the license.
-//
-// Xestia Calendar 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 Xestia Calendar. If not, see <http://www.gnu.org/licenses/>
-
-#ifndef __TESTS_XESTIACALENDAR_TESTCOMMON_H__
-#define __TESTS_XESTIACALENDAR_TESTCOMMON_H__
-
-#include "../objects/CalDAV/CalDAV.h"
-#include <string>
-#include <stdexcept>
-
-using namespace std;
-
-enum ProcessConnectionDataFileResult{
-       PROCESSCONNECTIONDATAFILE_UNITTESTFAIL = -1,
-       PROCESSCONNECTIONDATAFILE_OK,
-       PROCESSCONNECTIONDATAFILE_MISSING,
-       PROCESSCONNECTIONDATAFILE_CANNOTOPEN,
-       PROCESSCONNECTIONDATAFILE_INVALID
-};
-
-ProcessConnectionDataFileResult ProcessConnectionDataFile(string dataFilename, 
-       CalDAVConnectionData *connData);
-
-#endif
\ No newline at end of file
diff --git a/source/tests/xestiacalendar_testxccalendarday.cpp b/source/tests/xestiacalendar_testxccalendarday.cpp
deleted file mode 100644 (file)
index 4e27439..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-// xestiacalendar_testxccalendarday.cpp - Xestia Calendar Unit Test XCCalendarDay
-//
-// (c) 2016-2017 Xestia Software Development.
-//
-// This file is part of Xestia Calendar.
-//
-// Xestia Calendar 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, version 3 of the license.
-//
-// Xestia Calendar 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 Xestia Calendar. If not, see <http://www.gnu.org/licenses/>
-
-#include <wx/wx.h>
-#include "../widgets/XCCalendarDay.h"
-
-class XCCalendarDayTest: public wxApp
-{
-    virtual bool OnInit();
-};
-
-IMPLEMENT_APP(XCCalendarDayTest);
-
-using namespace std;
-
-bool XCCalendarDayTest::OnInit()
-{
-       
-       XCCalendarDay *frmMain = new XCCalendarDay(NULL, "XCCalendarDay Test", wxPoint(50, 50), wxSize(200, 200) );
-       
-       frmMain->Show();
-       SetTopWindow(frmMain);
-       
-       return true;
-       
-}
\ No newline at end of file
diff --git a/source/tests/xestiacalendar_testxccalendarmonthview.cpp b/source/tests/xestiacalendar_testxccalendarmonthview.cpp
deleted file mode 100644 (file)
index 16f0464..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-// xestiacalendar_testxccalendarmonthview.cpp - Xestia Calendar Unit Test XCCalendarMonthView
-//
-// (c) 2016-2017 Xestia Software Development.
-//
-// This file is part of Xestia Calendar.
-//
-// Xestia Calendar 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, version 3 of the license.
-//
-// Xestia Calendar 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 Xestia Calendar. If not, see <http://www.gnu.org/licenses/>
-
-#include <wx/wx.h>
-#include "../widgets/XCCalendarMonthView.h"
-#include "../common/monthviewgen.h"
-
-class XCCalendarMonthViewTest: public wxApp
-{
-    virtual bool OnInit();
-};
-
-IMPLEMENT_APP(XCCalendarMonthViewTest);
-
-using namespace std;
-
-bool XCCalendarMonthViewTest::OnInit()
-{
-       
-       XCCalendarMonthViewGrid MonthViewGrid = GenerateMonthGrid(6, 2016);
-       
-       XCCalendarMonthView *frmMain = new XCCalendarMonthView("XCCalendarMonthView Test", wxPoint(50, 50), wxSize(200, 200), &MonthViewGrid);
-       
-       frmMain->Show();
-       SetTopWindow(frmMain);
-       
-       return true;
-       
-}
\ No newline at end of file
Xestia Software Development
Yn Maystri
© 2006 - 2019 Xestia Software Development
Software

Xestia Address Book
Xestia Calendar
Development

Xestia Gelforn
Everything else

About
News
Privacy Policy