/* vbftest.c generated by valac 0.12.1.1-323029-dirty, the Vala compiler
 * generated from vbftest.vala, do not modify */

/*
 *  vbftest.vala - Vala Build Framework library
 *  
 *  Copyright (C) 2008 - Andrea Del Signore <sejerpz@tin.it>
 *  
 *  This library is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU Lesser General Public
 *  License as published by the Free Software Foundation; either
 *  version 2.1 of the License, or (at your option) any later version.
 *
 *  This library 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
 *  Lesser General Public License for more details.
 *
 *  You should have received a copy of the GNU Lesser General Public
 *  License along with this library; if not, write to the Free Software
 *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
 */

#include <glib.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <vbf.h>
#include <valagee.h>
#include <stdio.h>
#include <glib/gi18n-lib.h>
#include <gobject/gvaluecollector.h>


#define VBF_TESTS_TYPE_OPEN_TEST (vbf_tests_open_test_get_type ())
#define VBF_TESTS_OPEN_TEST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VBF_TESTS_TYPE_OPEN_TEST, VbfTestsOpenTest))
#define VBF_TESTS_OPEN_TEST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VBF_TESTS_TYPE_OPEN_TEST, VbfTestsOpenTestClass))
#define VBF_TESTS_IS_OPEN_TEST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VBF_TESTS_TYPE_OPEN_TEST))
#define VBF_TESTS_IS_OPEN_TEST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VBF_TESTS_TYPE_OPEN_TEST))
#define VBF_TESTS_OPEN_TEST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VBF_TESTS_TYPE_OPEN_TEST, VbfTestsOpenTestClass))

typedef struct _VbfTestsOpenTest VbfTestsOpenTest;
typedef struct _VbfTestsOpenTestClass VbfTestsOpenTestClass;
typedef struct _VbfTestsOpenTestPrivate VbfTestsOpenTestPrivate;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define _vala_iterable_unref0(var) ((var == NULL) ? NULL : (var = (vala_iterable_unref (var), NULL)))
#define _g_option_context_free0(var) ((var == NULL) ? NULL : (var = (g_option_context_free (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
#define _vbf_tests_open_test_unref0(var) ((var == NULL) ? NULL : (var = (vbf_tests_open_test_unref (var), NULL)))
typedef struct _VbfTestsParamSpecOpenTest VbfTestsParamSpecOpenTest;

struct _VbfTestsOpenTest {
	GTypeInstance parent_instance;
	volatile int ref_count;
	VbfTestsOpenTestPrivate * priv;
};

struct _VbfTestsOpenTestClass {
	GTypeClass parent_class;
	void (*finalize) (VbfTestsOpenTest *self);
};

struct _VbfTestsParamSpecOpenTest {
	GParamSpec parent_instance;
};


static gpointer vbf_tests_open_test_parent_class = NULL;
static gchar** vbf_tests_open_test_projects;
static gint vbf_tests_open_test_projects_length1;
static gchar** vbf_tests_open_test_projects = NULL;
static gint vbf_tests_open_test_projects_length1 = 0;
static gint _vbf_tests_open_test_projects_size_ = 0;
static gboolean vbf_tests_open_test_dump_variables;
static gboolean vbf_tests_open_test_dump_variables = FALSE;

gpointer vbf_tests_open_test_ref (gpointer instance);
void vbf_tests_open_test_unref (gpointer instance);
GParamSpec* vbf_tests_param_spec_open_test (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void vbf_tests_value_set_open_test (GValue* value, gpointer v_object);
void vbf_tests_value_take_open_test (GValue* value, gpointer v_object);
gpointer vbf_tests_value_get_open_test (const GValue* value);
GType vbf_tests_open_test_get_type (void) G_GNUC_CONST;
enum  {
	VBF_TESTS_OPEN_TEST_DUMMY_PROPERTY
};
gboolean vbf_tests_open_test_run (VbfTestsOpenTest* self, const gchar* project_name);
static void vbf_tests_open_test_dump_project (VbfTestsOpenTest* self, VbfProject* project);
static gchar* vbf_tests_open_test_get_target_type_description (VbfTestsOpenTest* self, VbfTargetTypes type);
static gchar* vbf_tests_open_test_get_source_type_description (VbfTestsOpenTest* self, VbfFileTypes type);
gint vbf_tests_open_test_main (gchar** args, int args_length1);
VbfTestsOpenTest* vbf_tests_open_test_new (void);
VbfTestsOpenTest* vbf_tests_open_test_construct (GType object_type);
static void vbf_tests_open_test_finalize (VbfTestsOpenTest* obj);

static const GOptionEntry VBF_TESTS_OPEN_TEST_options[3] = {{"dump-variables", 'd', 0, G_OPTION_ARG_INT, &vbf_tests_open_test_dump_variables, "Dump variables", "0 or 1"}, {"", (gchar) 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &vbf_tests_open_test_projects, "Projects DIR", "PROJECT_DIR"}, {NULL}};

gboolean vbf_tests_open_test_run (VbfTestsOpenTest* self, const gchar* project_name) {
	gboolean result = FALSE;
	VbfBackendsAutotools* _tmp0_ = NULL;
	VbfIProjectBackend* pm;
	gboolean _tmp1_;
	gboolean res;
	const gchar* _tmp4_ = NULL;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (project_name != NULL, FALSE);
	_tmp0_ = vbf_backends_autotools_new ();
	pm = (VbfIProjectBackend*) _tmp0_;
	g_print ("Probing directory '%s' ...", project_name);
	_tmp1_ = vbf_iproject_backend_probe (pm, project_name);
	res = _tmp1_;
	if (!res) {
		VbfBackendsSmartFolder* _tmp2_ = NULL;
		gboolean _tmp3_;
		_tmp2_ = vbf_backends_smart_folder_new ();
		_g_object_unref0 (pm);
		pm = (VbfIProjectBackend*) _tmp2_;
		_tmp3_ = vbf_iproject_backend_probe (pm, project_name);
		res = _tmp3_;
	}
	if (res) {
		_tmp4_ = "OK";
	} else {
		_tmp4_ = "KO";
	}
	g_print ("%s\n", _tmp4_);
	if (res) {
		VbfProject* _tmp5_ = NULL;
		VbfProject* project;
		g_print ("Opening project\n");
		_tmp5_ = vbf_iproject_backend_open (pm, project_name);
		project = _tmp5_;
		if (project != NULL) {
			g_print ("Dumping...\n");
			vbf_tests_open_test_dump_project (self, project);
			result = TRUE;
			_g_object_unref0 (project);
			_g_object_unref0 (pm);
			return result;
		} else {
			g_print ("Error project is null\n");
			result = FALSE;
			_g_object_unref0 (project);
			_g_object_unref0 (pm);
			return result;
		}
		_g_object_unref0 (project);
	}
	result = FALSE;
	_g_object_unref0 (pm);
	return result;
}


static void vbf_tests_open_test_dump_project (VbfTestsOpenTest* self, VbfProject* project) {
	g_return_if_fail (self != NULL);
	g_return_if_fail (project != NULL);
	g_print ("PROJECT:\n");
	g_print ("  name.... %s\n", project->name);
	g_print ("  version. %s\n", project->version);
	g_print ("  url..... %s\n", project->url);
	g_print ("  MODULES\n");
	{
		ValaList* _tmp0_ = NULL;
		ValaList* _module_list;
		gint _tmp1_;
		gint _module_size;
		gint _module_index;
		_tmp0_ = vbf_project_get_modules (project);
		_module_list = _tmp0_;
		_tmp1_ = vala_collection_get_size ((ValaCollection*) _module_list);
		_module_size = _tmp1_;
		_module_index = -1;
		while (TRUE) {
			gpointer _tmp2_ = NULL;
			VbfModule* module;
			_module_index = _module_index + 1;
			if (!(_module_index < _module_size)) {
				break;
			}
			_tmp2_ = vala_list_get (_module_list, _module_index);
			module = (VbfModule*) _tmp2_;
			g_print ("    MODULE\n");
			g_print ("      name %s\n", module->name);
			g_print ("      PACKAGES\n");
			{
				ValaList* _tmp3_ = NULL;
				ValaList* _package_list;
				gint _tmp4_;
				gint _package_size;
				gint _package_index;
				_tmp3_ = vbf_module_get_packages (module);
				_package_list = _tmp3_;
				_tmp4_ = vala_collection_get_size ((ValaCollection*) _package_list);
				_package_size = _tmp4_;
				_package_index = -1;
				while (TRUE) {
					gpointer _tmp5_ = NULL;
					VbfPackage* package;
					gchar* _tmp6_ = NULL;
					_package_index = _package_index + 1;
					if (!(_package_index < _package_size)) {
						break;
					}
					_tmp5_ = vala_list_get (_package_list, _package_index);
					package = (VbfPackage*) _tmp5_;
					g_print ("        PACKAGE\n");
					g_print ("          name....... %s\n", package->name);
					g_print ("          constraint. %s\n", package->constraint);
					if (package->version == NULL) {
						gchar* _tmp7_;
						_tmp7_ = g_strdup ("(none)");
						_g_free0 (_tmp6_);
						_tmp6_ = _tmp7_;
					} else {
						gchar* _tmp8_ = NULL;
						_tmp8_ = vbf_config_node_to_string (package->version);
						_g_free0 (_tmp6_);
						_tmp6_ = _tmp8_;
					}
					g_print ("          version.... %s\n", _tmp6_);
					_g_free0 (_tmp6_);
					_g_object_unref0 (package);
				}
				_vala_iterable_unref0 (_package_list);
			}
			_g_object_unref0 (module);
		}
		_vala_iterable_unref0 (_module_list);
	}
	g_print ("  GROUPS\n");
	{
		ValaList* _tmp9_ = NULL;
		ValaList* _group_list;
		gint _tmp10_;
		gint _group_size;
		gint _group_index;
		_tmp9_ = vbf_project_get_groups (project);
		_group_list = _tmp9_;
		_tmp10_ = vala_collection_get_size ((ValaCollection*) _group_list);
		_group_size = _tmp10_;
		_group_index = -1;
		while (TRUE) {
			gpointer _tmp11_ = NULL;
			VbfGroup* group;
			_group_index = _group_index + 1;
			if (!(_group_index < _group_size)) {
				break;
			}
			_tmp11_ = vala_list_get (_group_list, _group_index);
			group = (VbfGroup*) _tmp11_;
			g_print ("    GROUP\n");
			g_print ("      name %s\n", group->name);
			g_print ("      TARGETS\n");
			{
				ValaList* _tmp12_ = NULL;
				ValaList* _target_list;
				gint _tmp13_;
				gint _target_size;
				gint _target_index;
				_tmp12_ = vbf_group_get_targets (group);
				_target_list = _tmp12_;
				_tmp13_ = vala_collection_get_size ((ValaCollection*) _target_list);
				_target_size = _tmp13_;
				_target_index = -1;
				while (TRUE) {
					gpointer _tmp14_ = NULL;
					VbfTarget* target;
					gchar* _tmp15_ = NULL;
					gchar* _tmp16_;
					_target_index = _target_index + 1;
					if (!(_target_index < _target_size)) {
						break;
					}
					_tmp14_ = vala_list_get (_target_list, _target_index);
					target = (VbfTarget*) _tmp14_;
					g_print ("        TARGET\n");
					_tmp15_ = vbf_tests_open_test_get_target_type_description (self, target->type);
					_tmp16_ = _tmp15_;
					g_print ("          name %s %s (%s)\n", _tmp16_, target->name, target->id);
					_g_free0 (_tmp16_);
					g_print ("          VAPI DIRS\n");
					{
						ValaList* _tmp17_ = NULL;
						ValaList* _path_list;
						gint _tmp18_;
						gint _path_size;
						gint _path_index;
						_tmp17_ = vbf_target_get_include_dirs (target);
						_path_list = _tmp17_;
						_tmp18_ = vala_collection_get_size ((ValaCollection*) _path_list);
						_path_size = _tmp18_;
						_path_index = -1;
						while (TRUE) {
							gpointer _tmp19_ = NULL;
							gchar* path;
							_path_index = _path_index + 1;
							if (!(_path_index < _path_size)) {
								break;
							}
							_tmp19_ = vala_list_get (_path_list, _path_index);
							path = (gchar*) _tmp19_;
							g_print ("            directory %s\n", path);
							_g_free0 (path);
						}
						_vala_iterable_unref0 (_path_list);
					}
					g_print ("          SOURCES\n");
					{
						ValaList* _tmp20_ = NULL;
						ValaList* _source_list;
						gint _tmp21_;
						gint _source_size;
						gint _source_index;
						_tmp20_ = vbf_target_get_sources (target);
						_source_list = _tmp20_;
						_tmp21_ = vala_collection_get_size ((ValaCollection*) _source_list);
						_source_size = _tmp21_;
						_source_index = -1;
						while (TRUE) {
							gpointer _tmp22_ = NULL;
							VbfSource* source;
							gchar* _tmp23_ = NULL;
							gchar* _tmp24_;
							_source_index = _source_index + 1;
							if (!(_source_index < _source_size)) {
								break;
							}
							_tmp22_ = vala_list_get (_source_list, _source_index);
							source = (VbfSource*) _tmp22_;
							_tmp23_ = vbf_tests_open_test_get_source_type_description (self, ((VbfFile*) source)->type);
							_tmp24_ = _tmp23_;
							g_print ("            SOURCE %sfilename %s\n", _tmp24_, ((VbfFile*) source)->filename);
							_g_free0 (_tmp24_);
							_g_object_unref0 (source);
						}
						_vala_iterable_unref0 (_source_list);
					}
					g_print ("          OTHER FILES\n");
					{
						ValaList* _tmp25_ = NULL;
						ValaList* _file_list;
						gint _tmp26_;
						gint _file_size;
						gint _file_index;
						_tmp25_ = vbf_target_get_files (target);
						_file_list = _tmp25_;
						_tmp26_ = vala_collection_get_size ((ValaCollection*) _file_list);
						_file_size = _tmp26_;
						_file_index = -1;
						while (TRUE) {
							gpointer _tmp27_ = NULL;
							VbfFile* file;
							_file_index = _file_index + 1;
							if (!(_file_index < _file_size)) {
								break;
							}
							_tmp27_ = vala_list_get (_file_list, _file_index);
							file = (VbfFile*) _tmp27_;
							g_print ("            FILES filename %s\n", file->filename);
							_g_object_unref0 (file);
						}
						_vala_iterable_unref0 (_file_list);
					}
					g_print ("          REFERENCED PACKAGES\n");
					{
						ValaList* _tmp28_ = NULL;
						ValaList* _package_list;
						gint _tmp29_;
						gint _package_size;
						gint _package_index;
						_tmp28_ = vbf_target_get_packages (target);
						_package_list = _tmp28_;
						_tmp29_ = vala_collection_get_size ((ValaCollection*) _package_list);
						_package_size = _tmp29_;
						_package_index = -1;
						while (TRUE) {
							gpointer _tmp30_ = NULL;
							VbfPackage* package;
							_package_index = _package_index + 1;
							if (!(_package_index < _package_size)) {
								break;
							}
							_tmp30_ = vala_list_get (_package_list, _package_index);
							package = (VbfPackage*) _tmp30_;
							g_print ("            name....... %s\n", package->name);
							_g_object_unref0 (package);
						}
						_vala_iterable_unref0 (_package_list);
					}
					g_print ("          BUILT LIBRARIES\n");
					{
						ValaList* _tmp31_ = NULL;
						ValaList* _package_list;
						gint _tmp32_;
						gint _package_size;
						gint _package_index;
						_tmp31_ = vbf_target_get_built_libraries (target);
						_package_list = _tmp31_;
						_tmp32_ = vala_collection_get_size ((ValaCollection*) _package_list);
						_package_size = _tmp32_;
						_package_index = -1;
						while (TRUE) {
							gpointer _tmp33_ = NULL;
							gchar* package;
							_package_index = _package_index + 1;
							if (!(_package_index < _package_size)) {
								break;
							}
							_tmp33_ = vala_list_get (_package_list, _package_index);
							package = (gchar*) _tmp33_;
							g_print ("            name....... %s\n", package);
							_g_free0 (package);
						}
						_vala_iterable_unref0 (_package_list);
					}
					_g_object_unref0 (target);
				}
				_vala_iterable_unref0 (_target_list);
			}
			g_print ("     GROUP VAPI DIRS\n");
			{
				ValaList* _tmp34_ = NULL;
				ValaList* _path_list;
				gint _tmp35_;
				gint _path_size;
				gint _path_index;
				_tmp34_ = vbf_group_get_include_dirs (group);
				_path_list = _tmp34_;
				_tmp35_ = vala_collection_get_size ((ValaCollection*) _path_list);
				_path_size = _tmp35_;
				_path_index = -1;
				while (TRUE) {
					gpointer _tmp36_ = NULL;
					gchar* path;
					_path_index = _path_index + 1;
					if (!(_path_index < _path_size)) {
						break;
					}
					_tmp36_ = vala_list_get (_path_list, _path_index);
					path = (gchar*) _tmp36_;
					g_print ("        DIRECTORY %s\n", path);
					_g_free0 (path);
				}
				_vala_iterable_unref0 (_path_list);
			}
			g_print ("      GROUP REFERENCED PACKAGES\n");
			{
				ValaList* _tmp37_ = NULL;
				ValaList* _package_list;
				gint _tmp38_;
				gint _package_size;
				gint _package_index;
				_tmp37_ = vbf_group_get_packages (group);
				_package_list = _tmp37_;
				_tmp38_ = vala_collection_get_size ((ValaCollection*) _package_list);
				_package_size = _tmp38_;
				_package_index = -1;
				while (TRUE) {
					gpointer _tmp39_ = NULL;
					VbfPackage* package;
					_package_index = _package_index + 1;
					if (!(_package_index < _package_size)) {
						break;
					}
					_tmp39_ = vala_list_get (_package_list, _package_index);
					package = (VbfPackage*) _tmp39_;
					g_print ("        PACAKGE: %s", package->name);
					g_print ("\n");
					_g_object_unref0 (package);
				}
				_vala_iterable_unref0 (_package_list);
			}
			if (vbf_tests_open_test_dump_variables) {
				g_print ("      GROUP VARIABLES\n");
				{
					ValaList* _tmp40_ = NULL;
					ValaList* _variable_list;
					gint _tmp41_;
					gint _variable_size;
					gint _variable_index;
					_tmp40_ = vbf_group_get_variables (group);
					_variable_list = _tmp40_;
					_tmp41_ = vala_collection_get_size ((ValaCollection*) _variable_list);
					_variable_size = _tmp41_;
					_variable_index = -1;
					while (TRUE) {
						gpointer _tmp42_ = NULL;
						VbfVariable* variable;
						gchar* _tmp43_ = NULL;
						gchar* _tmp44_;
						_variable_index = _variable_index + 1;
						if (!(_variable_index < _variable_size)) {
							break;
						}
						_tmp42_ = vala_list_get (_variable_list, _variable_index);
						variable = (VbfVariable*) _tmp42_;
						_tmp43_ = vbf_config_node_to_string ((VbfConfigNode*) variable);
						_tmp44_ = _tmp43_;
						g_print ("        VARIABLE: %s", _tmp44_);
						_g_free0 (_tmp44_);
						g_print ("\n");
						_g_object_unref0 (variable);
					}
					_vala_iterable_unref0 (_variable_list);
				}
			}
			_g_object_unref0 (group);
		}
		_vala_iterable_unref0 (_group_list);
	}
	if (vbf_tests_open_test_dump_variables) {
		g_print ("  GLOBAL VARIABLES\n");
		{
			ValaList* _tmp45_ = NULL;
			ValaList* _variable_list;
			gint _tmp46_;
			gint _variable_size;
			gint _variable_index;
			_tmp45_ = vbf_project_get_variables (project);
			_variable_list = _tmp45_;
			_tmp46_ = vala_collection_get_size ((ValaCollection*) _variable_list);
			_variable_size = _tmp46_;
			_variable_index = -1;
			while (TRUE) {
				gpointer _tmp47_ = NULL;
				VbfVariable* variable;
				gchar* _tmp48_ = NULL;
				gchar* _tmp49_;
				_variable_index = _variable_index + 1;
				if (!(_variable_index < _variable_size)) {
					break;
				}
				_tmp47_ = vala_list_get (_variable_list, _variable_index);
				variable = (VbfVariable*) _tmp47_;
				_tmp48_ = vbf_config_node_to_string ((VbfConfigNode*) variable);
				_tmp49_ = _tmp48_;
				g_print ("    VARIABLE: %s", _tmp49_);
				_g_free0 (_tmp49_);
				g_print ("\n");
				_g_object_unref0 (variable);
			}
			_vala_iterable_unref0 (_variable_list);
		}
	}
}


static gchar* vbf_tests_open_test_get_source_type_description (VbfTestsOpenTest* self, VbfFileTypes type) {
	gchar* result = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	switch (type) {
		case VBF_FILE_TYPES_DATA:
		{
			gchar* _tmp0_;
			_tmp0_ = g_strdup ("(DATA)    ");
			result = _tmp0_;
			return result;
		}
		case VBF_FILE_TYPES_OTHER_SOURCE:
		{
			gchar* _tmp1_;
			_tmp1_ = g_strdup ("(OTHER)   ");
			result = _tmp1_;
			return result;
		}
		case VBF_FILE_TYPES_UNKNOWN:
		{
			gchar* _tmp2_;
			_tmp2_ = g_strdup ("(UNKNOWN) ");
			result = _tmp2_;
			return result;
		}
		case VBF_FILE_TYPES_VALA_SOURCE:
		{
			gchar* _tmp3_;
			_tmp3_ = g_strdup ("(VALA)    ");
			result = _tmp3_;
			return result;
		}
		default:
		{
			gchar* _tmp4_ = NULL;
			_tmp4_ = g_strdup_printf ("(N/A: %d)", (gint) type);
			result = _tmp4_;
			return result;
		}
	}
}


static gchar* vbf_tests_open_test_get_target_type_description (VbfTestsOpenTest* self, VbfTargetTypes type) {
	gchar* result = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	switch (type) {
		case VBF_TARGET_TYPES_PROGRAM:
		{
			gchar* _tmp0_;
			_tmp0_ = g_strdup ("(PROGRAM)       ");
			result = _tmp0_;
			return result;
		}
		case VBF_TARGET_TYPES_LIBRARY:
		{
			gchar* _tmp1_;
			_tmp1_ = g_strdup ("(LIBRARY)       ");
			result = _tmp1_;
			return result;
		}
		case VBF_TARGET_TYPES_DATA:
		{
			gchar* _tmp2_;
			_tmp2_ = g_strdup ("(DATA)          ");
			result = _tmp2_;
			return result;
		}
		case VBF_TARGET_TYPES_BUILT_SOURCES:
		{
			gchar* _tmp3_;
			_tmp3_ = g_strdup ("(BUILT_SOURCES) ");
			result = _tmp3_;
			return result;
		}
		default:
		{
			gchar* _tmp4_ = NULL;
			_tmp4_ = g_strdup_printf ("(N/A: %d)       ", (gint) type);
			result = _tmp4_;
			return result;
		}
	}
}


gint vbf_tests_open_test_main (gchar** args, int args_length1) {
	gint result = 0;
	GOptionContext* _tmp0_ = NULL;
	GOptionContext* opt_context;
	VbfTestsOpenTest* _tmp2_ = NULL;
	VbfTestsOpenTest* test;
	gint _tmp3_ = 0;
	gboolean _tmp4_;
	GError * _inner_error_ = NULL;
	_tmp0_ = g_option_context_new ("- Vala Build Framework Utility");
	opt_context = _tmp0_;
	g_option_context_set_help_enabled (opt_context, TRUE);
	g_option_context_add_main_entries (opt_context, VBF_TESTS_OPEN_TEST_options, NULL);
	g_option_context_parse (opt_context, &args_length1, &args, &_inner_error_);
	if (_inner_error_ != NULL) {
		_g_option_context_free0 (opt_context);
		if (_inner_error_->domain == G_OPTION_ERROR) {
			goto __catch0_g_option_error;
		}
		_g_option_context_free0 (opt_context);
		g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
		g_clear_error (&_inner_error_);
		return 0;
	}
	_g_option_context_free0 (opt_context);
	goto __finally0;
	__catch0_g_option_error:
	{
		GError * e;
		const gchar* _tmp1_ = NULL;
		e = _inner_error_;
		_inner_error_ = NULL;
		fprintf (stdout, "%s\n", e->message);
		_tmp1_ = _ ("Run '%s --help' to see a full list of available command line options.\n");
		fprintf (stdout, _tmp1_, args[0]);
		result = 1;
		_g_error_free0 (e);
		return result;
	}
	__finally0:
	if (_inner_error_ != NULL) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
		g_clear_error (&_inner_error_);
		return 0;
	}
	_tmp2_ = vbf_tests_open_test_new ();
	test = _tmp2_;
	_tmp4_ = vbf_tests_open_test_run (test, vbf_tests_open_test_projects[0]);
	if (_tmp4_) {
		_tmp3_ = 0;
	} else {
		_tmp3_ = 1;
	}
	result = _tmp3_;
	_vbf_tests_open_test_unref0 (test);
	return result;
}


int main (int argc, char ** argv) {
	g_type_init ();
	return vbf_tests_open_test_main (argv, argc);
}


VbfTestsOpenTest* vbf_tests_open_test_construct (GType object_type) {
	VbfTestsOpenTest* self = NULL;
	self = (VbfTestsOpenTest*) g_type_create_instance (object_type);
	return self;
}


VbfTestsOpenTest* vbf_tests_open_test_new (void) {
	return vbf_tests_open_test_construct (VBF_TESTS_TYPE_OPEN_TEST);
}


static void vbf_tests_value_open_test_init (GValue* value) {
	value->data[0].v_pointer = NULL;
}


static void vbf_tests_value_open_test_free_value (GValue* value) {
	if (value->data[0].v_pointer) {
		vbf_tests_open_test_unref (value->data[0].v_pointer);
	}
}


static void vbf_tests_value_open_test_copy_value (const GValue* src_value, GValue* dest_value) {
	if (src_value->data[0].v_pointer) {
		dest_value->data[0].v_pointer = vbf_tests_open_test_ref (src_value->data[0].v_pointer);
	} else {
		dest_value->data[0].v_pointer = NULL;
	}
}


static gpointer vbf_tests_value_open_test_peek_pointer (const GValue* value) {
	return value->data[0].v_pointer;
}


static gchar* vbf_tests_value_open_test_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
	if (collect_values[0].v_pointer) {
		VbfTestsOpenTest* object;
		object = collect_values[0].v_pointer;
		if (object->parent_instance.g_class == NULL) {
			return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
			return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		}
		value->data[0].v_pointer = vbf_tests_open_test_ref (object);
	} else {
		value->data[0].v_pointer = NULL;
	}
	return NULL;
}


static gchar* vbf_tests_value_open_test_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
	VbfTestsOpenTest** object_p;
	object_p = collect_values[0].v_pointer;
	if (!object_p) {
		return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
	}
	if (!value->data[0].v_pointer) {
		*object_p = NULL;
	} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
		*object_p = value->data[0].v_pointer;
	} else {
		*object_p = vbf_tests_open_test_ref (value->data[0].v_pointer);
	}
	return NULL;
}


GParamSpec* vbf_tests_param_spec_open_test (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) {
	VbfTestsParamSpecOpenTest* spec;
	g_return_val_if_fail (g_type_is_a (object_type, VBF_TESTS_TYPE_OPEN_TEST), NULL);
	spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
	G_PARAM_SPEC (spec)->value_type = object_type;
	return G_PARAM_SPEC (spec);
}


gpointer vbf_tests_value_get_open_test (const GValue* value) {
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, VBF_TESTS_TYPE_OPEN_TEST), NULL);
	return value->data[0].v_pointer;
}


void vbf_tests_value_set_open_test (GValue* value, gpointer v_object) {
	VbfTestsOpenTest* old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, VBF_TESTS_TYPE_OPEN_TEST));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, VBF_TESTS_TYPE_OPEN_TEST));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
		vbf_tests_open_test_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		vbf_tests_open_test_unref (old);
	}
}


void vbf_tests_value_take_open_test (GValue* value, gpointer v_object) {
	VbfTestsOpenTest* old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, VBF_TESTS_TYPE_OPEN_TEST));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, VBF_TESTS_TYPE_OPEN_TEST));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		vbf_tests_open_test_unref (old);
	}
}


static void vbf_tests_open_test_class_init (VbfTestsOpenTestClass * klass) {
	vbf_tests_open_test_parent_class = g_type_class_peek_parent (klass);
	VBF_TESTS_OPEN_TEST_CLASS (klass)->finalize = vbf_tests_open_test_finalize;
}


static void vbf_tests_open_test_instance_init (VbfTestsOpenTest * self) {
	self->ref_count = 1;
}


static void vbf_tests_open_test_finalize (VbfTestsOpenTest* obj) {
	VbfTestsOpenTest * self;
	self = VBF_TESTS_OPEN_TEST (obj);
}


GType vbf_tests_open_test_get_type (void) {
	static volatile gsize vbf_tests_open_test_type_id__volatile = 0;
	if (g_once_init_enter (&vbf_tests_open_test_type_id__volatile)) {
		static const GTypeValueTable g_define_type_value_table = { vbf_tests_value_open_test_init, vbf_tests_value_open_test_free_value, vbf_tests_value_open_test_copy_value, vbf_tests_value_open_test_peek_pointer, "p", vbf_tests_value_open_test_collect_value, "p", vbf_tests_value_open_test_lcopy_value };
		static const GTypeInfo g_define_type_info = { sizeof (VbfTestsOpenTestClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) vbf_tests_open_test_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (VbfTestsOpenTest), 0, (GInstanceInitFunc) vbf_tests_open_test_instance_init, &g_define_type_value_table };
		static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
		GType vbf_tests_open_test_type_id;
		vbf_tests_open_test_type_id = g_type_register_fundamental (g_type_fundamental_next (), "VbfTestsOpenTest", &g_define_type_info, &g_define_type_fundamental_info, 0);
		g_once_init_leave (&vbf_tests_open_test_type_id__volatile, vbf_tests_open_test_type_id);
	}
	return vbf_tests_open_test_type_id__volatile;
}


gpointer vbf_tests_open_test_ref (gpointer instance) {
	VbfTestsOpenTest* self;
	self = instance;
	g_atomic_int_inc (&self->ref_count);
	return instance;
}


void vbf_tests_open_test_unref (gpointer instance) {
	VbfTestsOpenTest* self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		VBF_TESTS_OPEN_TEST_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}



