Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2060)

Unified Diff: native_client_sdk/src/tools/tests/create_nmf_test.py

Issue 15891011: [NaCl SDK] Fix create_nmf handling of missing libraries. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « native_client_sdk/src/tools/create_nmf.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: native_client_sdk/src/tools/tests/create_nmf_test.py
diff --git a/native_client_sdk/src/tools/tests/create_nmf_test.py b/native_client_sdk/src/tools/tests/create_nmf_test.py
index fe08f6b4df27da3047e523e69d91d9b47ec1efe9..c0855ad16c11e949fddc99deef6499aa2b300766 100755
--- a/native_client_sdk/src/tools/tests/create_nmf_test.py
+++ b/native_client_sdk/src/tools/tests/create_nmf_test.py
@@ -145,8 +145,9 @@ class TestNmfUtils(unittest.TestCase):
def Mktemp(self):
self.tempdir = tempfile.mkdtemp()
- def CreateNmfUtils(self):
- libdir = os.path.join(self.toolchain, 'x86_64-nacl', 'lib32')
+ def CreateNmfUtils(self, libdir=None):
+ if not libdir:
+ libdir = os.path.join(self.toolchain, 'x86_64-nacl', 'lib32')
return create_nmf.NmfUtils([self.dyn_nexe],
lib_path=[libdir],
objdump=self.objdump)
@@ -194,6 +195,8 @@ class TestNmfUtils(unittest.TestCase):
def testStageDependencies(self):
self.Mktemp()
nmf = self.CreateNmfUtils()
+ #create_nmf.DebugPrint.debug_mode = True
+ #create_nmf.Trace.verbose = True
# Stage dependencies
nmf.StageDependencies(self.tempdir)
@@ -209,6 +212,16 @@ class TestNmfUtils(unittest.TestCase):
expectedContents = self.dyn_deps
self.assertEqual(contents, expectedContents)
+ def testMissingArchLibrary(self):
+ self.Mktemp()
+ nmf = self.CreateNmfUtils()
+ # CreateNmfUtils uses the 32-bit library path, but not the 64-bit one
+ # so searching for a 32-bit library should succeed while searching for
+ # a 64-bit one should fail.
+ nmf.GleanFromObjdump(['libgcc_s.so.1'], 'x86-32')
+ self.assertRaises(create_nmf.Error,
+ nmf.GleanFromObjdump, ['libgcc_s.so.1'], 'x86-64')
+
if __name__ == '__main__':
unittest.main()
« no previous file with comments | « native_client_sdk/src/tools/create_nmf.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698