mbed-os for GR-LYCHEE
Dependents: mbed-os-example-blinky-gr-lychee GR-Boads_Camera_sample GR-Boards_Audio_Recoder GR-Boads_Camera_DisplayApp ... more
tools/test/targets/target_test.py@0:f782d9c66c49, 2018-02-02 (annotated)
- Committer:
- dkato
- Date:
- Fri Feb 02 05:42:23 2018 +0000
- Revision:
- 0:f782d9c66c49
mbed-os for GR-LYCHEE
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
dkato | 0:f782d9c66c49 | 1 | #!/usr/bin/env python |
dkato | 0:f782d9c66c49 | 2 | """ |
dkato | 0:f782d9c66c49 | 3 | mbed |
dkato | 0:f782d9c66c49 | 4 | Copyright (c) 2017-2017 ARM Limited |
dkato | 0:f782d9c66c49 | 5 | |
dkato | 0:f782d9c66c49 | 6 | Licensed under the Apache License, Version 2.0 (the "License"); |
dkato | 0:f782d9c66c49 | 7 | you may not use this file except in compliance with the License. |
dkato | 0:f782d9c66c49 | 8 | You may obtain a copy of the License at |
dkato | 0:f782d9c66c49 | 9 | |
dkato | 0:f782d9c66c49 | 10 | http://www.apache.org/licenses/LICENSE-2.0 |
dkato | 0:f782d9c66c49 | 11 | |
dkato | 0:f782d9c66c49 | 12 | Unless required by applicable law or agreed to in writing, software |
dkato | 0:f782d9c66c49 | 13 | distributed under the License is distributed on an "AS IS" BASIS, |
dkato | 0:f782d9c66c49 | 14 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
dkato | 0:f782d9c66c49 | 15 | See the License for the specific language governing permissions and |
dkato | 0:f782d9c66c49 | 16 | limitations under the License. |
dkato | 0:f782d9c66c49 | 17 | """ |
dkato | 0:f782d9c66c49 | 18 | |
dkato | 0:f782d9c66c49 | 19 | import sys |
dkato | 0:f782d9c66c49 | 20 | from os.path import join, abspath, dirname |
dkato | 0:f782d9c66c49 | 21 | import unittest |
dkato | 0:f782d9c66c49 | 22 | |
dkato | 0:f782d9c66c49 | 23 | # Be sure that the tools directory is in the search path |
dkato | 0:f782d9c66c49 | 24 | ROOT = abspath(join(dirname(__file__), "..", "..", "..")) |
dkato | 0:f782d9c66c49 | 25 | sys.path.insert(0, ROOT) |
dkato | 0:f782d9c66c49 | 26 | |
dkato | 0:f782d9c66c49 | 27 | from tools.targets import TARGETS |
dkato | 0:f782d9c66c49 | 28 | from tools.arm_pack_manager import Cache |
dkato | 0:f782d9c66c49 | 29 | |
dkato | 0:f782d9c66c49 | 30 | class TestTargets(unittest.TestCase): |
dkato | 0:f782d9c66c49 | 31 | |
dkato | 0:f782d9c66c49 | 32 | def test_device_name(self): |
dkato | 0:f782d9c66c49 | 33 | """Assert device name is in a pack""" |
dkato | 0:f782d9c66c49 | 34 | cache = Cache(True, True) |
dkato | 0:f782d9c66c49 | 35 | named_targets = (target for target in TARGETS if |
dkato | 0:f782d9c66c49 | 36 | hasattr(target, "device_name")) |
dkato | 0:f782d9c66c49 | 37 | for target in named_targets: |
dkato | 0:f782d9c66c49 | 38 | self.assertTrue(target.device_name in cache.index, |
dkato | 0:f782d9c66c49 | 39 | "Target %s contains invalid device_name %s" % |
dkato | 0:f782d9c66c49 | 40 | (target.name, target.device_name)) |
dkato | 0:f782d9c66c49 | 41 | |
dkato | 0:f782d9c66c49 | 42 | if __name__ == '__main__': |
dkato | 0:f782d9c66c49 | 43 | unittest.main() |