Search in sources :

Example 1 with GccMemoryMapParser

use of net.praqma.jenkins.memorymap.parser.gcc.GccMemoryMapParser in project memory-map-plugin by Praqma.

the class GccMemoryMapParserIT method gcc432_testUsageValues.

@Test
public void gcc432_testUsageValues() throws Exception {
    MemoryMapGraphConfiguration graphConfiguration = new MemoryMapGraphConfiguration(".text+.rodata", "432");
    GccMemoryMapParser parser = createParser(graphConfiguration);
    parser.setMapFile("prom2_432.map");
    parser.setConfigurationFile("prom432.ld");
    HashMap<String, String> expectedValues = new HashMap<>();
    expectedValues.put(".text", "0x10a008");
    expectedValues.put(".rodata", "0x33fd7");
    TestUtils.testUsageValues(jenkins, parser, "gcc432.zip", expectedValues);
}
Also used : MemoryMapGraphConfiguration(net.praqma.jenkins.memorymap.graph.MemoryMapGraphConfiguration) HashMap(java.util.HashMap) GccMemoryMapParser(net.praqma.jenkins.memorymap.parser.gcc.GccMemoryMapParser) Test(org.junit.Test)

Example 2 with GccMemoryMapParser

use of net.praqma.jenkins.memorymap.parser.gcc.GccMemoryMapParser in project memory-map-plugin by Praqma.

the class GccMemoryMapParserIT method gcc482_testUsageValues.

@Test
public void gcc482_testUsageValues() throws Exception {
    MemoryMapGraphConfiguration graphConfiguration = new MemoryMapGraphConfiguration(".prom_text+.ram_data", "482");
    GccMemoryMapParser parser = createParser(graphConfiguration);
    parser.setMapFile("gcc482.map");
    parser.setConfigurationFile("prom482.ld");
    HashMap<String, String> expectedValues = new HashMap<>();
    expectedValues.put(".prom_text", "0x10cb70");
    expectedValues.put(".ram_data", "0x20c4");
    TestUtils.testUsageValues(jenkins, parser, "gcc482.zip", expectedValues);
}
Also used : MemoryMapGraphConfiguration(net.praqma.jenkins.memorymap.graph.MemoryMapGraphConfiguration) HashMap(java.util.HashMap) GccMemoryMapParser(net.praqma.jenkins.memorymap.parser.gcc.GccMemoryMapParser) Test(org.junit.Test)

Example 3 with GccMemoryMapParser

use of net.praqma.jenkins.memorymap.parser.gcc.GccMemoryMapParser in project memory-map-plugin by Praqma.

the class JENKINS_29052_IT method succeedsWithoutGraphs.

@Test
public void succeedsWithoutGraphs() throws Exception {
    GccMemoryMapParser parser = createParser();
    parser.setMapFile("gcc482.map");
    parser.setConfigurationFile("prom482.ld");
    FreeStyleProject project = TestUtils.createProject(jenkins);
    TestUtils.prepareProjectWorkspace(project, "gcc482.zip");
    TestUtils.setMemoryMapConfiguration(project, parser);
    FreeStyleBuild build = TestUtils.runNewBuild(project);
    TestUtils.printBuildConsoleLog(build, jenkins);
    jenkins.assertBuildStatus(Result.SUCCESS, build);
}
Also used : FreeStyleBuild(hudson.model.FreeStyleBuild) FreeStyleProject(hudson.model.FreeStyleProject) GccMemoryMapParser(net.praqma.jenkins.memorymap.parser.gcc.GccMemoryMapParser) Test(org.junit.Test)

Example 4 with GccMemoryMapParser

use of net.praqma.jenkins.memorymap.parser.gcc.GccMemoryMapParser in project memory-map-plugin by Praqma.

the class MemoryMapGccParserTest method testAssertCorrectExceptionThrown.

@Test
public void testAssertCorrectExceptionThrown() throws Exception {
    String illegalAmountOfMemory = "MEMORY/*" + "" + "" + "*/\n" + " {\n" + "  /* start comment */\n" + "  /* start line comment */ reserved1 (!A)  : ORIGIN = 0, LENGTH = 0xÅP\n" + "  application (rx) : ORIGIN = 0x100000, LENGTH = 2M\n" + "  reserved2 (!A)  : ORI/**/GIN = 0x03/* ***** */00000, LENGTH = 0x04ÅN /* COMMENT */\n" + "  ram (w)     : ORIGIN = 0x0800000, LENGTH = 2M /* 0x04FFFFF */\n" + "  /* more " + "comment */\n" + " }";
    thrown.expect(AbortException.class);
    thrown.expectMessage("Unable to convert 0xÅP to a valid hex string.");
    GccMemoryMapParser parser = new GccMemoryMapParser();
    parser.getMemory(illegalAmountOfMemory);
}
Also used : GccMemoryMapParser(net.praqma.jenkins.memorymap.parser.gcc.GccMemoryMapParser) Test(org.junit.Test)

Example 5 with GccMemoryMapParser

use of net.praqma.jenkins.memorymap.parser.gcc.GccMemoryMapParser in project memory-map-plugin by Praqma.

the class MemoryMapJobDslContext method parser.

public void parser(String parserType, String parserUniqueName, String commandFile, String mapFile, Runnable closure) {
    checkArgument(parserTypes.contains(parserType), "Parser type must be one of " + parserTypes);
    MemoryMapParserDslContext context = new MemoryMapParserDslContext();
    executeInContext(closure, context);
    AbstractMemoryMapParser parser = null;
    switch(parserType) {
        case "GCC":
            parser = new GccMemoryMapParser(parserUniqueName, mapFile, commandFile, wordSize, showBytesOnGraphs, context.graphConfigurations);
            break;
        case "TI":
            parser = new TexasInstrumentsMemoryMapParser(parserUniqueName, mapFile, commandFile, wordSize, context.graphConfigurations, showBytesOnGraphs);
            break;
        default:
            System.out.println("Unable to allocate parser: " + parserType);
            break;
    }
    if (parser != null) {
        parser.setParserTitle(context.parserTitle);
        parsers.add(parser);
    }
}
Also used : TexasInstrumentsMemoryMapParser(net.praqma.jenkins.memorymap.parser.ti.TexasInstrumentsMemoryMapParser) AbstractMemoryMapParser(net.praqma.jenkins.memorymap.parser.AbstractMemoryMapParser) GccMemoryMapParser(net.praqma.jenkins.memorymap.parser.gcc.GccMemoryMapParser)

Aggregations

GccMemoryMapParser (net.praqma.jenkins.memorymap.parser.gcc.GccMemoryMapParser)7 Test (org.junit.Test)6 HashMap (java.util.HashMap)3 MemoryMapGraphConfiguration (net.praqma.jenkins.memorymap.graph.MemoryMapGraphConfiguration)3 FreeStyleBuild (hudson.model.FreeStyleBuild)1 FreeStyleProject (hudson.model.FreeStyleProject)1 File (java.io.File)1 AbstractMemoryMapParser (net.praqma.jenkins.memorymap.parser.AbstractMemoryMapParser)1 TexasInstrumentsMemoryMapParser (net.praqma.jenkins.memorymap.parser.ti.TexasInstrumentsMemoryMapParser)1 MemoryMapConfigMemory (net.praqma.jenkins.memorymap.result.MemoryMapConfigMemory)1