| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 import json | 5 import json |
| 6 import os | 6 import os |
| 7 import posixpath | 7 import posixpath |
| 8 import shutil | 8 import shutil |
| 9 import subprocess | 9 import subprocess |
| 10 import sys | 10 import sys |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 | 89 |
| 90 paths = create_nmf.GetDefaultLibPath('foo_bar') | 90 paths = create_nmf.GetDefaultLibPath('foo_bar') |
| 91 if sys.platform == 'win32': | 91 if sys.platform == 'win32': |
| 92 paths = [p.replace('\\', '/') for p in paths] | 92 paths = [p.replace('\\', '/') for p in paths] |
| 93 path_base = '/dummy/path/lib/glibc_x86_64/foo_bar' | 93 path_base = '/dummy/path/lib/glibc_x86_64/foo_bar' |
| 94 path_fallback = '/dummy/path/lib/glibc_x86_64/Release' | 94 path_fallback = '/dummy/path/lib/glibc_x86_64/Release' |
| 95 self.assertIn(path_base, paths) | 95 self.assertIn(path_base, paths) |
| 96 self.assertIn(path_fallback, paths) | 96 self.assertIn(path_fallback, paths) |
| 97 self.assertGreater(paths.index(path_fallback), paths.index(path_base)) | 97 self.assertGreater(paths.index(path_fallback), paths.index(path_base)) |
| 98 | 98 |
| 99 def testIncludesNaClPorts(self): | |
| 100 paths = create_nmf.GetDefaultLibPath('Debug') | |
| 101 self.assertTrue(any(os.path.join('ports', 'lib') in p for p in paths), | |
| 102 'naclports libpath missing: %s' % str(paths)) | |
| 103 | |
| 104 | 99 |
| 105 class TestNmfUtils(unittest.TestCase): | 100 class TestNmfUtils(unittest.TestCase): |
| 106 """Tests for the main NmfUtils class in create_nmf.""" | 101 """Tests for the main NmfUtils class in create_nmf.""" |
| 107 | 102 |
| 108 def setUp(self): | 103 def setUp(self): |
| 109 self.tempdir = None | 104 self.tempdir = None |
| 110 self.objdump = os.path.join(X86_GLIBC_TOOLCHAIN, 'bin', 'i686-nacl-objdump') | 105 self.objdump = os.path.join(X86_GLIBC_TOOLCHAIN, 'bin', 'i686-nacl-objdump') |
| 111 if os.name == 'nt': | 106 if os.name == 'nt': |
| 112 self.objdump += '.exe' | 107 self.objdump += '.exe' |
| 113 self._Mktemp() | 108 self._Mktemp() |
| (...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 723 'optlevel': 0, | 718 'optlevel': 0, |
| 724 } | 719 } |
| 725 } | 720 } |
| 726 } | 721 } |
| 727 } | 722 } |
| 728 self.assertManifestEquals(nmf, expected_manifest) | 723 self.assertManifestEquals(nmf, expected_manifest) |
| 729 | 724 |
| 730 | 725 |
| 731 if __name__ == '__main__': | 726 if __name__ == '__main__': |
| 732 unittest.main() | 727 unittest.main() |
| OLD | NEW |