diff --git a/contrib/tmpl/tmpl-branch-node.c b/contrib/tmpl/tmpl-branch-node.c
index 10994ad..c4058a0 100644
--- a/contrib/tmpl/tmpl-branch-node.c
+++ b/contrib/tmpl/tmpl-branch-node.c
@@ -71,7 +71,7 @@ tmpl_branch_node_accept (TmplNode      *node,
           g_set_error (error,
                        TMPL_ERROR,
                        TMPL_ERROR_SYNTAX_ERROR,
-                       "Unexpected end-of-file reached");
+                       "Template: Syntax error: Unexpected end-of-file reached");
           TMPL_RETURN (FALSE);
 
         case TMPL_TOKEN_END:
@@ -120,7 +120,7 @@ tmpl_branch_node_accept (TmplNode      *node,
           g_set_error (error,
                        TMPL_ERROR,
                        TMPL_ERROR_SYNTAX_ERROR,
-                       "Invalid token, expected else if, else, or end.");
+                       "Template: Syntax error: Invalid token, expected else if, else, or end.");
           TMPL_RETURN (FALSE);
         }
     }
diff --git a/plugins/autotools-templates/Makefile.am b/plugins/autotools-templates/Makefile.am
index 6ffed25..89d70ed 100644
--- a/plugins/autotools-templates/Makefile.am
+++ b/plugins/autotools-templates/Makefile.am
@@ -18,6 +18,11 @@ nobase_resource_DATA = \
 	autotools_templates/resources/data/Makefile.am \
 	autotools_templates/resources/data/package.pc.in \
 	autotools_templates/resources/git.mk \
+	autotools_templates/resources/gtester.mk \
+	autotools_templates/resources/vala.mk \
+	autotools_templates/resources/valalib.mk \
+	autotools_templates/resources/valalib_introspection.mk \
+	autotools_templates/resources/vala_tester.mk \
 	autotools_templates/resources/m4/Makefile.am \
 	autotools_templates/resources/m4/appstream-xml.m4 \
 	autotools_templates/resources/m4/ax_append_compile_flags.m4 \
@@ -49,6 +54,12 @@ nobase_resource_DATA = \
 	autotools_templates/resources/src/package-version.h.in \
 	autotools_templates/resources/src/package.h \
 	autotools_templates/resources/src/package.vala \
+	autotools_templates/resources/src/package.deps.in \
+	autotools_templates/resources/src/package-namespace.vala.in \
+	autotools_templates/resources/tests/Makefile.shared-library-vala \
+	autotools_templates/resources/tests/package-case-test.vala \
+	autotools_templates/resources/tests/package-test.vala \
+	autotools_templates/resources/tests/tests-config.vala.in \
 	$(NULL)
 
 EXTRA_DIST = $(nobase_resource_DATA)
diff --git a/plugins/autotools-templates/autotools_templates/__init__.py b/plugins/autotools-templates/autotools_templates/__init__.py
index 2c2bbfa..0ca6433 100644
--- a/plugins/autotools-templates/autotools_templates/__init__.py
+++ b/plugins/autotools-templates/autotools_templates/__init__.py
@@ -178,6 +178,11 @@ class AutotoolsTemplate(Ide.TemplateBase, Ide.ProjectTemplate):
             'resources/autogen.sh':                     'autogen.sh',
             'resources/configure.ac':                   'configure.ac',
             'resources/git.mk':                         'git.mk',
+            'resources/gtester.mk':                     'gtester.mk',
+            'resources/vala.mk':                        'vala.mk',
+            'resources/valalib.mk':                     'valalib.mk',
+            'resources/valalib_introspection.mk':       'valalib_introspection.mk',
+            'resources/vala_tester.mk':                 'vala_tester.mk',
 
             'resources/m4/Makefile.am':                 'm4/Makefile.am',
             'resources/m4/appstream-xml.m4':            'm4/appstream-xml.m4',
@@ -269,7 +274,6 @@ class LibraryProjectTemplate(AutotoolsTemplate):
 
     def prepare_files(self, files):
         files['resources/data/package.pc.in'] = 'data/%(name)s.pc.in'
-
         if self.language in ('c', 'c++'):
             files['resources/src/Makefile.shared-library-c'] = 'src/Makefile.am'
             files['resources/src/package.h'] = 'src/%(name)s.h'
@@ -278,6 +282,12 @@ class LibraryProjectTemplate(AutotoolsTemplate):
         elif self.language == 'vala':
             files['resources/src/Makefile.shared-library-vala'] = 'src/Makefile.am'
             files['resources/src/package.vala'] = 'src/%(prefix)s.vala'
+            files['resources/src/package.deps.in'] = 'src/%(prefix)s.deps.in'
+            files['resources/src/package-namespace.vala.in'] = 'src/%(prefix)s-namespace.vala.in'
+            files['resources/tests/Makefile.shared-library-vala'] = 'tests/Makefile.am'
+            files['resources/tests/package-case-test.vala'] = 'tests/%(prefix)s-case-test.vala'
+            files['resources/tests/package-test.vala'] = 'tests/%(prefix)s-test.vala'
+            files['resources/tests/tests-config.vala.in'] = 'tests/tests-config.vala.in'
 
 
 class EmptyProjectTemplate(AutotoolsTemplate):
diff --git a/plugins/autotools-templates/autotools_templates/resources/Makefile.am b/plugins/autotools-templates/autotools_templates/resources/Makefile.am
index 2be5da8..c6e9f50 100644
--- a/plugins/autotools-templates/autotools_templates/resources/Makefile.am
+++ b/plugins/autotools-templates/autotools_templates/resources/Makefile.am
@@ -1,4 +1,11 @@
-SUBDIRS = data src{{if enable_i18n}} po{{end}}
+SUBDIRS = data src {{if template == "shared-library" }}tests{{end}} {{if enable_i18n}} po{{end}}
+
+{{if template == "shared-library"}}
+# Define available flags
+DISTCHECK_CONFIGURE_FLAGS = \
+	--disable-introspection \
+	$(NULL)
+{{end}}
 
 EXTRA_DIST = AUTHORS
 
diff --git a/plugins/autotools-templates/autotools_templates/resources/configure.ac b/plugins/autotools-templates/autotools_templates/resources/configure.ac
index af75957..7c2b822 100644
--- a/plugins/autotools-templates/autotools_templates/resources/configure.ac
+++ b/plugins/autotools-templates/autotools_templates/resources/configure.ac
@@ -136,13 +136,23 @@ AC_CONFIG_FILES([
 {{if language != "vala"}}
 	src/{{prefix}}-version.h
 {{end}}
+{{if language == "vala"}}
+	src/{{name}}-namespace.vala
+	src/{{name}}-$API_VERSION.deps:src/{{name}}.deps.in
+{{end}}
 {{end}}
-
 	data/Makefile
 {{if template == "shared-library"}}
 	data/{{name}}-$API_VERSION.pc:data/{{name}}.pc.in
 {{end}}
 
+{{if template == "shared-library"}}
+	tests/Makefile
+{{if language == "vala"}}
+	tests/tests-config.vala
+{{end}}
+{{end}}
+
 {{if enable_i18n}}
 	po/Makefile.in
 {{end}}
diff --git a/plugins/autotools-templates/autotools_templates/resources/data/package.pc.in b/plugins/autotools-templates/autotools_templates/resources/data/package.pc.in
index e69de29..6c34a9b 100644
--- a/plugins/autotools-templates/autotools_templates/resources/data/package.pc.in
+++ b/plugins/autotools-templates/autotools_templates/resources/data/package.pc.in
@@ -0,0 +1,13 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+datarootdir=@datarootdir@
+datadir=@datadir@
+includedir=@includedir@
+
+Name: {{prefix}}-@API_VERSION@
+Description: {{prefix}} library
+Version: @VERSION@
+Requires: glib-2.0 gobject-2.0
+Libs: -L${libdir} -l{{prefix}}-@API_VERSION@
+Cflags: -I${includedir}/{{prefix}}-@API_VERSION@
diff --git a/plugins/autotools-templates/autotools_templates/resources/gtester.mk b/plugins/autotools-templates/autotools_templates/resources/gtester.mk
new file mode 100644
index 0000000..c02f860
--- /dev/null
+++ b/plugins/autotools-templates/autotools_templates/resources/gtester.mk
@@ -0,0 +1,59 @@
+# GLIB - Library of useful C routines
+# From http://git.gnome.org/browse/glib/tree/Makefile.decl
+
+GTESTER = gtester
+GTESTER_REPORT = gtester-report
+
+# initialize variables for unconditional += appending
+TEST_PROGS =
+
+### testing rules
+
+# test: run all tests in cwd and subdirs
+test:	${TEST_PROGS}
+	@test -z "${TEST_PROGS}" || ${GTESTER} --verbose ${TEST_PROGS}
+	@ for subdir in $(SUBDIRS) . ; do \
+	    test "$$subdir" = "." -o "$$subdir" = "po" || \
+	    ( cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $@ ) || exit $? ; \
+	  done
+
+# test-report: run tests in subdirs and generate report
+# perf-report: run tests in subdirs with -m perf and generate report
+# full-report: like test-report: with -m perf and -m slow
+test-report perf-report full-report:	${TEST_PROGS}
+	@test -z "${TEST_PROGS}" || { \
+	  case $@ in \
+	  test-report) test_options="-k";; \
+	  perf-report) test_options="-k -m=perf";; \
+	  full-report) test_options="-k -m=perf -m=slow";; \
+	  esac ; \
+	  if test -z "$$GTESTER_LOGDIR" ; then	\
+	    ${GTESTER} --verbose $$test_options -o test-report.xml ${TEST_PROGS} ; \
+	  elif test -n "${TEST_PROGS}" ; then \
+	    ${GTESTER} --verbose $$test_options -o `mktemp "$$GTESTER_LOGDIR/log-XXXXXX"` ${TEST_PROGS} ; \
+	  fi ; \
+	}
+	@ ignore_logdir=true ; \
+	  if test -z "$$GTESTER_LOGDIR" ; then \
+	    GTESTER_LOGDIR=`mktemp -d "\`pwd\`/.testlogs-XXXXXX"`; export GTESTER_LOGDIR ; \
+	    ignore_logdir=false ; \
+	  fi ; \
+	  for subdir in $(SUBDIRS) . ; do \
+	    test "$$subdir" = "." -o "$$subdir" = "po" || \
+	    ( cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $@ ) || exit $? ; \
+	  done ; \
+	  $$ignore_logdir || { \
+	    echo '<?xml version="1.0"?>' > $@.xml ; \
+	    echo '<report-collection>'  >> $@.xml ; \
+	    for lf in `ls -L "$$GTESTER_LOGDIR"/.` ; do \
+	      sed '1,1s/^<?xml\b[^>?]*?>//' <"$$GTESTER_LOGDIR"/"$$lf" >> $@.xml ; \
+	    done ; \
+	    echo >> $@.xml ; \
+	    echo '</report-collection>' >> $@.xml ; \
+	    rm -rf "$$GTESTER_LOGDIR"/ ; \
+	    ${GTESTER_REPORT} --version 2>/dev/null 1>&2 ; test "$$?" != 0 || ${GTESTER_REPORT} $@.xml >$@.html ; \
+	  }
+.PHONY: test test-report perf-report full-report
+# run make test as part of make check
+check-local: test
+
diff --git a/plugins/autotools-templates/autotools_templates/resources/m4/valac.m4 b/plugins/autotools-templates/autotools_templates/resources/m4/valac.m4
new file mode 100644
index 0000000..bde4ba0
--- /dev/null
+++ b/plugins/autotools-templates/autotools_templates/resources/m4/valac.m4
@@ -0,0 +1,78 @@
+dnl vapigen.m4
+dnl
+dnl Copyright 2014 Daniel Espinosa
+dnl
+dnl This library is free software; you can redistribute it and/or
+dnl modify it under the terms of the GNU Lesser General Public
+dnl License as published by the Free Software Foundation; either
+dnl version 2.1 of the License, or (at your option) any later version.
+dnl
+dnl This library is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+dnl Lesser General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU Lesser General Public
+dnl License along with this library; if not, write to the Free Software
+dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
+
+# serial 8
+
+# VALAC_CHECK([VERSION], [API_VERSION])
+# --------------------------------------
+# Check valac existence and version.
+m4_define([_VALAC_CHECK_INTERNAL],
+[
+  AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+  AS_IF([ test "x$2" = "x" ], [
+    AM_PROG_VALAC($1)
+    AS_IF([ test "x$VALAC" = "xno"], [
+      check_prog=no
+      AC_MSG_ERROR([valac is not installed])
+    ], [
+      check_prog=yes
+      VALAC_VERSION=`$VALAC --api-version`
+      VAPIDIR=$datadir/vala-$VALAC_VERSION/vapi
+      VAPIDIR_UNVERSIONED=$datadir/vala-$VALAC_VERSION/vapi
+    ])
+  ], [
+    AS_IF([ test "x$1" = "x"], [
+        vala_pkg="libvala-$2"
+      ], [
+        vala_pkg="libvala-$2 >= $1"
+      ])
+	  AC_MSG_CHECKING([for $vala_pkg])
+	  PKG_CHECK_EXISTS([ $vala_pkg ], [
+	          vala_pkg_found=yes
+            VAPIGEN=`$PKG_CONFIG --variable=vapigen libvala-$2`
+	          VAPIGEN_MAKEFILE=`$PKG_CONFIG --variable=datadir libvala-$2`/vala/Makefile.vapigen
+	          VAPIDIR=`$PKG_CONFIG --variable=vapidir libvala-$2`
+            GEN_INTROSPECT=`$PKG_CONFIG --variable=gen_introspect libvala-$2`
+            vala_datadir=`$PKG_CONFIG --variable=datadir libvala-$2`
+            VAPIDIR_UNVERSIONED=$vala_datadir/vala/vapi
+            VALA_GEN_INTROSPECT=`$PKG_CONFIG --variable=vala_gen_introspect libvala-$2`
+	    ], [
+	          vala_pkg_found=no
+	          AC_MSG_ERROR([no package libvala-$2 is installed])
+	    ])
+	  AC_MSG_RESULT([$vala_pkg_found])
+  ])
+	AC_SUBST([VAPIGEN])
+	AC_SUBST([VAPIGEN_VAPIDIR])
+	AC_SUBST([VAPIDIR])
+	AC_SUBST([VAPIDIR_UNVERSIONED])
+	AC_SUBST([VAPIGEN_MAKEFILE])
+	AC_SUBST([GEN_INTROSPECT])
+	AC_SUBST([VALA_GEN_INTROSPECT])
+	AC_SUBST([VALAC_VERSION])
+])
+
+dnl Check VAPIGEN
+# VALAC_CHECK([VERSION], [API_VERSION], [DEFAULT])
+# --------------------------------------
+# Check vapigen existence and version.
+AC_DEFUN([VALAC_CHECK],
+[
+  _VALAC_CHECK_INTERNAL($1,$2,$3)
+]
+)
diff --git a/plugins/autotools-templates/autotools_templates/resources/src/Makefile.shared-library-vala b/plugins/autotools-templates/autotools_templates/resources/src/Makefile.shared-library-vala
index 628a877..eb7c3ae 100644
--- a/plugins/autotools-templates/autotools_templates/resources/src/Makefile.shared-library-vala
+++ b/plugins/autotools-templates/autotools_templates/resources/src/Makefile.shared-library-vala
@@ -1,9 +1,18 @@
-lib_LTLIBRARIES = lib{{name}}-@API_VERSION@.la
+include $(top_srcdir)/valalib.mk
 
-lib{{name_}}_@API_VERSION@_la_SOURCES = \
+VALA_TARGET = lib{{name}}-@API_VERSION@.la
+
+lib_LTLIBRARIES = $(VALA_TARGET)
+
+VALASOURCES= \
+	{{name}}-namespace.vala \
 	{{name}}.vala \
 	$(NULL)
 
+lib{{name_}}_@API_VERSION@_la_SOURCES = \
+	$(VALA_CSOURCES) \
+	$(NULL)
+
 lib{{name_}}_@API_VERSION@_la_CFLAGS = \
 	$({{NAME}}_CFLAGS) \
 	$(WARN_CFLAGS) \
@@ -17,10 +26,31 @@ lib{{name_}}_@API_VERSION@_la_LDFLAGS = \
 	$(WARN_LDFLAGS) \
 	$(NULL)
 
-lib{{name_}}_@API_VERSION@_la_VALAFLAGS = \
+VALAFLAGS += \
+	--vapidir=$(VAPIDIR) \
 	--thread \
 	--target-glib=2.44 \
 	--pkg glib-2.0 \
 	$(NULL)
 
--include $(top_srcdir)/git.mk
+VALA_CHEADER = {{prefix}}.h
+VALA_INCLUDEDIR = {{Prefix}}-@API_VERSION@
+
+
+VALA_VAPI = {{prefix}}-@API_VERSION@.vapi
+
+{{prefix}}-@API_VERSION@.deps:
+	cp {{prefix}}.deps {{prefix}}-@API_VERSION@.deps
+
+DISTCLEANFILES={{prefix}}.deps {{prefix}}-@API_VERSION@.deps
+
+VALA_DEPS = {{prefix}}-@API_VERSION@.deps
+
+if HAVE_INTROSPECTION
+
+include $(top_srcdir)/valalib_introspection.mk
+
+INTROSPECTION_GIRS = {{Prefix}}-@API_VERSION@.gir
+INTROSPECTION_TYPELIBS = {{Prefix}}-@API_VERSION@.typelib
+
+endif
diff --git a/plugins/autotools-templates/autotools_templates/resources/src/package-namespace.vala.in b/plugins/autotools-templates/autotools_templates/resources/src/package-namespace.vala.in
new file mode 100644
index 0000000..77bc682
--- /dev/null
+++ b/plugins/autotools-templates/autotools_templates/resources/src/package-namespace.vala.in
@@ -0,0 +1,4 @@
+{{include "license.vala"}}
+
+[CCode (gir_namespace = "{{Prefix}}", gir_version = "@API_VERSION@", cheader_filename = "{{prefix}}/{{prefix}}.h")]
+namespace {{Prefix}} {}
diff --git a/plugins/autotools-templates/autotools_templates/resources/src/package.deps.in b/plugins/autotools-templates/autotools_templates/resources/src/package.deps.in
new file mode 100644
index 0000000..2bb8574
--- /dev/null
+++ b/plugins/autotools-templates/autotools_templates/resources/src/package.deps.in
@@ -0,0 +1 @@
+glib-2.0
diff --git a/plugins/autotools-templates/autotools_templates/resources/src/package.vala b/plugins/autotools-templates/autotools_templates/resources/src/package.vala
index 106d6ec..ee63008 100644
--- a/plugins/autotools-templates/autotools_templates/resources/src/package.vala
+++ b/plugins/autotools-templates/autotools_templates/resources/src/package.vala
@@ -3,5 +3,7 @@
 using GLib;
 
 namespace {{Prefix}} {
-
+	public class A {
+		public bool foo() { return false; }
+	}
 }
diff --git a/plugins/autotools-templates/autotools_templates/resources/tests/Makefile.shared-library-vala b/plugins/autotools-templates/autotools_templates/resources/tests/Makefile.shared-library-vala
new file mode 100644
index 0000000..ddfbfe5
--- /dev/null
+++ b/plugins/autotools-templates/autotools_templates/resources/tests/Makefile.shared-library-vala
@@ -0,0 +1,43 @@
+include $(top_srcdir)/vala_tester.mk
+
+VALA_TARGET={{name}}_test
+
+noinst_PROGRAMS = $(VALA_TARGET)
+
+VALASOURCES = \
+	tests-config.vala \
+	{{prefix}}-test.vala \
+	{{prefix}}-case-test.vala \
+	$(NULL)
+
+{{name}}_test_SOURCES = $(VALA_CSOURCES)
+
+VALAFLAGS += \
+	--vapidir=$(VAPIDIR) \
+	--vapidir=$(top_builddir)/src \
+	--pkg {{name}}-@API_VERSION@ \
+	-g \
+	$(NULL)
+
+
+{{name}}_test_CFLAGS = \
+	-g \
+	$({{PREFIX}}_CFLAGS) \
+	-I$(top_builddir)/src \
+	-I$(top_builddir) \
+	$(NULL)
+
+{{name}}_test_LDADD = \
+	$({{PREFIX}}_LIBS) \
+	$(top_builddir)/src/lib{{name}}-@API_VERSION@.la
+
+
+{{name}}_test_LDFLAGS = $(AM_LDFLAGS)
+
+
+DISTCLEANFILES += \
+	test-config.vala \
+	$(NULL)
+
+
+
diff --git a/plugins/autotools-templates/autotools_templates/resources/tests/package-case-test.vala b/plugins/autotools-templates/autotools_templates/resources/tests/package-case-test.vala
new file mode 100644
index 0000000..a5b0351
--- /dev/null
+++ b/plugins/autotools-templates/autotools_templates/resources/tests/package-case-test.vala
@@ -0,0 +1,41 @@
+/* -*- Mode: vala; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*-  */
+/* atest-test.vala
+ *
+ * Copyright (C) 2016  Daniel Espinosa <esodan@gmail.com>
+ *
+ * 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, see <http://www.gnu.org/licenses/>.
+ *
+ * Authors:
+ *      Daniel Espinosa <esodan@gmail.com>
+ */
+
+using GLib;
+
+public class AtestTest.Case {
+  public static void add_funcs ()
+  {
+    Test.add_func ("/atest/case/one",
+    ()=>{
+    try {
+      // Prepare your test scenario
+      
+      // Add asserts for each condition
+      assert (true);
+    } catch (GLib.Error e) {
+      GLib.message ("ERROR: "+e.message);
+      assert_not_reached ();
+    }
+    });
+  }
+}
diff --git a/plugins/autotools-templates/autotools_templates/resources/tests/package-test.vala b/plugins/autotools-templates/autotools_templates/resources/tests/package-test.vala
new file mode 100644
index 0000000..065bb4a
--- /dev/null
+++ b/plugins/autotools-templates/autotools_templates/resources/tests/package-test.vala
@@ -0,0 +1,32 @@
+/* -*- Mode: vala; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*-  */
+/* atest-test.vala
+ *
+ * Copyright (C) 2016  Daniel Espinosa <esodan@gmail.com>
+ *
+ * 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, see <http://www.gnu.org/licenses/>.
+ *
+ * Authors:
+ *      Daniel Espinosa <esodan@gmail.com>
+ */
+
+class AtestTest.Suite : Object
+{
+  static int main (string args[])
+  {
+    GLib.Intl.setlocale (GLib.LocaleCategory.ALL, "");
+    Test.init (ref args);
+    Case.add_funcs ();
+    return Test.run ();
+  }
+}
diff --git a/plugins/autotools-templates/autotools_templates/resources/tests/tests-config.vala.in b/plugins/autotools-templates/autotools_templates/resources/tests/tests-config.vala.in
new file mode 100644
index 0000000..bb91af0
--- /dev/null
+++ b/plugins/autotools-templates/autotools_templates/resources/tests/tests-config.vala.in
@@ -0,0 +1,30 @@
+/* -*- Mode: Vala; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*- */
+/* atest-test.vala
+ *
+ * Copyright (C) 2016  Daniel Espinosa <esodan@gmail.com>
+ *
+ * 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, see <http://www.gnu.org/licenses/>.
+ *
+ * Authors:
+ *      Daniel Espinosa <esodan@gmail.com>
+ */
+[CCode (cprefix = "", lower_case_cprefix = "", cheader_filename = "config.h")]
+namespace AtestTest {
+  // Use this variable when you want, for example, to read some file
+  // located in sources
+  public static const string TEST_DIR = "@top_srcdir@/tests";
+  // Use this variable when you want, for example, to read some file to be
+  // located in build directory
+  public static const string TEST_BUILD_DIR = "@top_builddir@/tests";
+}
diff --git a/plugins/autotools-templates/autotools_templates/resources/vala.mk b/plugins/autotools-templates/autotools_templates/resources/vala.mk
new file mode 100644
index 0000000..64f2f94
--- /dev/null
+++ b/plugins/autotools-templates/autotools_templates/resources/vala.mk
@@ -0,0 +1,76 @@
+# vala.mk
+# Copyright (C) 2015  Daniel Espinosa <esodan@gmail.com>
+#
+# 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, see <http://www.gnu.org/licenses/>.
+#
+# Authors:
+#      Daniel Espinosa <esodan@gmail.com>
+#
+#
+# To compile Vala sources, define a target using Autotools standard variable
+# using target_BIN or lib_LTLIBRARIES to $(VALA_TARGET).
+# All Vala sources should be defined in VALASOURCES, as result
+# you have to set your target sources to target_SOURCES = $(VALA_CSOURCES).
+#
+# Use standard Autotools variables to set CFLAGS, LDFLAGS and LIBADD, as required.
+
+-include $(top_srcdir)/git.mk
+
+NULL=
+VALAFLAGS=
+
+vala-stamp: $(VALASOURCES)
+	@rm -f vala-temp
+	@touch vala-temp
+	$(VALAC) $(VALAFLAGS) -C $^
+	@mv -f vala-temp $@
+
+$(VALASOURCES:.vala=.c): vala-stamp
+## Recover from the removal of $@
+	@if test -f $@; then :; else \
+		trap ’rm -rf vala-lock vala-stamp’ 1 2 13 15; \
+		if mkdir vala-lock 2>/dev/null; then \
+## This code is being executed by the first process.
+			rm -f vala-stamp; \
+			$(MAKE) $(AM_MAKEFLAGS) vala-stamp; \
+			rmdir vala-lock; \
+		else \
+## This code is being executed by the follower processes.
+## Wait until the first process is done.
+			while test -d vala-lock; do sleep 1; done; \
+## Succeed if and only if the first process succeeded.
+			test -f vala-stamp; exit $$?; \
+		fi; \
+	fi
+
+VALA_CSOURCES= \
+  $(VALASOURCES:.vala=.c) \
+  $(NULL)
+
+$(VALA_CSOURCES):vala-stamp
+
+EXTRA_DIST = \
+	$(VALASOURCES) \
+	$(NULL)
+
+GITIGNOREFILES = \
+	$(VALASOURCES:.vala=.c) \
+	$(NULL)
+
+
+CLEANFILES = \
+	vala-stamp \
+	$(VALASOURCES:.vala=.c) \
+	$(NULL)
+
diff --git a/plugins/autotools-templates/autotools_templates/resources/vala_tester.mk b/plugins/autotools-templates/autotools_templates/resources/vala_tester.mk
new file mode 100644
index 0000000..71a0662
--- /dev/null
+++ b/plugins/autotools-templates/autotools_templates/resources/vala_tester.mk
@@ -0,0 +1,9 @@
+include $(top_srcdir)/gtester.mk
+
+include $(top_srcdir)/vala.mk
+
+TEST_PROGS += $(VALA_TARGET)
+
+DISTCLEANFILES = \
+	$(VALA_TARGET) \
+	$(NULL)
diff --git a/plugins/autotools-templates/autotools_templates/resources/valalib.mk b/plugins/autotools-templates/autotools_templates/resources/valalib.mk
new file mode 100644
index 0000000..3394fbd
--- /dev/null
+++ b/plugins/autotools-templates/autotools_templates/resources/valalib.mk
@@ -0,0 +1,55 @@
+# vala.mk
+# Copyright (C) 2015  Daniel Espinosa <esodan@gmail.com>
+#
+# 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, see <http://www.gnu.org/licenses/>.
+#
+# Authors:
+#      Daniel Espinosa <esodan@gmail.com>
+#
+# For libraries you should define VALA_CHEADER for its C header and VALA_VAPI
+# for its VAPI file and its VALA_DEPS as its library dependencies.
+#
+# Use VALA_INCLUDEDIR to define directory where do you want to install your C header.
+#
+# For GObject Introspection optional generation support you should use
+# --enable-instrospection switch on configure and define INTROSPECTION_GIRS
+# and INTROSPECTION_TYPELIBS. VALA_TARGET should be a library.
+
+include $(top_srcdir)/vala.mk
+
+
+VALAFLAGS += \
+	-H $(VALA_CHEADER) \
+	--vapi $(VALA_VAPI) \
+	--library=$(VALA_VAPI:.vapi=) \
+	$(NULL)
+
+# .h header file
+$(VALA_CHEADER): vala-stamp
+vala_cheaderdir= $(includedir)/$(VALA_INCLUDEDIR)
+vala_cheader_HEADERS = $(VALA_CHEADER)
+
+# .vapi Vala API file
+$(VALA_VAPI): vala-stamp
+vala_vapidir = $(datadir)/vala/vapi
+dist_vala_vapi_DATA = \
+	$(VALA_VAPI) \
+	$(VALA_DEPS) \
+	$(NULL)
+
+CLEANFILES += \
+	$(VALA_VAPI) \
+	$(VALA_CHEADER) \
+	$(NULL)
+
diff --git a/plugins/autotools-templates/autotools_templates/resources/valalib_introspection.mk b/plugins/autotools-templates/autotools_templates/resources/valalib_introspection.mk
new file mode 100644
index 0000000..6c09afe
--- /dev/null
+++ b/plugins/autotools-templates/autotools_templates/resources/valalib_introspection.mk
@@ -0,0 +1,50 @@
+# vala.mk
+# Copyright (C) 2015  Daniel Espinosa <esodan@gmail.com>
+#
+# 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, see <http://www.gnu.org/licenses/>.
+#
+# Authors:
+#      Daniel Espinosa <esodan@gmail.com>
+#
+#
+# GObject Introspection should be optional and included in a if HAVE_INTROSPECTION
+# in Makefile.am file. For generate you should use --enable-instrospection switch
+# on configure and define INTROSPECTION_GIRS and INTROSPECTION_TYPELIBS.
+# VALA_TARGET should be set to a library.
+
+
+### GObject Introspection
+# dlname:
+#   Extract our dlname like libfolks does, see bgo#658002 and bgo#585116
+#   This is what g-ir-scanner does.
+dlname=\
+	`$(SED) -nE "s/^dlname='([A-Za-z0-9.+-]+)'/\1/p" $(VALA_TARGET)`
+
+VALAFLAGS += \
+	--gir=$(INTROSPECTION_GIRS) \
+	$(NULL)
+
+INTROSPECTION_COMPILER_ARGS = --includedir=. -l $(dlname)
+
+$(INTROSPECTION_GIRS): $(VALA_TARGET)
+
+$(INTROSPECTION_TYPELIBS): $(INTROSPECTION_GIRS)
+	$(INTROSPECTION_COMPILER) $(INTROSPECTION_COMPILER_ARGS) $< -o $@
+
+girdir = $(INTROSPECTION_GIRDIR)
+gir_DATA = $(INTROSPECTION_GIRS)
+typelibdir = $(INTROSPECTION_TYPELIBDIR)
+typelib_DATA = $(INTROSPECTION_TYPELIBS)
+CLEANFILES += $(gir_DATA) $(typelib_DATA)
+
