Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 20 additions & 2 deletions projects/hipthreads/test/lit.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# from llvm-project/libcxx/test/configs/cmake-bridge.cfg.in

import os, platform, site, sys
import os, platform, site, sys, tempfile

IS_WINDOWS = platform.system() == 'Windows'

Expand Down Expand Up @@ -38,7 +38,25 @@ config.name = 'hipThreads'
config.test_source_root = os.path.join(HIPTHREADS_SOURCE_DIR, 'test')
config.test_format = libcxx.test.format.CxxStandardLibraryTest()
config.recursiveExpansionLimit = 10
config.test_exec_root = os.path.join(HIPTHREADS_BUILD_DIR, 'test')
# On Windows, this suite's deep directory layout plus a long CI workspace prefix pushes
# %t/%t.d past MAX_PATH (ROCm/rocm-libraries#10851, #11488). Use a short TEMP-based exec
# root instead of the build tree; nothing outside lit reads from it.
config.test_exec_root = (os.path.join(tempfile.gettempdir(), 'hipthreads-lit') if IS_WINDOWS
Comment thread
aleksandrasavicc marked this conversation as resolved.
Resolved
else os.path.join(HIPTHREADS_BUILD_DIR, 'test'))
Comment thread
aleksandrasavicc marked this conversation as resolved.
Resolved

# Warn if a future exec root regresses past MAX_PATH (#10851, #11488). Computed from the
# tree, not a hardcoded depth, so it doesn't go stale as tests are added/moved.
if IS_WINDOWS:
_longest_rel = ''
for _dir, _, _files in os.walk(config.test_source_root):
for _file in _files:
_rel = os.path.relpath(os.path.join(_dir, _file), config.test_source_root)
if len(_rel) > len(_longest_rel):
_longest_rel = _rel
_worst_dir, _worst_name = os.path.split(_longest_rel)
_worst_path = os.path.join(config.test_exec_root, _worst_dir, 'Output', _worst_name + '.dir', 't.tmp.exe')
if len(_worst_path) >= 248:
lit_config.warning(f'Longest lit exec path is {len(_worst_path)} chars (>= 248): {_worst_path}')

# Add substitutions for bootstrapping the test suite configuration
import shlex
Expand Down
Loading