test/org/openjdk/jigsaw/tester.sh

Print this page

        

@@ -101,10 +101,11 @@
     efile = toPath(tdir, "expected");
     print e >efile;
     close(efile);
     msdir = toPath(tdir, "src");
     mkdir(msdir);
+    moduleclassFound = 0;
   }
 
   /^module / {
     module = $2;
     mname = module;

@@ -145,12 +146,17 @@
   }
 
   /^./ {
     if (module) {
       print $0 >>mfile;
-      if (match($0, /^ +class +([a-zA-Z.]+) *;/)) print module >toPath(tdir, "main");
+      if (match($0, /^ +class +([a-zA-Z.]+) *;/)) {
+          if (moduleclassFound == 0) {
+              print module >toPath(tdir, "main");
+              moduleclassFound = 1;
     }
+      }
+    }
     if (class) print $0 >>cfile;
     next;
   }
 
   /^#?$/ { module = 0; class = 0; }

@@ -242,13 +248,15 @@
   pdir=`echo $BIN | cut -c1-3`
   if [ -z "$TESTSRC" -a "$pdir" = "../" ]; then
     BIN=../$BIN;
   fi
   for t in *; do
+    if [ -d $t ] ; then
     cd $t
     run `echo $t | cut -c4-` || /bin/true
     cd ..
+    fi
   done
 fi
 
 if [ $tests -gt 1 ]; then
   echo