1 /*
2 * Copyright (C) 2007 - 2013 Vivien Malerba <malerba@gnome-db.org>
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 */
18 #include <stdlib.h>
19 #include <string.h>
20
21 #define PROVIDER "SQLite"
22 #include "prov-test-common.h"
23
24 extern GdaProviderInfo *pinfo;
25 extern GdaConnection *cnc;
26 extern gboolean params_provided;
27 extern gboolean fork_tests;
28
29 int
main(int argc,char ** argv)30 main (int argc, char **argv)
31 {
32 int number_failed = 0;
33 fork_tests = FALSE;
34
35 gda_init ();
36
37 pinfo = gda_config_get_provider_info (PROVIDER);
38 if (!pinfo) {
39 g_warning ("Could not find provider information for %s", PROVIDER);
40 return EXIT_FAILURE;
41 }
42 g_print ("Provider now tested: %s\n", pinfo->id);
43
44 number_failed = prov_test_common_setup ();
45
46 if (cnc) {
47 number_failed += prov_test_common_check_timestamp ();
48 number_failed += prov_test_common_check_date ();
49 number_failed += prov_test_common_check_meta ();
50 number_failed += prov_test_common_check_meta_identifiers (TRUE, TRUE);
51 number_failed += prov_test_common_check_meta_identifiers (TRUE, FALSE);
52 number_failed += prov_test_common_check_meta_identifiers (FALSE, TRUE);
53 number_failed += prov_test_common_check_meta_identifiers (FALSE, FALSE);
54 number_failed += prov_test_common_load_data ();
55 number_failed += prov_test_common_check_cursor_models ();
56 number_failed += prov_test_common_check_data_select ();
57 number_failed += prov_test_common_clean ();
58 }
59
60 if (! params_provided)
61 return EXIT_SUCCESS;
62 else {
63 g_print ("Test %s\n", (number_failed == 0) ? "Ok" : "failed");
64 return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
65 }
66 }
67
68