1 // xestiacalendar_test.cpp - Xestia Calendar Unit Testing Suite.
3 // (c) 2016 Xestia Software Development.
5 // This file is part of Xestia Address Book.
7 // Xestia Address Book is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License as published by the
9 // Free Software Foundation, version 3 of the license.
11 // Xestia Address Book is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License along
17 // with Xestia Address Book. If not, see <http://www.gnu.org/licenses/>
19 #include <gtest/gtest.h>
24 #include "xestiacalendar_icaleventload.h"
27 TESTS_ICALLOADEVENT = 1,
29 TESTS_ICALLOADJOURNAL,
30 TESTS_ICALLOADFREEBUSY,
31 TESTS_ICALLOADTIMEZONE,
36 void printn(std::string text){
37 // printn: Print a line and end with a newline (\n).
39 std::cout << text << std::endl;
44 // printmenu: Print the menu.
46 std::cout << "Select an option:" << std::endl << std::endl;
47 std::cout << TESTS_ICALLOADEVENT << ". iCalendar Event Component Load" << std::endl;
48 std::cout << TESTS_QUIT << ". Quit" << std::endl;
49 std::cout << std::endl;
53 int main(int argc, char* argv[]){
55 ::testing::InitGoogleTest(&argc, argv);
57 printn("Xestia Calendar Unit Testing Application");
58 printn("(c)2016 Xestia Software Development");
59 printn("Note: Unit testing is currently in development");
62 bool ExitEnabled = false;
63 std::string StringOption = "";
66 while(ExitEnabled == false){
72 std::cout << "Select Option: ";
73 std::cin >> StringOption;
77 // Check if input is a number.
80 IntOption = stoi(StringOption);
83 // Return to the top of the while statement if input
84 // really isn't a number.
86 catch(std::invalid_argument e){
87 printn("Error: Selected option is not a number.");
91 // Find which option has been selected from the
96 case TESTS_ICALLOADEVENT:
97 printn("Running iCalendar Event Component tests...");
98 ::testing::GTEST_FLAG(filter) = "iCalendarEvent*";
99 TestResult = RUN_ALL_TESTS();
101 /*case TESTS_CARDDAV:
102 printn("Running CardDAV tests...");
103 ::testing::GTEST_FLAG(filter) = "CardDAV*";
104 TestResult = RUN_ALL_TESTS();
110 printn("Invalid menu number given.");