コード例 #1
0
ファイル: JetResolveTest.java プロジェクト: JamesOSi/kotlin
 public static Test suite() {
   //        TestSuite suite = new TestSuite();
   //        suite.addTest(new JetResolveTest("/resolve/Basic.jet", "basic"));
   //        return suite;
   return JetTestCaseBuilder.suiteForDirectory(
       getHomeDirectory() + "/compiler/testData/",
       "/resolve/",
       true,
       new JetTestCaseBuilder.NamedTestFactory() {
         @NotNull
         @Override
         public Test createTest(
             @NotNull String dataPath, @NotNull String name, @NotNull File file) {
           return new JetResolveTest(dataPath + "/" + name + ".jet", name);
         }
       });
 }
コード例 #2
0
  public static Test suite() {
    // setFilter(); //to launch only part of tests
    TestSuite suite = new TestSuite();

    FilenameFilter singleFileNameFilter =
        new FilenameFilter() {
          @Override
          public boolean accept(File file, String s) {
            return s.startsWith("before") && !JetPsiCheckerMultifileTest.isMultiFileName(s);
          }
        };

    JetTestCaseBuilder.NamedTestFactory singleFileNamedTestFactory =
        new JetTestCaseBuilder.NamedTestFactory() {
          @NotNull
          @Override
          public Test createTest(
              @NotNull String dataPath, @NotNull String name, @NotNull File file) {
            return new JetQuickFixTest(dataPath, name);
          }
        };

    File dir = new File(getTestDataPathBase());
    List<String> subDirs =
        Arrays.asList(quickFixTestsFilter != null ? dir.list(quickFixTestsFilter) : dir.list());
    Collections.sort(subDirs);
    for (String subDirName : subDirs) {
      final TestSuite singleFileTestSuite =
          JetTestCaseBuilder.suiteForDirectory(
              getTestDataPathBase(),
              subDirName,
              true,
              singleFileNameFilter,
              singleFileNamedTestFactory);
      if (singleFileTestSuite.countTestCases() != 0) {
        suite.addTest(singleFileTestSuite);
      }
    }
    return suite;
  }
コード例 #3
0
 public static String getTestDataPathBase() {
   return JetTestCaseBuilder.getHomeDirectory() + "/idea/testData/quickfix/";
 }
コード例 #4
0
 @Override
 protected String getTestDataPath() {
   return JetTestCaseBuilder.getTestDataPathBase();
 }
コード例 #5
0
 @Override
 protected String getTestDataPath() {
   return JetTestCaseBuilder.getHomeDirectory() + "/idea/testData/kotlinAndJavaChecker/";
 }