[longomatch] Add the tests infrastructure to the build system
- From: Andoni Morales Alastruey <amorales src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [longomatch] Add the tests infrastructure to the build system
- Date: Fri, 27 Feb 2015 10:31:31 +0000 (UTC)
commit e0365f4d55403a1884dd89a85fc5a9dc8b9e7944
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date: Thu Feb 26 21:44:33 2015 +0100
Add the tests infrastructure to the build system
.gitignore | 1 +
Makefile.am | 4 ++++
Tests/Makefile.am | 16 +++++++++++++---
build/build.environment.mk | 5 +++++
build/build.rules.mk | 5 -----
build/m4/shamrock/nunit.m4 | 2 +-
configure.ac | 3 +--
7 files changed, 25 insertions(+), 11 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index b27c945..ecbbaf7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -68,5 +68,6 @@ po/stamp-it
po/.intltool-merge-cache
tools/deb-pkg.sh
*test-results/
+*test-results.xml
*.pc
oneplay-longomatch
diff --git a/Makefile.am b/Makefile.am
index d9fe987..26c00ba 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -29,6 +29,10 @@ if WITH_MIGRATION_TOOL
SUBDIRS += LongoMatch.Migration
endif
+if ENABLE_TESTS
+SUBDIRS += Tests
+endif
+
DISTCLEANFILES = intltool-extract\
intltool-merge\
intltool-update
diff --git a/Tests/Makefile.am b/Tests/Makefile.am
index 89bbd00..51dc108 100644
--- a/Tests/Makefile.am
+++ b/Tests/Makefile.am
@@ -1,6 +1,16 @@
-
ASSEMBLY = Tests
-TARGET = Exe
+TARGET = library
+
+LINK = $(REF_DEP_TESTS)
+
+SOURCES = Core/TestTime.cs \
+ Core/TestTimeNode.cs \
+ Core/TestTimelineEvent.cs \
+ Utils.cs
+
+RESOURCES =
-LINK = $(REF_DEP_LONGOMATCH_ADDINS)
+include $(top_srcdir)/build/build.mk
+check:
+ nunit-console $(ASSEMBLY_FILE) --result=$(ASSEMBLY)-test-results.xml
diff --git a/build/build.environment.mk b/build/build.environment.mk
index 531ee23..870aeaa 100644
--- a/build/build.environment.mk
+++ b/build/build.environment.mk
@@ -21,6 +21,7 @@ LINK_GTK = $(GTKSHARP_LIBS)
LINK_GCONF = $(GCONFSHARP_LIBS)
LINK_DB40 = $(DB4O_LIBS)
LINK_JSON = $(JSON_LIBS)
+LINK_NUNIT = $(NUNIT_LIBS)
LINK_OSXYPLOT = -r:$(DIR_BIN)/OxyPlotMono.dll
LINK_LONGOMATCH_ADDINS = -r:$(DIR_BIN)/LongoMatch.Addins.dll
LINK_LONGOMATCH_CORE = -r:$(DIR_BIN)/LongoMatch.Core.dll
@@ -166,6 +167,10 @@ REF_DEP_LONGOMATCH_PLUGINS_STATS = \
$(LINK_LONGOMATCH_ADDINS)
+REF_DEP_TESTS = \
+ $(LINK_LONGOMATCH_CORE) \
+ $(LINK_LONGOMATCH_SERVICES) \
+ $(LINK_NUNIT)
DIR_BIN = $(top_builddir)/bin
diff --git a/build/build.rules.mk b/build/build.rules.mk
index ad68685..05c8095 100644
--- a/build/build.rules.mk
+++ b/build/build.rules.mk
@@ -19,11 +19,6 @@ ASSEMBLY_FILE := $(top_builddir)/$(BUILD_DIR_RESOLVED)/$(ASSEMBLY).$(ASSEMBLY_EX
INSTALL_DIR_RESOLVED = $(firstword $(subst , $(DEFAULT_INSTALL_DIR), $(INSTALL_DIR)))
-if ENABLE_TESTS
- LINK += " $(NUNIT_LIBS)"
- ENABLE_TESTS_FLAG = "-define:ENABLE_TESTS"
-endif
-
FILTERED_LINK = $(shell echo "$(LINK)" | $(UNIQUE_FILTER_PIPE))
DEP_LINK = $(shell echo "$(LINK)" | $(UNIQUE_FILTER_PIPE) | sed s,-r:,,g | grep '$(top_builddir)/bin/')
diff --git a/build/m4/shamrock/nunit.m4 b/build/m4/shamrock/nunit.m4
index 4d57d00..14d0107 100644
--- a/build/m4/shamrock/nunit.m4
+++ b/build/m4/shamrock/nunit.m4
@@ -3,7 +3,7 @@ AC_DEFUN([SHAMROCK_CHECK_NUNIT],
NUNIT_REQUIRED=2.4.7
AC_ARG_ENABLE(tests, AC_HELP_STRING([--enable-tests], [Enable NUnit tests]),
- enable_tests=$enableval, enable_tests="no")
+ enable_tests=$enableval, enable_tests="yes")
if test "x$enable_tests" = "xno"; then
do_tests=no
diff --git a/configure.ac b/configure.ac
index e12740f..a85c7ef 100644
--- a/configure.ac
+++ b/configure.ac
@@ -112,8 +112,6 @@ AM_CONDITIONAL(OSTYPE_LINUX, test x$ostype = xLinux)
AC_SUBST(GMCS_FLAGS, ["$GMCS_FLAGS"])
AC_MSG_RESULT($ostype)
-AM_CONDITIONAL(ENABLE_TESTS, test x = y)
-
dnl package checks, per config
AC_CONFIG_FILES([env], [chmod +x env])
@@ -153,6 +151,7 @@ LongoMatch/Makefile
LongoMatch/longomatch
LongoMatch/longomatch.desktop.in
LongoMatch/AssemblyInfo.cs
+Tests/Makefile
tools/deb-pkg.sh
data/Makefile
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]