1 /*
2 * Copyright (C) 2008 - 2011 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 <libgda/libgda.h>
19 #include <stdio.h>
20 #include <glib/gstdio.h>
21 #include "common.h"
22
23 int
main(int argc,char ** argv)24 main(int argc, char ** argv)
25 {
26 GdaMetaStore *store;
27 gchar *cnc_string;
28
29 gda_init ();
30
31 /* connection parameters */
32 cnc_string = getenv ("MYSQL_META_CNC");
33 if (!cnc_string) {
34 g_print ("MySQL test not run, please set the MYSQL_META_CNC environment variable \n"
35 "For example 'DB_NAME=meta'\n");
36 return EXIT_SUCCESS;
37 }
38
39 /* Clean eveything which might exist in the store */
40 gchar *str;
41 str = g_strdup_printf ("MySQL://%s", cnc_string);
42 store = gda_meta_store_new (str);
43 common_drop_all_tables (store);
44 g_object_unref (store);
45
46 /* Test store setup */
47 store = gda_meta_store_new (str);
48 g_free (str);
49
50 g_print ("STORE: %p, version: %d\n", store, store ? gda_meta_store_get_version (store) : 0);
51
52 /* Tests */
53 tests_group_1 (store);
54 g_object_unref (store);
55
56 g_print ("Test Ok.\n");
57
58 return EXIT_SUCCESS;
59 }
60
61
62
63
64
65