Skip to content

Commit

Permalink
[openmp] [test] Set __COMPAT_LAYER=RunAsInvoker when running tests on…
Browse files Browse the repository at this point in the history
… Windows

Windows heuristics may decide to want to run some tested processes
as elevated (since it may think some of them are installers - executables
with "dispatch" in the name may hit a heuristic looking for "patch").

Set this environment variable to disable this heuristic and just run
the executable with whatever privileges the caller has.

This fixes a couple tests on such versions of Windows where this
heuristic is active.

Differential Revision: https://reviews.llvm.org/D137772
  • Loading branch information
mstorsjo committed Nov 28, 2022
1 parent db6406a commit 63f0fdc
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions openmp/runtime/test/lit.cfg
Expand Up @@ -111,6 +111,14 @@ if config.operating_system in ['Linux', 'Windows']:
if config.operating_system in ['Linux']:
config.available_features.add('hidden-helper')

# Avoid Windows heuristics which try to detect potential installer programs
# (which may need to run with elevated privileges) and ask if the user wants
# to run them in that way. This heuristic may match for executables containing
# the word "patch" which is a substring of "dispatch". Set an environment
# variable indicating that we want to execute them with the current user.
if config.operating_system == 'Windows':
config.environment['__COMPAT_LAYER'] = 'RunAsInvoker'

import multiprocessing
try:
if multiprocessing.cpu_count() > 1:
Expand Down

0 comments on commit 63f0fdc

Please sign in to comment.