[Galago-commits] r2673 - in trunk/galago-sharp: . galago tests

galago-commits at freedesktop.org galago-commits at freedesktop.org
Wed Apr 5 01:04:23 PDT 2006


Author: chipx86
Date: 2006-04-05 01:04:20 -0700 (Wed, 05 Apr 2006)
New Revision: 2673

Added:
   trunk/galago-sharp/tests/unit-tests.cs
Modified:
   trunk/galago-sharp/ChangeLog
   trunk/galago-sharp/configure.ac
   trunk/galago-sharp/galago/Global.custom
   trunk/galago-sharp/tests/
   trunk/galago-sharp/tests/Makefile.am
Log:
- Wrap galago_uninit().
- Add support for unit tests.


Modified: trunk/galago-sharp/ChangeLog
===================================================================
--- trunk/galago-sharp/ChangeLog	2006-04-05 07:40:36 UTC (rev 2672)
+++ trunk/galago-sharp/ChangeLog	2006-04-05 08:04:20 UTC (rev 2673)
@@ -1,3 +1,12 @@
+Wed Apr 05 01:02:36 PDT 2006  Christian Hammond <chipx86 at chipx86.com>
+
+	* galago/Global.custom:
+	* tests/Makefile.am:
+	A tests/unit-tests.cs:
+	* configure.ac:
+	  - Wrap galago_uninit().
+	  - Add support for unit tests.
+
 Wed Apr 05 00:40:13 PDT 2006  Christian Hammond <chipx86 at chipx86.com>
 
 	* autogen.sh:

Modified: trunk/galago-sharp/configure.ac
===================================================================
--- trunk/galago-sharp/configure.ac	2006-04-05 07:40:36 UTC (rev 2672)
+++ trunk/galago-sharp/configure.ac	2006-04-05 08:04:20 UTC (rev 2673)
@@ -115,6 +115,16 @@
 	AC_MSG_ERROR([No gacutil tool found])
 fi
 
+dnl Check for the NUnit testing framework
+have_nunit="yes"
+AC_PATH_PROG(NUNIT, nunit-console)
+AC_PATH_PROG(XSLTPROC, xsltproc)
+if test "x$NUNIT" = "x" -o "x$XSLTPROC" = "x"; then
+	AC_MSG_WARN([Can't find NUnit and xsltproc. You will not be able to run unit tests])
+	have_nunit="no"
+fi
+AM_CONDITIONAL(HAVE_NUNIT, test "$have_nunit" = "yes")
+
 AC_SUBST(RUNTIME)
 AC_SUBST(CSC)
 AC_SUBST(LIB_PREFIX)

Modified: trunk/galago-sharp/galago/Global.custom
===================================================================
--- trunk/galago-sharp/galago/Global.custom	2006-04-05 07:40:36 UTC (rev 2672)
+++ trunk/galago-sharp/galago/Global.custom	2006-04-05 08:04:20 UTC (rev 2673)
@@ -14,6 +14,14 @@
 			return Init(name, Galago.InitFlags.Client);
 		}
 
+		[DllImport("libgalago")]
+		static extern void galago_uninit();
+
+		public static void Uninit()
+		{
+			galago_uninit();
+		}
+
 		public static Galago.Person GetMe(Galago.Origin origin)
 		{
 			return GetMe(origin, true);


Property changes on: trunk/galago-sharp/tests
___________________________________________________________________
Name: svn:ignore
   - Makefile.in
Makefile
*.exe
.*.swp

   + Makefile.in
Makefile
TestResult.xml
*.dll
*.exe
.*.swp


Modified: trunk/galago-sharp/tests/Makefile.am
===================================================================
--- trunk/galago-sharp/tests/Makefile.am	2006-04-05 07:40:36 UTC (rev 2672)
+++ trunk/galago-sharp/tests/Makefile.am	2006-04-05 08:04:20 UTC (rev 2673)
@@ -8,20 +8,30 @@
 	get-presence.exe \
 	presence-feed.exe
 
+if HAVE_NUNIT
+TARGETS += unit-tests.dll
+
+run-tests: unit-tests.dll
+	$(NUNIT) unit-tests.dll
+endif
+
 noinst_SCRIPTS = $(TARGETS)
 
 all: $(TARGETS)
 
-get-presence.exe: get-presence.cs $(ASSEMBLIES)
+.cs.exe: $(ASSEMBLIES)
 	$(CSC) /out:$@ $(REFERENCES) $(srcdir)/$<
 
-presence-feed.exe: presence-feed.cs $(ASSEMBLIES)
-	$(CSC) /out:$@ $(REFERENCES) $(srcdir)/$<
+unit-tests.dll: unit-tests.cs $(ASSEMBLIES)
+	$(CSC) /out:$@ /target:library $(REFERENCES) -pkg:nunit $(srcdir)/$<
 
 EXTRA_DIST = \
 	get-presence.cs \
 	monitor.cs \
-	presence-feed.cs
+	presence-feed.cs \
+	unit-tests.cs
 
-CLEANFILES = $(TARGETS)
+CLEANFILES = \
+	$(TARGETS) \
+	TestResult.xml
 

Added: trunk/galago-sharp/tests/unit-tests.cs
===================================================================
--- trunk/galago-sharp/tests/unit-tests.cs	2006-04-05 07:40:36 UTC (rev 2672)
+++ trunk/galago-sharp/tests/unit-tests.cs	2006-04-05 08:04:20 UTC (rev 2673)
@@ -0,0 +1,16 @@
+namespace Galago.Tests
+{
+	using NUnit.Framework;
+
+	[TestFixture]
+	public class InitTest
+	{
+		[Test]
+		public void TestInitReinit()
+		{
+			Assert.IsTrue(Galago.Global.Init("check-galago-sharp"));
+			Galago.Global.Uninit();
+			Assert.IsTrue(Galago.Global.Init("check-galago-sharp"));
+		}
+	}
+}



More information about the galago-commits mailing list