Skip to content

Commit

Permalink
Merge pull request apple#34271 from drodriguez/windows-long-tmp-path
Browse files Browse the repository at this point in the history
[windows] Provide %long-tmp in Windows for extended length temp paths.
  • Loading branch information
compnerd committed Oct 12, 2020
2 parents c9115dc + b047f9e commit edef3d6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 5 additions & 2 deletions test/Misc/stats_dir_profiler.swift
Expand Up @@ -3,8 +3,11 @@
// RUN: %empty-directory(%t/stats-entities)
// RUN: %target-swiftc_driver -o %t/main -module-name main -stats-output-dir %t/stats-events %s -profile-stats-events
// RUN: %target-swiftc_driver -o %t/main -module-name main -stats-output-dir %t/stats-entities %s -profile-stats-entities
// RUN: %FileCheck -check-prefix=EVENTS -input-file %t/stats-events/*.dir/Time.User.events %s
// RUN: %FileCheck -check-prefix=ENTITIES -input-file %t/stats-entities/*.dir/Time.User.entities %s

// Need to use %long-tmp because in Windows the * may expand to a path longer
// than 260 characters.
// RUN: %FileCheck -check-prefix=EVENTS -input-file %long-tmp/stats-events/*.dir/Time.User.events %s
// RUN: %FileCheck -check-prefix=ENTITIES -input-file %long-tmp/stats-entities/*.dir/Time.User.entities %s

// EVENTS: {{perform-sema;.*;typecheck-decl.* [0-9]+}}
// ENTITIES: {{perform-sema;.*;TypeCheckFunctionBodyRequest bar\(\);typecheck-stmt.* [0-9]+}}
Expand Down
4 changes: 4 additions & 0 deletions test/lit.cfg
Expand Up @@ -2074,8 +2074,12 @@ config.substitutions.append(('%add_num_extra_inhabitants', add_num_extra_inhabit

if kIsWindows:
config.substitutions.append( ('%diff', 'diff --strip-trailing-cr') )
# Use instead of %t when the possible temporal path (and suffix) might end
# up being longer than 260 characters in Windows machines.
config.substitutions.append( ('%long-tmp', '\\\\?\\%t') )
else:
config.substitutions.append( ('%diff', 'diff') )
config.substitutions.append( ('%long-tmp', '%t') )

visual_studio_version = os.environ.get('VisualStudioVersion')
if kIsWindows and visual_studio_version:
Expand Down

0 comments on commit edef3d6

Please sign in to comment.