Search in sources :

Example 16 with CeylonDocTool

use of com.redhat.ceylon.ceylondoc.CeylonDocTool in project ceylon-compiler by ceylon.

the class CeylonDocToolTests method ceylonLanguage.

@Test
public void ceylonLanguage() throws Exception {
    String pathname = "../ceylon.language/src";
    String moduleName = AbstractModelLoader.CEYLON_LANGUAGE;
    CeylonDocTool tool = tool(pathname, moduleName, true, true);
    tool.setIncludeNonShared(false);
    tool.setIncludeSourceCode(true);
    tool.run();
    Module module = makeModule(AbstractModelLoader.CEYLON_LANGUAGE, LANGUAGE_MODULE_VERSION);
    File destDir = getOutputDir(tool, module);
    assertFileExists(destDir, "index.html");
    assertFileExists(destDir, "Nothing.type.html");
}
Also used : CeylonDocTool(com.redhat.ceylon.ceylondoc.CeylonDocTool) Module(com.redhat.ceylon.model.typechecker.model.Module) File(java.io.File) Test(org.junit.Test)

Example 17 with CeylonDocTool

use of com.redhat.ceylon.ceylondoc.CeylonDocTool in project ceylon-compiler by ceylon.

the class CeylonDocToolTests method bug1622.

@Test
public void bug1622() throws Exception {
    File dir = new File("build", "CeylonDocToolTest/" + name.getMethodName());
    String pathname = "test/ceylondoc";
    String moduleName = "com.redhat.ceylon.ceylondoc.test.modules.bug1622";
    compile(pathname, dir.getPath(), moduleName);
    CeylonDocTool tool = tool(Arrays.asList(new File(pathname)), Arrays.asList(new File("doc")), Arrays.asList(moduleName), true, false, false);
    tool.setIncludeNonShared(true);
    tool.run();
}
Also used : CeylonDocTool(com.redhat.ceylon.ceylondoc.CeylonDocTool) File(java.io.File) Test(org.junit.Test)

Example 18 with CeylonDocTool

use of com.redhat.ceylon.ceylondoc.CeylonDocTool in project ceylon-compiler by ceylon.

the class CeylonDocToolTests method bug2346.

@Test
public void bug2346() throws Exception {
    String pathname = "test/ceylondoc";
    String moduleName = "com.redhat.ceylon.ceylondoc.test.modules.bug2346";
    Module module = new Module();
    module.setName(Arrays.asList(moduleName));
    module.setVersion("1");
    CeylonDocTool tool = tool(Arrays.asList(new File(pathname)), Arrays.asList(new File("doc")), Arrays.asList(moduleName), true, false, false);
    tool.run();
}
Also used : CeylonDocTool(com.redhat.ceylon.ceylondoc.CeylonDocTool) Module(com.redhat.ceylon.model.typechecker.model.Module) File(java.io.File) Test(org.junit.Test)

Example 19 with CeylonDocTool

use of com.redhat.ceylon.ceylondoc.CeylonDocTool in project ceylon-compiler by ceylon.

the class CeylonDocToolTests method bug2285.

@Test
public void bug2285() throws Exception {
    String pathname = "test/ceylondoc-doesnotexist";
    String moduleName = "com.redhat.ceylon.ceylondoc.test.modules.bug2285";
    Module module = new Module();
    module.setName(Arrays.asList(moduleName));
    module.setVersion("1");
    try {
        CeylonDocTool tool = tool(Arrays.asList(new File(pathname)), Arrays.asList(new File("doc")), Arrays.asList(moduleName), true, false, false);
        tool.run();
        Assert.fail();
    } catch (RuntimeException x) {
        Assert.assertEquals("Can't find module: com.redhat.ceylon.ceylondoc.test.modules.bug2285", x.getMessage());
    }
}
Also used : CeylonDocTool(com.redhat.ceylon.ceylondoc.CeylonDocTool) Module(com.redhat.ceylon.model.typechecker.model.Module) File(java.io.File) Test(org.junit.Test)

Example 20 with CeylonDocTool

use of com.redhat.ceylon.ceylondoc.CeylonDocTool in project ceylon-compiler by ceylon.

the class CeylonDocToolTests method bug2101.

@Test
public void bug2101() throws Exception {
    String pathname = "test/ceylondoc";
    String moduleName = "com.redhat.ceylon.ceylondoc.test.modules.bug2101";
    Module module = new Module();
    module.setName(Arrays.asList(moduleName));
    module.setVersion("1");
    CeylonDocTool tool = tool(Arrays.asList(new File(pathname)), Arrays.asList(new File("doc")), Arrays.asList(moduleName), true, false, false);
    tool.run();
    File destDir = getOutputDir(tool, module);
    assertMatchInFile(destDir, "index.html", Pattern.compile("<span class='identifier'>bug2101</span>\\(\\)</code>" + "<div class='description'><div class='doc section'><p>actual doc</p>"));
    assertMatchInFile(destDir, "a/index.html", Pattern.compile("<span class='identifier'>bug2101_wildcard_import</span>\\(\\)</code>" + "<div class='description'><div class='doc section'></div>" + "<div class='annotations section'><span class='title'>Annotations: </span><ul><li>doc\\(<span class='literal'>&quot;fake doc&quot;</span>\\)"));
}
Also used : CeylonDocTool(com.redhat.ceylon.ceylondoc.CeylonDocTool) Module(com.redhat.ceylon.model.typechecker.model.Module) File(java.io.File) Test(org.junit.Test)

Aggregations

CeylonDocTool (com.redhat.ceylon.ceylondoc.CeylonDocTool)21 Test (org.junit.Test)18 File (java.io.File)13 Module (com.redhat.ceylon.model.typechecker.model.Module)9 CeylonTool (com.redhat.ceylon.common.tools.CeylonTool)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1