Search in sources :

Example 11 with CeylonDocTool

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

the class DocToolTests method testDocMultiple.

@Test
public void testDocMultiple() throws Exception {
    ToolModel<CeylonDocTool> model = pluginLoader.loadToolModel("doc");
    Assert.assertNotNull(model);
    CeylonDocTool tool = pluginFactory.bindArguments(model, getMainTool(), options("--src=test/src", "com.redhat.ceylon.tools.test.multiple.*"));
    tool.run();
}
Also used : CeylonDocTool(com.redhat.ceylon.ceylondoc.CeylonDocTool) Test(org.junit.Test)

Example 12 with CeylonDocTool

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

the class DocToolTests method testDocSourceCode.

@Test
public void testDocSourceCode() throws Exception {
    ToolModel<CeylonDocTool> model = pluginLoader.loadToolModel("doc");
    Assert.assertNotNull(model);
    CeylonDocTool tool = pluginFactory.bindArguments(model, getMainTool(), options("--source-code", "--src=test/src", "com.redhat.ceylon.tools.test.ceylon"));
    tool.run();
}
Also used : CeylonDocTool(com.redhat.ceylon.ceylondoc.CeylonDocTool) Test(org.junit.Test)

Example 13 with CeylonDocTool

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

the class CeylonDocToolTests method documentSingleModule.

@Test
public void documentSingleModule() throws Exception {
    String pathname = "test/ceylondoc";
    String moduleName = "com.redhat.ceylon.ceylondoc.test.modules.multi.a";
    CeylonDocTool tool = tool(pathname, moduleName, true, "build/ceylon-cars");
    tool.run();
    Module a = makeModule("com.redhat.ceylon.ceylondoc.test.modules.multi.a", "1");
    File destDirA = getOutputDir(tool, a);
    Module b = makeModule("com.redhat.ceylon.ceylondoc.test.modules.multi.b", "1");
    File destDirB = getOutputDir(tool, b);
    Module def = makeDefaultModule();
    File destDirDef = getOutputDir(tool, def);
    assertFileExists(destDirA, "index.html");
    assertFileNotExists(destDirB, "index.html");
    assertFileNotExists(destDirDef, "index.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 14 with CeylonDocTool

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

the class CeylonDocToolTests method ceylonSdk.

@Test
public void ceylonSdk() throws Exception {
    File sdkDir = new File("../ceylon-sdk");
    if (!sdkDir.exists() || !sdkDir.isDirectory()) {
        Assert.fail("You don't have ceylon-sdk checked out at " + sdkDir.getAbsolutePath() + " so this test doesn't apply");
    }
    String[] fullModuleNames = { "ceylon.collection", "ceylon.dbc", "ceylon.file", "ceylon.html", "ceylon.interop.java", "ceylon.io", "ceylon.locale", "ceylon.logging", "ceylon.json", "ceylon.math", "ceylon.net", "ceylon.process", "ceylon.promise", "ceylon.regex", "ceylon.test", "ceylon.time", "ceylon.transaction", "ceylon.unicode" };
    compileSdkJavaFiles();
    CeylonDocTool tool = tool(Arrays.asList(new File("../ceylon-sdk/source")), Collections.<File>emptyList(), Arrays.asList(fullModuleNames), true, false, false);
    tool.setIncludeNonShared(false);
    tool.setIncludeSourceCode(true);
    tool.run();
    Map<String, String> nameToVersion = new HashMap<String, String>();
    for (Module module : tool.getDocumentedModules()) {
        nameToVersion.put(module.getNameAsString(), module.getVersion());
    }
    for (String moduleName : fullModuleNames) {
        Module module = makeModule(moduleName, nameToVersion.get(moduleName));
        File destDir = getOutputDir(tool, module);
        assertFileExists(destDir, "index.html");
    }
}
Also used : CeylonDocTool(com.redhat.ceylon.ceylondoc.CeylonDocTool) HashMap(java.util.HashMap) Module(com.redhat.ceylon.model.typechecker.model.Module) File(java.io.File) Test(org.junit.Test)

Example 15 with CeylonDocTool

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

the class CeylonDocToolTests method bug1975.

@Test
public void bug1975() throws Exception {
    File dir = new File("build", "CeylonDocToolTest/" + name.getMethodName());
    String pathname = "test/ceylondoc";
    String moduleName = "com.redhat.ceylon.ceylondoc.test.modules.bug1975";
    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)

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