use of net.praqma.jenkins.memorymap.parser.AbstractMemoryMapParser 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);
}
}
use of net.praqma.jenkins.memorymap.parser.AbstractMemoryMapParser 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);
}
}
use of net.praqma.jenkins.memorymap.parser.AbstractMemoryMapParser in project memory-map-plugin by Praqma.
the class MemoryMapProjectAction method getAssociatedMemoryAreas.
public String getAssociatedMemoryAreas(String graphTitle, String id) {
String result = null;
List<AbstractMemoryMapParser> parsers = parsersChosen();
for (AbstractMemoryMapParser parser : parsers) {
if (parser.getParserUniqueName().equals(id)) {
for (MemoryMapGraphConfiguration conf : parser.getGraphConfiguration()) {
if (conf.getGraphCaption().equals(graphTitle)) {
result = conf.getGraphDataList();
}
}
}
}
return result;
}
use of net.praqma.jenkins.memorymap.parser.AbstractMemoryMapParser in project memory-map-plugin by Praqma.
the class MemoryMapProjectAction method getGraphTitles.
public List<String> getGraphTitles() {
ArrayList<String> titles = new ArrayList<>();
List<AbstractMemoryMapParser> parsers = parsersChosen();
for (AbstractMemoryMapParser parser : parsers) {
List<MemoryMapGraphConfiguration> graphConfigurations = parser.getGraphConfiguration();
for (MemoryMapGraphConfiguration gc : graphConfigurations) {
titles.add(gc.getGraphCaption());
}
}
return titles;
}
use of net.praqma.jenkins.memorymap.parser.AbstractMemoryMapParser in project memory-map-plugin by Praqma.
the class MemoryMapProjectAction method getGraphTitles.
public List<String> getGraphTitles(String parserId) {
List<String> graphTitles = new ArrayList<>();
List<AbstractMemoryMapParser> parsers = parsersChosen();
for (AbstractMemoryMapParser parser : parsers) {
if (parser.getParserUniqueName().equals(parserId)) {
for (MemoryMapGraphConfiguration conf : parser.getGraphConfiguration()) {
graphTitles.add(conf.getGraphCaption());
}
}
}
return graphTitles;
}
Aggregations