package io.trygvis.ld; import io.trygvis.ld.test1.Test1Test; import org.junit.Test; import java.io.File; public class FullScriptsTest { @Test public void testD2000() throws Exception { fullScript2("lds/d2000.ld"); } @Test public void testStm32() throws Exception { fullScript2("lds/stm32.ld"); } private void fullScript2(String fileName) throws Exception { try { LdLoader script = LdLoader.load(new File(fileName)); System.out.println("--------------------------------------------------------"); for (LdLoader.MemoryArea area : script.memoryAreas) { System.out.println(" " + area.name + "(" + area.prettyAttributes() + ") : ORIGIN = " + area.prettyOrigin() + ", LENGTH=" + area.prettyLength()); } } catch (LdLoader.ParseErrorException e) { Test1Test.showTokens(e.tokens, e.parser); System.out.println("Got " + e.errors.size() + " errors:"); e.errors.forEach(System.out::println); } } }