Mercurial > lcfOS
comparison test/testbintools.py @ 342:86b02c98a717 devel
Moved target directory
author | Windel Bouwman |
---|---|
date | Sat, 01 Mar 2014 15:40:31 +0100 |
parents | d1ecc493384e |
children | 9667d78ba79e |
comparison
equal
deleted
inserted
replaced
341:4d204f6f7d4e | 342:86b02c98a717 |
---|---|
1 import unittest | 1 import unittest |
2 import sys | 2 import sys |
3 from target.arminstructions import ArmToken | 3 from ppci.target.arm.token import ArmToken |
4 from ppci.linker import Linker | 4 from ppci.linker import Linker |
5 from ppci.objectfile import ObjectFile | 5 from ppci.objectfile import ObjectFile |
6 from ppci import CompilerError | 6 from ppci import CompilerError |
7 from ppci.tasks import EmptyTask, TaskRunner, TaskError | |
8 | |
9 | |
10 class TaskTestCase(unittest.TestCase): | |
11 def testCircular(self): | |
12 t1 = EmptyTask('t1') | |
13 t2 = EmptyTask('t2') | |
14 t1.add_dependency(t2) | |
15 with self.assertRaises(TaskError): | |
16 t2.add_dependency(t1) | |
17 | |
18 def testCircularDeeper(self): | |
19 t1 = EmptyTask('t1') | |
20 t2 = EmptyTask('t2') | |
21 t3 = EmptyTask('t3') | |
22 t1.add_dependency(t2) | |
23 t2.add_dependency(t3) | |
24 with self.assertRaises(TaskError): | |
25 t3.add_dependency(t1) | |
26 | |
27 def testSort(self): | |
28 t1 = EmptyTask('t1') | |
29 t2 = EmptyTask('t2') | |
30 runner = TaskRunner() | |
31 t1.add_dependency(t2) | |
32 runner.add_task(t1) | |
33 runner.add_task(t2) | |
34 runner.run_tasks() | |
7 | 35 |
8 | 36 |
9 class TokenTestCase(unittest.TestCase): | 37 class TokenTestCase(unittest.TestCase): |
10 def testSetBits(self): | 38 def testSetBits(self): |
11 at = ArmToken() | 39 at = ArmToken() |