nitc/loader: filter_nit_source accept directories
authorJean Privat <jean@pryen.org>
Fri, 13 May 2016 01:14:06 +0000 (21:14 -0400)
committerJean Privat <jean@pryen.org>
Fri, 13 May 2016 01:14:06 +0000 (21:14 -0400)
so `nitunit lib/` will test all the package of the `lib/` directory

Signed-off-by: Jean Privat <jean@pryen.org>

src/loader.nit

index 6df4d61..b8572a4 100644 (file)
@@ -612,6 +612,11 @@ redef class ModelBuilder
                var keep = new Array[String]
                var res = new Array[String]
                for a in args do
+                       var stat = a.to_path.stat
+                       if stat != null and stat.is_dir then
+                               res.add a
+                               continue
+                       end
                        var l = identify_module(a)
                        if l == null then
                                keep.add a