| 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 self.assertTrue(any(os.path.join('ports', 'lib') in p for p in paths), | 77 self.assertTrue(any(os.path.join('ports', 'lib') in p for p in paths), |
| 78 "naclports libpath missing: %s" % str(paths)) | 78 "naclports libpath missing: %s" % str(paths)) |
| 79 | 79 |
| 80 | 80 |
| 81 class TestNmfUtils(unittest.TestCase): | 81 class TestNmfUtils(unittest.TestCase): |
| 82 """Tests for the main NmfUtils class in create_nmf.""" | 82 """Tests for the main NmfUtils class in create_nmf.""" |
| 83 | 83 |
| 84 def setUp(self): | 84 def setUp(self): |
| 85 self.tempdir = None | 85 self.tempdir = None |
| 86 toolchain = os.path.join(CHROME_SRC, 'native_client', 'toolchain') | 86 toolchain = os.path.join(CHROME_SRC, 'native_client', 'toolchain') |
| 87 self.toolchain = os.path.join(toolchain, '%s_x86' % getos.GetPlatform()) | 87 self.toolchain = os.path.join(toolchain, '%s_x86' % getos.GetPlatform(), |
| 88 'nacl_x86_glibc') |
| 88 self.objdump = os.path.join(self.toolchain, 'bin', 'i686-nacl-objdump') | 89 self.objdump = os.path.join(self.toolchain, 'bin', 'i686-nacl-objdump') |
| 89 if os.name == 'nt': | 90 if os.name == 'nt': |
| 90 self.objdump += '.exe' | 91 self.objdump += '.exe' |
| 91 self._Mktemp() | 92 self._Mktemp() |
| 92 | 93 |
| 93 def _CreateTestNexe(self, name, arch): | 94 def _CreateTestNexe(self, name, arch): |
| 94 """Create an empty test .nexe file for use in create_nmf tests. | 95 """Create an empty test .nexe file for use in create_nmf tests. |
| 95 | 96 |
| 96 This is used rather than checking in test binaries since the | 97 This is used rather than checking in test binaries since the |
| 97 checked in binaries depend on .so files that only exist in the | 98 checked in binaries depend on .so files that only exist in the |
| (...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 593 'optlevel': 0, | 594 'optlevel': 0, |
| 594 } | 595 } |
| 595 } | 596 } |
| 596 } | 597 } |
| 597 } | 598 } |
| 598 self.assertManifestEquals(nmf, expected_manifest) | 599 self.assertManifestEquals(nmf, expected_manifest) |
| 599 | 600 |
| 600 | 601 |
| 601 if __name__ == '__main__': | 602 if __name__ == '__main__': |
| 602 unittest.main() | 603 unittest.main() |
| OLD | NEW |