def DebugInfoTest(input_proto, _output_proto, config): """Run the debug info tests.""" sysroot_path = input_proto.sysroot.path target_name = input_proto.sysroot.build_target.name if not sysroot_path: if target_name: sysroot_path = cros_build_lib.GetSysroot(target_name) else: cros_build_lib.Die( "The sysroot path or the sysroot's build target name " 'must be provided.') # We could get away with out this, but it's a cheap check. sysroot = sysroot_lib.Sysroot(sysroot_path) if not sysroot.Exists(): cros_build_lib.Die('The provided sysroot does not exist.') if config.validate_only: return controller.RETURN_CODE_VALID_INPUT if test.DebugInfoTest(sysroot_path): return controller.RETURN_CODE_SUCCESS else: return controller.RETURN_CODE_COMPLETED_UNSUCCESSFULLY
def testFailure(self): """Test command failure.""" self.rc.SetDefaultCmdResult(returncode=1) self.assertFalse(test.DebugInfoTest('/sysroot/path'))
def testSuccess(self): """Test command success.""" self.assertTrue(test.DebugInfoTest('/sysroot/path')) self.assertCommandContains( ['debug_info_test', '/sysroot/path/usr/lib/debug'])