Commit 509790f5 authored by Daniel Espinosa Ortiz's avatar Daniel Espinosa Ortiz

ci: add enable ci environment to tests

parent 354b89a5
......@@ -78,7 +78,7 @@ autotools_build:
meson_build:
stage: build
script:
- meson _build --prefix=/usr
- meson _build --prefix=/usr -Denable-ci-environment=true
- cd _build
- ninja
- broadwayd &
......
......@@ -5190,7 +5190,7 @@ prepare_meta_statements_hash (void)
}
/**
* gda_connection_get_meta_store_data:
* gda_connection_get_meta_store_data: (skip)
* @cnc: a #GdaConnection object.
* @meta_type: describes which data to get.
* @error: a place to store errors, or %NULL
......@@ -5270,7 +5270,7 @@ gda_connection_get_meta_store_data (GdaConnection *cnc,
}
/**
* gda_connection_get_meta_store_data_v:
* gda_connection_get_meta_store_data_v: (rename-to get_meta_store_data)
* @cnc: a #GdaConnection object.
* @meta_type: describes which data to get.
* @error: a place to store errors, or %NULL
......
......@@ -244,10 +244,6 @@ if get_option('enable-debug')
c_args += '-DGDA_DEBUG'
endif
if get_option('enable-ci-environment')
c_args += '-DCI_ENVIRONMENT'
endif
add_global_arguments(c_args, language : 'c')
# Files references by sqlite embedded and provider
......
......@@ -26,9 +26,9 @@
typedef struct {
GdaDdlCreator *creator;
gchar *xmlfile;
GdaConnection *cnc;
gboolean started_db;
gboolean cont;
} CheckDdlObject;
......@@ -219,22 +219,10 @@ test_ddl_creator_start (CheckDdlObject *self,
gconstpointer user_data)
{
gda_init();
self->xmlfile = NULL;
self->creator = NULL;
self->cnc = NULL;
self->started_db = FALSE;
const gchar *topsrcdir = g_getenv ("GDA_TOP_SRC_DIR");
g_print ("ENV: %s\n",topsrcdir);
g_assert_nonnull (topsrcdir);
self->xmlfile = g_build_filename(topsrcdir,
"tests",
"ddl",
"ddl-db.xml",NULL);
g_assert_nonnull (self->xmlfile);
self->cont = FALSE;
#ifdef CI_ENVIRONMENT
const gchar *cnc_string = "DB_NAME=test;HOST=postgres;USERNAME=test;PASSWORD=test1";
......@@ -266,16 +254,18 @@ test_ddl_creator_start (CheckDdlObject *self,
create_users_table (self);
create_companies_table (self);
create_countries_table (self);
self->cont = TRUE;
}
static void
test_ddl_creator_finish (CheckDdlObject *self,
gconstpointer user_data)
{
gda_connection_close(self->cnc,NULL);
g_free (self->xmlfile);
g_object_unref (self->creator);
g_object_unref (self->cnc);
if (self->cnc != NULL) {
gda_connection_close(self->cnc,NULL);
g_object_unref (self->creator);
g_object_unref (self->cnc);
}
}
......@@ -283,6 +273,9 @@ static void
test_tables (CheckDdlObject *self,
gconstpointer user_data)
{
if (!self->cont) {
g_message ("Test skiped");
}
g_message ("Testing Tables...");
if (self->cnc == NULL) {
return;
......
......@@ -153,7 +153,8 @@ tcpg = executable('check-ddl-creator-postgresql',
'-include',
meson.build_root() + '/config.h',
'-DCHECK_FILES="'+meson.source_root()+'"',
'-DTOP_BUILD_DIR="'+meson.build_root()+'"'
'-DTOP_BUILD_DIR="'+meson.build_root()+'"',
ci_args
],
link_with: libgda,
dependencies: [
......
ci_args = []
if get_option('enable-ci-environment')
ci_args += [
'-DCI_ENVIRONMENT'
]
endif
test_headers = files([
'raw-ddl-creator.h'
])
......
......@@ -56,6 +56,7 @@ tchkmstspg = executable('check_meta_store_postgresql',
'-include',
meson.build_root() + '/config.h',
'-DTOP_SRC_DIR="'+meson.source_root()+'"',
ci_args
],
link_with: libgda,
dependencies: [
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment