comparison test/testsamples.py @ 362:c05ab629976a

Added CPUID for arm
author Windel Bouwman
date Sat, 15 Mar 2014 10:56:34 +0100
parents 5ef1cb1bb54f
children 396e5cefba13
comparison
equal deleted inserted replaced
361:614a7f6d4d4d 362:c05ab629976a
21 module testsample; 21 module testsample;
22 import io; 22 import io;
23 function void start() 23 function void start()
24 { 24 {
25 var int i; 25 var int i;
26 for (i=0;i<10;i++) 26 for (i=0; i<10; i++)
27 { 27 {
28 io.print("A"); 28 io.print2("A = ", i);
29 } 29 }
30 } 30 }
31 """ 31 """
32 self.do(snippet, "AAAAAAAAAA") 32 res = "".join("A = 0x{0:08X}\n".format(a) for a in range(10))
33 self.do(snippet, res)
33 34
34 35
35 class TestSamplesOnVexpress(unittest.TestCase, Samples): 36 class TestSamplesOnVexpress(unittest.TestCase, Samples):
36 def do(self, src, expected_output): 37 def do(self, src, expected_output):
37 runner = TaskRunner() 38 runner = TaskRunner()
38 recipe_loader = RecipeLoader(runner) 39 recipe_loader = RecipeLoader(runner)
40 print(expected_output)
39 return 41 return
40 # TODO: improve recipe loading?? 42 # TODO: improve recipe loading??
41 recipe_loader.load_dict({ 43 recipe_loader.load_dict({
42 'link': { 44 'link': {
43 'inputs': [ 45 'inputs': [
52 runner.add_task(Compile()) 54 runner.add_task(Compile())
53 runner.run_tasks() 55 runner.run_tasks()
54 res = runQemu() 56 res = runQemu()
55 self.assertEqual(expected_output, res) 57 self.assertEqual(expected_output, res)
56 58
59 if __name__ == '__main__':
60 unittest.main()