@NotNull
 private File compileJava(@NotNull String libraryDir) throws Exception {
   List<File> allJavaFiles =
       FileUtil.findFilesByMask(JAVA_FILES, new File(getTestDataDirectory(), libraryDir));
   File result = new File(tmpdir, libraryDir);
   assert result.mkdirs() : "Could not create directory: " + result;
   KotlinTestUtils.compileJavaFiles(allJavaFiles, Arrays.asList("-d", result.getPath()));
   return result;
 }
예제 #2
0
 public static List<String> fileNamesMatching(String regexp, String path) {
   List<File> files = FileUtil.findFilesByMask(Pattern.compile(regexp), new File(path));
   return ContainerUtil.map(
       files,
       new Function<File, String>() {
         @Override
         public String fun(File it) {
           return it.getName();
         }
       });
 }
예제 #3
0
 @NotNull
 private Set<String> contentOfOutputDir(String moduleName) {
   String outputDir = "out/production/" + moduleName;
   File baseDir = new File(workDir, outputDir);
   List<File> files = FileUtil.findFilesByMask(Pattern.compile(".*"), baseDir);
   Set<String> result = new HashSet<String>();
   for (File file : files) {
     String relativePath = FileUtil.getRelativePath(baseDir, file);
     assert relativePath != null : "relativePath should not be null";
     result.add(toSystemIndependentName(relativePath));
   }
   return result;
 }
 public void testEunitFullErrorPath() {
   FileReferenceFilter compilationErrorFilter =
       new FileReferenceFilter(getProject(), EUNIT_ERROR_PATH);
   File base = new File(getProject().getBaseDir().getPath());
   File file =
       ContainerUtil.getFirstItem(FileUtil.findFilesByMask(Pattern.compile(".*\\.erl"), base));
   VirtualFile vFile = LocalFileSystem.getInstance().findFileByIoFile(file);
   assertNotNull(vFile);
   String canonicalPath = vFile.getCanonicalPath();
   final String consoleOutput =
       "in function bisect_server_test:'-false_test/0-fun-0-'/0 (" + canonicalPath + ", line 14)";
   final Filter.Result result =
       compilationErrorFilter.applyFilter(consoleOutput, consoleOutput.length());
   assertNotNull(result.hyperlinkInfo);
 }