Hi,

I've extended gst-sunit to run sunit with a package description file
thanks to the Holger patch.

Cheers,
Gwen

>From 28855ff5d6e4dea4a49bce88917c3db484a077e5 Mon Sep 17 00:00:00 2001
From: Gwenael Casaccio <mrg...@gmail.com>
Date: Mon, 1 Jul 2013 13:54:18 +0200
Subject: [PATCH] gst-sunit can load package.xml files with the -p option

---
 ChangeLog            | 5 +++++
 kernel/DirPackage.st | 2 ++
 scripts/Test.st      | 4 +++-
 3 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 6849558..3c2a4f5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2013-07-01  Gwenael Casaccio <gwenael.casac...@gmail.com>
+
+        * kernel/DirPackage.st: Return the loaded package.
+        * scripts/Test.st: Load a package from the package.xml file.
+
 2013-05-20  Holger Hans Peter Freyther  <hol...@moiji-mobile.com>
 
 	* configure.ac: Add --enable-postgres-tests.
diff --git a/kernel/DirPackage.st b/kernel/DirPackage.st
index d807ab0..416cdd8 100644
--- a/kernel/DirPackage.st
+++ b/kernel/DirPackage.st
@@ -88,5 +88,7 @@ PackageLoader class extend [
         attempt to load the package by name."
         self fileInPackages: package prerequisites.
         package primFileIn.
+
+        ^ package
     ]
 ]
diff --git a/scripts/Test.st b/scripts/Test.st
index 2cb2fd7..7d5b07e 100644
--- a/scripts/Test.st
+++ b/scripts/Test.st
@@ -83,7 +83,9 @@ Smalltalk
     opt = 'package' ifTrue: [
 	[
 	    | pkg |
-	    pkg := PackageLoader packageAt: arg.
+            (arg endsWith: '.xml') 
+                ifTrue: [ pkg := PackageLoader loadPackageFromFile: Directory working / arg ]
+                ifFalse: [ pkg := PackageLoader packageAt: arg ].
 	    script := script, ' ', pkg sunitScript.
 	    pkg test notNil ifTrue: [
 		pkg := pkg test.
-- 
1.8.1.2

_______________________________________________
help-smalltalk mailing list
help-smalltalk@gnu.org
https://lists.gnu.org/mailman/listinfo/help-smalltalk

Reply via email to