Skip to content

Commit

Permalink
[Test Suite] Allow overriding codesign identity
Browse files Browse the repository at this point in the history
Summary: Not everyone names their code sign identity "lldb_codesign", so it is nice to allow this to be overridden.

Reviewers: zturner, tfiala

Subscribers: labath, mgorny, lldb-commits

Differential Revision: https://reviews.llvm.org/D25714

llvm-svn: 284893
  • Loading branch information
Chris Bieneman committed Oct 21, 2016
1 parent 7b15e29 commit 7ba5581
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
2 changes: 2 additions & 0 deletions lldb/packages/Python/lldbsuite/test/dotest.py
Expand Up @@ -481,6 +481,8 @@ def parseOptionsAndInitTestdirs():
# Shut off multiprocessing mode when test directories are specified.
configuration.no_multiprocess_test_runner = True

lldbtest_config.codesign_identity = args.codesign_identity

#print("testdirs:", testdirs)


Expand Down
5 changes: 5 additions & 0 deletions lldb/packages/Python/lldbsuite/test/dotest_args.py
Expand Up @@ -151,6 +151,11 @@ def create_parser():
dest='log_success',
action='store_true',
help="Leave logs/traces even for successful test runs (useful for creating reference log files during debugging.)")
group.add_argument(
'--codesign-identity',
metavar='Codesigning identity',
default='lldb_codesign',
help='The codesigning identity to use')

# Configuration options
group = parser.add_argument_group('Remote platform options')
Expand Down
4 changes: 2 additions & 2 deletions lldb/packages/Python/lldbsuite/test/lldbtest.py
Expand Up @@ -1543,8 +1543,8 @@ def buildGo(self):

def signBinary(self, binary_path):
if sys.platform.startswith("darwin"):
codesign_cmd = "codesign --force --sign lldb_codesign %s" % (
binary_path)
codesign_cmd = "codesign --force --sign \"%s\" %s" % (
lldbtest_config.codesign_identity, binary_path)
call(codesign_cmd, shell=True)

def findBuiltClang(self):
Expand Down
4 changes: 4 additions & 0 deletions lldb/test/CMakeLists.txt
Expand Up @@ -85,6 +85,10 @@ if ( CMAKE_SYSTEM_NAME MATCHES "Windows" )
endif()
endif()

if(LLDB_CODESIGN_IDENTITY)
list(APPEND LLDB_TEST_COMMON_ARGS --codesign-identity "${LLDB_CODESIGN_IDENTITY}")
endif()

add_python_test_target(check-lldb-single
${LLDB_SOURCE_DIR}/test/dotest.py
"--no-multiprocess;${LLDB_TEST_COMMON_ARGS};${LLDB_TEST_USER_ARGS}"
Expand Down

0 comments on commit 7ba5581

Please sign in to comment.