Skip to content

Commit e2e744b

Browse files
committed
---
yaml --- r: 348502 b: refs/heads/master c: 652d5cc h: refs/heads/master
1 parent 7252fd6 commit e2e744b

File tree

4 files changed

+30
-5
lines changed

4 files changed

+30
-5
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 9bf6d8689d806471169058a8bb745e8fa863b822
2+
refs/heads/master: 652d5ccc79e9ce03e8a339d40c0e38c22870cf6f
33
refs/heads/master-next: 203b3026584ecad859eb328b2e12490099409cd5
44
refs/tags/osx-passed: b6b74147ef8a386f532cf9357a1bde006e552c54
55
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-a: 6bb18e013c2284f2b45f5f84f2df2887dc0f7dea

trunk/test/Inputs/symlink.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/usr/bin/env python
2+
import subprocess
3+
import sys
4+
import os
5+
6+
if len(sys.argv) < 3:
7+
print('Too few args to ' + sys.argv[0])
8+
print('Usage: symlink.py <link_points_to> <link_path> [--dir | --file]')
9+
sys.exit(1)
10+
11+
points_to = sys.argv[1]
12+
link_path = sys.argv[2]
13+
14+
if sys.platform == 'win32':
15+
points_to = points_to.replace('/', '\\')
16+
link_path = link_path.replace('/', '\\')
17+
if len(sys.argv) >= 4 and sys.argv[3] == '--dir':
18+
is_dir = True
19+
elif len(sys.argv) >= 4 and sys.argv[3] == '--file':
20+
is_dir = False
21+
else:
22+
is_dir = os.path.isdir(sys.argv[1])
23+
24+
# Windows symlink support was introduced in python 3.2
25+
subprocess.check_call(['cmd.exe', '/C', 'mklink ' + ('/D' if is_dir else ''), link_path, points_to])
26+
else:
27+
os.symlink(points_to, link_path)

trunk/test/SourceKit/CursorInfo/cursor_symlink.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
// ln doesn't create a proper symlink on Windows
2-
// XFAIL: windows
31
// RUN: %empty-directory(%t.dir)
42
// RUN: echo "let foo = 0" > %t.dir/real.swift
5-
// RUN: ln -s %t.dir/real.swift %t.dir/linked.swift
3+
// RUN: %{python} %S/../../Inputs/symlink.py %t.dir/real.swift %t.dir/linked.swift
64
// RUN: %sourcekitd-test -req=cursor -pos=1:5 %t.dir/linked.swift -- %t.dir/real.swift | %FileCheck %s
75
// RUN: %sourcekitd-test -req=cursor -pos=1:5 %t.dir/real.swift -- %t.dir/linked.swift | %FileCheck %s
86

trunk/test/SourceKit/Sema/sema_symlink.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// RUN: %empty-directory(%t.dir)
22
// RUN: echo "let foo: Int = goo" > %t.dir/real.swift
3-
// RUN: ln -s %t.dir/real.swift %t.dir/linked.swift
3+
// RUN: %{python} %S/../../Inputs/symlink.py %t.dir/real.swift %t.dir/linked.swift
44
// RUN: %sourcekitd-test -req=sema %t.dir/linked.swift -- %t.dir/real.swift | %sed_clean > %t.link.response
55
// RUN: diff -u %s.response %t.link.response
66
// RUN: %sourcekitd-test -req=sema %t.dir/real.swift -- %t.dir/linked.swift | %sed_clean > %t.real.response

0 commit comments

Comments
 (0)