test/nashorn/src/jdk/nashorn/internal/test/framework/TestFinder.java
changeset 47217 72e3ae9a25eb
parent 47216 71c04702a3d5
equal deleted inserted replaced
47216:71c04702a3d5 47217:72e3ae9a25eb
   114             }
   114             }
   115         }
   115         }
   116         if (testList == null || testList.length() == 0) {
   116         if (testList == null || testList.length() == 0) {
   117             // Run the tests under the test roots dir, selected by the
   117             // Run the tests under the test roots dir, selected by the
   118             // TEST_JS_INCLUDES patterns
   118             // TEST_JS_INCLUDES patterns
   119             final String testRootsString = System.getProperty(TEST_JS_ROOTS, "test/script");
   119             final String testRootsString = System.getProperty(TEST_JS_ROOTS, "test/nashorn/script");
   120             if (testRootsString == null || testRootsString.length() == 0) {
   120             if (testRootsString == null || testRootsString.length() == 0) {
   121                 throw new Exception("Error: " + TEST_JS_ROOTS + " must be set");
   121                 throw new Exception("Error: " + TEST_JS_ROOTS + " must be set");
   122             }
   122             }
   123             final String testRoots[] = testRootsString.split(" ");
   123             final String testRoots[] = testRootsString.split(" ");
   124             final FileSystem fileSystem = FileSystems.getDefault();
   124             final FileSystem fileSystem = FileSystems.getDefault();
   157         final List<String> excludedActualTests = new ArrayList<>();
   157         final List<String> excludedActualTests = new ArrayList<>();
   158 
   158 
   159         if (!dir.toFile().isDirectory()) {
   159         if (!dir.toFile().isDirectory()) {
   160             factory.log("WARNING: " + dir + " not found or not a directory");
   160             factory.log("WARNING: " + dir + " not found or not a directory");
   161         }
   161         }
       
   162 
   162 
   163 
   163         Files.walkFileTree(dir, EnumSet.of(FileVisitOption.FOLLOW_LINKS), Integer.MAX_VALUE, new SimpleFileVisitor<Path>() {
   164         Files.walkFileTree(dir, EnumSet.of(FileVisitOption.FOLLOW_LINKS), Integer.MAX_VALUE, new SimpleFileVisitor<Path>() {
   164             @Override
   165             @Override
   165             public FileVisitResult visitFile(final Path file, final BasicFileAttributes attrs) throws IOException {
   166             public FileVisitResult visitFile(final Path file, final BasicFileAttributes attrs) throws IOException {
   166                 final String fileName = file.getName(file.getNameCount() - 1).toString();
   167                 final String fileName = file.getName(file.getNameCount() - 1).toString();
   189         if (exceptions[0] != null) {
   190         if (exceptions[0] != null) {
   190             throw exceptions[0];
   191             throw exceptions[0];
   191         }
   192         }
   192     }
   193     }
   193 
   194 
   194     private static final String uncheckedDirs[] = System.getProperty(TEST_JS_UNCHECKED_DIR, "test/script/external/test262/").split(" ");
   195     private static final String uncheckedDirs[] = System.getProperty(TEST_JS_UNCHECKED_DIR, "test/nashorn/script/external/test262/").split(" ");
   195 
   196 
   196     private static boolean isUnchecked(final Path testFile) {
   197     private static boolean isUnchecked(final Path testFile) {
   197         for (final String uncheckedDir : uncheckedDirs) {
   198         for (final String uncheckedDir : uncheckedDirs) {
   198             if (testFile.startsWith(uncheckedDir)) {
   199             if (testFile.startsWith(uncheckedDir)) {
   199                 return true;
   200                 return true;
   445             testExcludeSet.add(testIds.item(i).getNodeValue());
   446             testExcludeSet.add(testIds.item(i).getNodeValue());
   446         }
   447         }
   447     }
   448     }
   448 
   449 
   449     private static Path[] getExcludeDirs() {
   450     private static Path[] getExcludeDirs() {
   450         final String excludeDirs[] = System.getProperty(TEST_JS_EXCLUDE_DIR, "test/script/currently-failing").split(" ");
   451         final String excludeDirs[] = System.getProperty(TEST_JS_EXCLUDE_DIR, "test/nashorn/script/currently-failing").split(" ");
   451         final Path[] excludePaths = new Path[excludeDirs.length];
   452         final Path[] excludePaths = new Path[excludeDirs.length];
   452         final FileSystem fileSystem = FileSystems.getDefault();
   453         final FileSystem fileSystem = FileSystems.getDefault();
   453         int i = 0;
   454         int i = 0;
   454         for (final String excludeDir : excludeDirs) {
   455         for (final String excludeDir : excludeDirs) {
   455             excludePaths[i++] = fileSystem.getPath(excludeDir);
   456             excludePaths[i++] = fileSystem.getPath(excludeDir);