예제 #1
0
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
예제 #2
0
 def testFailure(self):
     """Test command failure."""
     self.rc.SetDefaultCmdResult(returncode=1)
     self.assertFalse(test.DebugInfoTest('/sysroot/path'))
예제 #3
0
 def testSuccess(self):
     """Test command success."""
     self.assertTrue(test.DebugInfoTest('/sysroot/path'))
     self.assertCommandContains(
         ['debug_info_test', '/sysroot/path/usr/lib/debug'])