Skip to content

Commit 688db2b

Browse files
authored
Merge pull request swiftlang#20961 from compnerd/remote-run
remote-run: make tests partially pass on Windows
2 parents be0bdd1 + 043912f commit 688db2b

File tree

11 files changed

+26
-13
lines changed

11 files changed

+26
-13
lines changed

test/remote-run/custom-options.test-sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
RUN: %utils/remote-run -n --remote-dir /xyz-REMOTE -o FIRST_OPT -o SECOND_OPT --output-prefix %t some_user@some_host:12345 cp %t/nested/input %t/nested/output 2>&1 >/dev/null | %FileCheck %s
1+
RUN: %remote-run -n --remote-dir /xyz-REMOTE -o FIRST_OPT -o SECOND_OPT --output-prefix %/t some_user@some_host:12345 cp %/t/nested/input %/t/nested/output 2>&1 >/dev/null | %FileCheck %s
22

33
CHECK: /usr/bin/ssh -n
44
CHECK-DAG: -p 12345

test/remote-run/dry-run-remote.test-sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
RUN: %utils/remote-run -n --remote-dir /xyz-REMOTE --input-prefix %S/Inputs/ some_user@some_host ls %S/Inputs/upload/1.txt %S/Inputs/upload/2.txt 2>&1 >/dev/null | %FileCheck -check-prefix CHECK-INPUT %s
1+
RUN: %remote-run -n --remote-dir /xyz-REMOTE --input-prefix %S/Inputs/ some_user@some_host ls %S/Inputs/upload/1.txt %S/Inputs/upload/2.txt 2>&1 >/dev/null | %FileCheck -check-prefix CHECK-INPUT %s
22

33
CHECK-INPUT: /usr/bin/ssh -n some_user@some_host -- '/usr/bin/env' '/bin/mkdir' '-p' '{{.+}}-REMOTE/input/upload'
44
CHECK-INPUT-NEXT: /usr/bin/sftp
@@ -10,7 +10,7 @@ CHECK-INPUT: /usr/bin/ssh -n some_user@some_host -- '/usr/bin/env' 'ls'
1010
RUN: %empty-directory(%t)
1111
RUN: %empty-directory(%t/nested)
1212
RUN: touch %t/nested/input %t/nested/BAD
13-
RUN: %utils/remote-run -n --remote-dir /xyz-REMOTE --output-prefix %t some_user@some_host cp %t/nested/input %t/nested/output 2>&1 >/dev/null | %FileCheck -check-prefix CHECK-OUTPUT %s
13+
RUN: %remote-run -n --remote-dir /xyz-REMOTE --output-prefix %/t some_user@some_host cp %/t/nested/input %/t/nested/output 2>&1 >/dev/null | %FileCheck -check-prefix CHECK-OUTPUT %s
1414

1515
CHECK-OUTPUT: /usr/bin/ssh -n some_user@some_host -- '/usr/bin/env' '/bin/mkdir' '-p' '{{.+}}-REMOTE/output/nested'
1616
CHECK-OUTPUT-NEXT: /usr/bin/sftp

test/remote-run/dry-run.test-sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
REQUIRES: shell
2+
13
RUN: %empty-directory(%t)
24
RUN: %debug-remote-run -n --input-prefix %S/Inputs/ ls %S/Inputs/upload/1.txt %S/Inputs/upload/2.txt 2>&1 >/dev/null | %FileCheck -check-prefix CHECK-INPUT %s
35
RUN: test -z "`ls %t`"

test/remote-run/env.test-sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
REQUIRES: shell
2+
13
RUN: env REMOTE_RUN_CHILD_FOO=foo REMOTE_RUN_CHILD_BAR=bar %debug-remote-run sh -c 'echo ":${FOO}:" ":${BAR}:"' | %FileCheck %s
24
RUN: env REMOTE_RUN_CHILD_FOO=foo REMOTE_RUN_CHILD_BAR=bar %debug-remote-run -v sh -c 'echo ":${FOO}:" ":${BAR}:"' 2>&1 >/dev/null | %FileCheck -check-prefix VERBOSE %s
35

test/remote-run/exit-code.test-sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
REQUIRES: shell
2+
13
RUN: not %debug-remote-run false >%t.txt 2>%t.errs.txt
24
RUN: test -f %t.txt -a ! -s %t.txt
35
RUN: test -f %t.errs.txt -a ! -s %t.errs.txt

test/remote-run/identity.test-sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
RUN: %utils/remote-run -n --remote-dir /xyz-REMOTE -i spiderman --output-prefix %t some_user@some_host:12345 cp %t/nested/input %t/nested/output 2>&1 >/dev/null | %FileCheck %s
1+
RUN: %remote-run -n --remote-dir /xyz-REMOTE -i spiderman --output-prefix %/t some_user@some_host:12345 cp %/t/nested/input %/t/nested/output 2>&1 >/dev/null | %FileCheck %s
22

33
CHECK: /usr/bin/ssh -n
44
CHECK-DAG: -p 12345
@@ -32,7 +32,7 @@ CHECK-DAG: -get '/xyz-REMOTE/output/nested/output' '{{.+}}/nested/output'
3232
CHECK-DAG: -get '/xyz-REMOTE/output/nested/input' '{{.+}}/nested/input'
3333

3434
# Make sure things work without a port.
35-
RUN: %utils/remote-run -n --remote-dir /xyz-REMOTE -i spiderman --output-prefix %t some_user@some_host cp %t/nested/input %t/nested/output 2>&1 >/dev/null | %FileCheck -check-prefix CHECK-PORTLESS %s
35+
RUN: %remote-run -n --remote-dir /xyz-REMOTE -i spiderman --output-prefix %/t some_user@some_host cp %/t/nested/input %/t/nested/output 2>&1 >/dev/null | %FileCheck -check-prefix CHECK-PORTLESS %s
3636

3737
CHECK-PORTLESS: /usr/bin/sftp
3838
CHECK-PORTLESS-SAME: -i spiderman

test/remote-run/lit.local.cfg

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@
22
config.substitutions = list(config.substitutions)
33

44
config.substitutions.insert(0, ('%debug-remote-run',
5-
'%utils/remote-run --debug-as-local %sftp-server --remote-dir %t-REMOTE') )
5+
r'%r %%utils/remote-run --debug-as-local %%sftp-server --remote-dir %%t-REMOTE' % (sys.executable,)))
6+
config.substitutions.insert(0, ('%remote-run',
7+
r'%r %%utils/remote-run' % (sys.executable,)))

test/remote-run/port.test-sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
RUN: %utils/remote-run -n --remote-dir /xyz-REMOTE --output-prefix %t some_user@some_host:12345 cp %t/nested/input %t/nested/output 2>&1 >/dev/null | %FileCheck %s
1+
RUN: %remote-run -n --remote-dir /xyz-REMOTE --output-prefix %/t some_user@some_host:12345 cp %/t/nested/input %/t/nested/output 2>&1 >/dev/null | %FileCheck %s
22

33
CHECK: /usr/bin/ssh -n -p 12345 some_user@some_host -- '/usr/bin/env' '/bin/mkdir' '-p' '{{.+}}-REMOTE/output/nested'
44
CHECK-NEXT: /usr/bin/sftp

test/remote-run/run-only.test-sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
REQUIRES: shell
2+
13
RUN: %debug-remote-run echo hello | %FileCheck %s
24
RUN: %debug-remote-run -v echo hello 2>&1 >/dev/null | %FileCheck -check-prefix VERBOSE %s
35

test/remote-run/stderr.test-sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
REQUIRES: shell
2+
13
RUN: %debug-remote-run sh -c "echo hello; echo goodbye >&2" > %t.stdout.txt 2> %t.stderr.txt
24
RUN: %FileCheck -check-prefix CHECK-STDOUT %s < %t.stdout.txt
35
RUN: %FileCheck -check-prefix CHECK-STDERR %s < %t.stderr.txt

0 commit comments

Comments
 (0)