Permalink
Browse files

2008-09-22 Stephane Delcroix <sdelcroix@novell.com>

	* configure.ac:
	* Makefile.am:
	* tests/*: some unit tests, new "test" top level target

svn path=/trunk/exiv2-sharp/; revision=113691
  • Loading branch information...
1 parent a197b78 commit e49bf1ea1d4ea12d6fa70b024bd5c65eecee3424 Stephane Delcroix committed Sep 22, 2008
Showing with 87 additions and 0 deletions.
  1. +6 −0 ChangeLog
  2. +7 −0 Makefile.am
  3. +2 −0 configure.ac
  4. +2 −0 tests/Makefile.am
  5. BIN tests/data/alex.jpg
  6. +46 −0 tests/src/ImageFactory.cs
  7. +24 −0 tests/src/Makefile.am
View
6 ChangeLog
@@ -1,3 +1,9 @@
+2008-09-22 Stephane Delcroix <sdelcroix@novell.com>
+
+ * configure.ac:
+ * Makefile.am:
+ * tests/*: some unit tests, new "test" top level target
+
2008-09-19 Stephane Delcroix <sdelcroix@novell.com>
* configure.ac: depend on exiv2 0.18 as the ExifThumb API changed
View
7 Makefile.am
@@ -5,3 +5,10 @@ SUBDIRS = \
sources \
exiv2 \
samples
+
+DIST_SUBDIRS = \
+ $(SUBDIRS) \
+ tests
+
+test:
+ $(MAKE) -C tests
View
2 configure.ac
@@ -20,4 +20,6 @@ glue/Makefile
sources/Makefile
samples/Makefile
docs/Makefile
+tests/Makefile
+tests/src/Makefile
)
View
2 tests/Makefile.am
@@ -0,0 +1,2 @@
+SUBDIRS= \
+ src
View
BIN tests/data/alex.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
46 tests/src/ImageFactory.cs
@@ -0,0 +1,46 @@
+using NUnit.Framework;
+using System;
+using System.IO;
+using Exiv2;
+
+namespace Exiv2.Tests
+{
+ [TestFixture]
+ public class ImageFactoryTests
+ {
+
+ string [] images = {
+ "alex.jpg",
+ };
+
+ [SetUp]
+ public void SetUp ()
+ {
+ GLib.GType.Init ();
+ foreach (string image in images)
+ File.Copy ("../data/" + image, "./" + image, true);
+ }
+
+ [TearDown]
+ public void TearDown ()
+ {
+ foreach (string image in images)
+ try {
+ File.Delete ("./" + image);
+ } catch {}
+ }
+
+ [Test]
+ public void OpenPath ()
+ {
+ foreach (string image in images)
+ OpenPath (image);
+ }
+
+ void OpenPath (string file)
+ {
+ Image image = ImageFactory.Open ("./" + file);
+ Assert.IsTrue (image.Good, String.Format ("Exiv2.Image.Good returned false for {0}", file));
+ }
+ }
+}
View
24 tests/src/Makefile.am
@@ -0,0 +1,24 @@
+all: run-tests
+
+TESTASSEMBLY = exiv2.tests.dll
+
+SOURCES = \
+ *.cs
+
+PKGS = \
+ -pkg:mono-nunit \
+ -pkg:glib-sharp-2.0
+
+REFS = \
+ -r:$(top_builddir)/exiv2/exiv2-sharp.dll
+
+FLAGS = -t:library
+
+$(TESTASSEMBLY): $(SOURCES)
+ gmcs $(FLAGS) $(PKGS) $(REFS) $(SOURCES) -out:$@
+
+run-tests: $(TESTASSEMBLY)
+ MONO_PATH=$(top_builddir)/exiv2/ LD_LIBRARY_PATH=$(top_builddir)/glue/.libs/ nunit-console2 $(TESTASSEMBLY)
+
+EXTRA_DIST = \
+ $(SOURCES)

0 comments on commit e49bf1e

Please sign in to comment.