Search in sources :

Example 1 with TexasInstrumentsMemoryMapParser

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

the class TexasInstrumentsMemoryMapParserIT method testUsageValues.

@Test
public void testUsageValues() throws Exception {
    MemoryMapGraphConfiguration graphConfiguration = new MemoryMapGraphConfiguration("RAMM0+RAML0_L3", "432");
    TexasInstrumentsMemoryMapParser parser = createParser(graphConfiguration);
    parser.setMapFile("TexasInstrumentsMapFile.txt");
    parser.setConfigurationFile("28069_RAM_lnk.cmd");
    HashMap<String, String> expectedValues = new HashMap<>();
    expectedValues.put("RAMM0", "00000195");
    expectedValues.put("RAML0_L3", "00001a8f");
    TestUtils.testUsageValues(jenkins, parser, "ti.zip", expectedValues);
}
Also used : MemoryMapGraphConfiguration(net.praqma.jenkins.memorymap.graph.MemoryMapGraphConfiguration) HashMap(java.util.HashMap) TexasInstrumentsMemoryMapParser(net.praqma.jenkins.memorymap.parser.ti.TexasInstrumentsMemoryMapParser) Test(org.junit.Test)

Example 2 with TexasInstrumentsMemoryMapParser

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

the class TexasInstrumentsMemoryMapParserTest method testGetDefaultWordSize.

@Test
public void testGetDefaultWordSize() {
    TexasInstrumentsMemoryMapParser parser = new TexasInstrumentsMemoryMapParser();
    assertEquals("16 equals parser.getDefaultWordSize()", 16, parser.getDefaultWordSize());
}
Also used : TexasInstrumentsMemoryMapParser(net.praqma.jenkins.memorymap.parser.ti.TexasInstrumentsMemoryMapParser) Test(org.junit.Test)

Example 3 with TexasInstrumentsMemoryMapParser

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

the class TexasInstrumentsMemoryMapParserTest method testParseConfigFile.

@Test
public void testParseConfigFile() throws IOException {
    TexasInstrumentsMemoryMapParser parser = new TexasInstrumentsMemoryMapParser();
    String file = TexasInstrumentsMemoryMapParserTest.class.getResource("28069_RAM_lnk.cmd").getFile();
    File f = new File(file);
    parser.parseConfigFile(f);
}
Also used : TexasInstrumentsMemoryMapParser(net.praqma.jenkins.memorymap.parser.ti.TexasInstrumentsMemoryMapParser) File(java.io.File) Test(org.junit.Test)

Example 4 with TexasInstrumentsMemoryMapParser

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

the class TexasInstrumentsMemoryMapParserTest method testParseMapFile.

@Test
public void testParseMapFile() throws IOException {
    TexasInstrumentsMemoryMapParser parser = new TexasInstrumentsMemoryMapParser();
    String file = TexasInstrumentsMemoryMapParserTest.class.getResource("TexasInstrumentsMapFile.txt").getFile();
    File f = new File(file);
    MemoryMapConfigMemory configMemory = new MemoryMapConfigMemory();
    configMemory.add(new MemoryMapConfigMemoryItem("RAMM0", "00000050", "000003b0", "00000195", "0000021b"));
    configMemory = parser.parseMapFile(f, configMemory);
    assertTrue(configMemory.size() > 0);
    configMemory.stream().filter(item -> item.getName().equals("RAMM0")).forEach(item -> {
        assertEquals(item.getUsed(), "00000195");
        assertEquals(item.getUnused(), "0000021b");
    });
}
Also used : MemoryMapConfigMemoryItem(net.praqma.jenkins.memorymap.result.MemoryMapConfigMemoryItem) TexasInstrumentsMemoryMapParser(net.praqma.jenkins.memorymap.parser.ti.TexasInstrumentsMemoryMapParser) IOException(java.io.IOException) Test(org.junit.Test) Assert(org.junit.Assert) File(java.io.File) MemoryMapConfigMemory(net.praqma.jenkins.memorymap.result.MemoryMapConfigMemory) MemoryMapConfigMemoryItem(net.praqma.jenkins.memorymap.result.MemoryMapConfigMemoryItem) MemoryMapConfigMemory(net.praqma.jenkins.memorymap.result.MemoryMapConfigMemory) TexasInstrumentsMemoryMapParser(net.praqma.jenkins.memorymap.parser.ti.TexasInstrumentsMemoryMapParser) File(java.io.File) Test(org.junit.Test)

Example 5 with TexasInstrumentsMemoryMapParser

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

the class MemoryMapParserDelegateTest method findFilePatternWorks_test.

@Test
public void findFilePatternWorks_test() throws IOException {
    MemoryMapMapParserDelegate delegate = new MemoryMapMapParserDelegate();
    MemoryMapGraphConfiguration gc = new MemoryMapGraphConfiguration(null, null);
    gc.setGraphDataList("CODE,DATA,CONST");
    gc.setGraphCaption("Config Memory Graph");
    List<MemoryMapGraphConfiguration> graphConfig = Collections.singletonList(gc);
    AbstractMemoryMapParser parser = new TexasInstrumentsMemoryMapParser("TI", "TexasInstrumentsMapFile.txt", "28069_RAM_lnk.cmd", 16, graphConfig, Boolean.TRUE);
    List<AbstractMemoryMapParser> parsers = Collections.singletonList(parser);
    delegate.setParsers(parsers);
    assertNotNull(delegate.getParsers());
    assertNotNull(parser.getMapFile());
    File test = new File(file.getAbsolutePath().substring(0, file.getAbsolutePath().lastIndexOf(File.separator)));
    assertTrue(test.isDirectory());
    try {
        delegate.findFile(test, "*.map");
    } catch (Exception ex) {
        fail("Parser did not find the file" + ex);
    }
}
Also used : MemoryMapGraphConfiguration(net.praqma.jenkins.memorymap.graph.MemoryMapGraphConfiguration) TexasInstrumentsMemoryMapParser(net.praqma.jenkins.memorymap.parser.ti.TexasInstrumentsMemoryMapParser) AbstractMemoryMapParser(net.praqma.jenkins.memorymap.parser.AbstractMemoryMapParser) File(java.io.File) MemoryMapMapParserDelegate(net.praqma.jenkins.memorymap.parser.MemoryMapMapParserDelegate) IOException(java.io.IOException) Test(org.junit.Test)

Aggregations

TexasInstrumentsMemoryMapParser (net.praqma.jenkins.memorymap.parser.ti.TexasInstrumentsMemoryMapParser)6 Test (org.junit.Test)5 File (java.io.File)3 IOException (java.io.IOException)2 MemoryMapGraphConfiguration (net.praqma.jenkins.memorymap.graph.MemoryMapGraphConfiguration)2 AbstractMemoryMapParser (net.praqma.jenkins.memorymap.parser.AbstractMemoryMapParser)2 HashMap (java.util.HashMap)1 MemoryMapMapParserDelegate (net.praqma.jenkins.memorymap.parser.MemoryMapMapParserDelegate)1 GccMemoryMapParser (net.praqma.jenkins.memorymap.parser.gcc.GccMemoryMapParser)1 MemoryMapConfigMemory (net.praqma.jenkins.memorymap.result.MemoryMapConfigMemory)1 MemoryMapConfigMemoryItem (net.praqma.jenkins.memorymap.result.MemoryMapConfigMemoryItem)1 Assert (org.junit.Assert)1