[libunwind] db92019 - [libunwind] Update the test configuration files to support the remote execution.

Vladimir Vereschaka via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 25 17:49:39 PDT 2022


Author: Vladimir Vereschaka
Date: 2022-04-25T17:33:03-07:00
New Revision: db92019ab97b9bb13a3287438c4a2fa3ba375756

URL: https://github.com/llvm/llvm-project/commit/db92019ab97b9bb13a3287438c4a2fa3ba375756
DIFF: https://github.com/llvm/llvm-project/commit/db92019ab97b9bb13a3287438c4a2fa3ba375756.diff

LOG: [libunwind] Update the test configuration files to support the remote execution.

These changes allow remote execution for the libunwind library tests.

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

Added: 
    

Modified: 
    libunwind/test/configs/llvm-libunwind-shared.cfg.in
    libunwind/test/configs/llvm-libunwind-static.cfg.in

Removed: 
    


################################################################################
diff  --git a/libunwind/test/configs/llvm-libunwind-shared.cfg.in b/libunwind/test/configs/llvm-libunwind-shared.cfg.in
index 9de82e9d20fbc..c0a3e4d922be7 100644
--- a/libunwind/test/configs/llvm-libunwind-shared.cfg.in
+++ b/libunwind/test/configs/llvm-libunwind-shared.cfg.in
@@ -20,6 +20,7 @@ config.test_source_root = os.path.join('@LIBUNWIND_SOURCE_DIR@', 'test')
 config.test_format = libcxx.test.format.CxxStandardLibraryTest()
 config.recursiveExpansionLimit = 10
 config.test_exec_root = '@CMAKE_BINARY_DIR@'
+config.target_info = "@LIBUNWIND_TARGET_INFO@"
 
 compile_flags = []
 link_flags = []
@@ -39,9 +40,12 @@ if '@CMAKE_SYSTEM_NAME@' == 'Linux':
 # Stack unwinding tests need unwinding tables and these are not generated by default on all targets.
 compile_flags.append('-funwind-tables')
 
+config.substitutions.append(('%{executor}', '@LIBUNWIND_EXECUTOR@'))
+
 config.substitutions.append(('%{cxx}', '@CMAKE_CXX_COMPILER@'))
+local_sysroot = '@CMAKE_OSX_SYSROOT@' or '@CMAKE_SYSROOT@'
 config.substitutions.append(('%{flags}',
-    '-isysroot {}'.format('@CMAKE_OSX_SYSROOT@') if '@CMAKE_OSX_SYSROOT@' else ''
+    '-isysroot {}'.format(local_sysroot) if local_sysroot else ''
 ))
 config.substitutions.append(('%{compile_flags}',
     '-nostdinc++ -I {}/include {}'.format('@LIBUNWIND_SOURCE_DIR@', ' '.join(compile_flags))
@@ -49,7 +53,9 @@ config.substitutions.append(('%{compile_flags}',
 config.substitutions.append(('%{link_flags}',
     '-L {0} -Wl,-rpath,{0} -lunwind -ldl {1}'.format('@LIBUNWIND_LIBRARY_DIR@', ' '.join(link_flags))
 ))
-config.substitutions.append(('%{exec}', ''))
+config.substitutions.append(('%{exec}',
+    '%{executor} --execdir %T -- ' if '@LIBUNWIND_EXECUTOR@' else ''
+))
 
 import os, site
 site.addsitedir(os.path.join('@LIBUNWIND_LIBCXX_PATH@', 'utils'))

diff  --git a/libunwind/test/configs/llvm-libunwind-static.cfg.in b/libunwind/test/configs/llvm-libunwind-static.cfg.in
index 9382ad3f92a36..0bb4207307177 100644
--- a/libunwind/test/configs/llvm-libunwind-static.cfg.in
+++ b/libunwind/test/configs/llvm-libunwind-static.cfg.in
@@ -20,9 +20,11 @@ config.test_source_root = os.path.join('@LIBUNWIND_SOURCE_DIR@', 'test')
 config.test_format = libcxx.test.format.CxxStandardLibraryTest()
 config.recursiveExpansionLimit = 10
 config.test_exec_root = '@CMAKE_BINARY_DIR@'
+config.target_info = "@LIBUNWIND_TARGET_INFO@"
 
 compile_flags = []
 link_flags = []
+
 if @LIBUNWIND_USES_ARM_EHABI@:
     config.available_features.add('libunwind-arm-ehabi')
 
@@ -38,12 +40,17 @@ if @LIBUNWIND_ENABLE_CET@:
 if '@CMAKE_SYSTEM_NAME@' == 'Linux':
     link_flags.append('-Wl,--export-dynamic')
 
+
 # Stack unwinding tests need unwinding tables and these are not generated by default on all targets.
 compile_flags.append('-funwind-tables')
 
+config.substitutions.append(('%{executor}', '@LIBUNWIND_EXECUTOR@'))
+
 config.substitutions.append(('%{cxx}', '@CMAKE_CXX_COMPILER@'))
+
+local_sysroot = '@CMAKE_OSX_SYSROOT@' or '@CMAKE_SYSROOT@'
 config.substitutions.append(('%{flags}',
-    '-isysroot {}'.format('@CMAKE_OSX_SYSROOT@') if '@CMAKE_OSX_SYSROOT@' else ''
+    '-isysroot {}'.format(local_sysroot) if local_sysroot else ''
 ))
 config.substitutions.append(('%{compile_flags}',
     '-nostdinc++ -I {}/include {}'.format('@LIBUNWIND_SOURCE_DIR@', ' '.join(compile_flags))
@@ -51,7 +58,9 @@ config.substitutions.append(('%{compile_flags}',
 config.substitutions.append(('%{link_flags}',
     '{}/libunwind.a -ldl {}'.format('@LIBUNWIND_LIBRARY_DIR@', ' '.join(link_flags))
 ))
-config.substitutions.append(('%{exec}', ''))
+config.substitutions.append(('%{exec}',
+    '%{executor} --execdir %T -- ' if '@LIBUNWIND_EXECUTOR@' else ''
+))
 
 import os, site
 site.addsitedir(os.path.join('@LIBUNWIND_LIBCXX_PATH@', 'utils'))


        


More information about the cfe-commits mailing list