diff test/testsamples.py @ 383:173e20a47fda

Added linker description loader
author Windel Bouwman
date Sun, 27 Apr 2014 17:40:39 +0200
parents 6df89163e114
children d056b552d3f4
line wrap: on
line diff
--- a/test/testsamples.py	Sun Apr 27 12:24:21 2014 +0200
+++ b/test/testsamples.py	Sun Apr 27 17:40:39 2014 +0200
@@ -24,6 +24,17 @@
 
 """
 
+arch_mmap = """
+MEMORY image LOCATION=0x10000 SIZE=0x10000 {
+    SECTION(reset)
+    SECTION(code)
+}
+
+MEMORY ram LOCATION=0x20000 SIZE=0x10000 {
+    SECTION(data)
+}
+"""
+
 class Samples:
     def testPrint(self):
         snippet = """
@@ -136,8 +147,7 @@
             relpath('..', 'kernel', 'src', 'io.c3'),
             io.StringIO(modarchcode),
             io.StringIO(src)], [], 'arm')
-        layout = {'code': 0x10000, 'data': 0x20000}
-        o3 = link([o1, o2], layout)
+        o3 = link([o1, o2], io.StringIO(arch_mmap))
 
         sample_filename = 'testsample.bin'
         with open(sample_filename, 'wb') as f:
@@ -152,6 +162,9 @@
         self.assertEqual(expected_output, res)
 
 
+# TODO: test samples on thumb target..
+
+
 if __name__ == '__main__':
     unittest.main()