mirror of https://github.com/ARMmbed/mbed-os.git
Test to ensure only the last linker file is used in a project
parent
f0f133f3ec
commit
fd7467c9ba
|
@ -146,6 +146,20 @@ class ResourcesTest(unittest.TestCase):
|
||||||
exc_names = [dirname(name) or "." for name, _ in excluded_libs]
|
exc_names = [dirname(name) or "." for name, _ in excluded_libs]
|
||||||
assert(all(e in res.ignored_dirs for e in exc_names))
|
assert(all(e in res.ignored_dirs for e in exc_names))
|
||||||
|
|
||||||
|
def test_only_one_linker_script(self):
|
||||||
|
"""
|
||||||
|
Verify that when multiple linker scripts are added to a resource object,
|
||||||
|
only the last one added is used.
|
||||||
|
"""
|
||||||
|
resources = Resources(MockNotifier())
|
||||||
|
linker_scripts = ["first_linker_script.sct", "second_linker_script.sct"]
|
||||||
|
for linker_script in linker_scripts:
|
||||||
|
resources.add_file_ref(FileType.LD_SCRIPT, linker_script, linker_script)
|
||||||
|
|
||||||
|
assert(len(resources.get_file_refs(FileType.LD_SCRIPT)) == 1)
|
||||||
|
assert(resources.get_file_refs(FileType.LD_SCRIPT)[-1].name == linker_scripts[-1])
|
||||||
|
assert(resources.get_file_refs(FileType.LD_SCRIPT)[-1].path == linker_scripts[-1])
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
|
Loading…
Reference in New Issue