@@ -7,7 +7,7 @@ import { expect } from 'chai';
7
7
import * as fs from 'fs-extra' ;
8
8
import * as path from 'path' ;
9
9
import { EXTENSION_ROOT_DIR } from '../../../../client/common/constants' ;
10
- import { DebuggerLauncherScriptProvider , NoDebugLauncherScriptProvider , RemoteDebuggerLauncherScriptProvider } from '../../../../client/debugger/debugAdapter/DebugClients/launcherProvider' ;
10
+ import { DebuggerLauncherScriptProvider , NoDebugLauncherScriptProvider , RemoteDebuggerExternalLauncherScriptProvider } from '../../../../client/debugger/debugAdapter/DebugClients/launcherProvider' ;
11
11
12
12
const expectedPath = path . join ( EXTENSION_ROOT_DIR , 'pythonFiles' , 'ptvsd_launcher.py' ) ;
13
13
@@ -21,12 +21,12 @@ suite('Debugger - Launcher Script Provider', () => {
21
21
{
22
22
testName : 'When path to ptvsd launcher does not contains spaces' ,
23
23
path : path . join ( 'path' , 'to' , 'ptvsd_launcher' ) ,
24
- expectedPath : 'path/to/ ptvsd_launcher'
24
+ expectedPath : path . join ( 'path' , 'to' , ' ptvsd_launcher')
25
25
} ,
26
26
{
27
27
testName : 'When path to ptvsd launcher contains spaces' ,
28
28
path : path . join ( 'path' , 'to' , 'ptvsd_launcher' , 'with spaces' ) ,
29
- expectedPath : '" path/to/ ptvsd_launcher/ with spaces"'
29
+ expectedPath : path . join ( ' path' , 'to' , ' ptvsd_launcher' , ' with spaces' )
30
30
}
31
31
] ;
32
32
@@ -52,15 +52,33 @@ suite('Debugger - Launcher Script Provider', () => {
52
52
const expectedArgs = [ testParams . expectedPath , '--custom' , '--nodebug' , '--client' , '--host' , 'something' , '--port' , '1234' ] ;
53
53
expect ( args ) . to . be . deep . equal ( expectedArgs ) ;
54
54
} ) ;
55
- test ( 'Test remote debug launcher args (and do not wait for debugger to attach)' , async ( ) => {
56
- const args = new RemoteDebuggerLauncherScriptProvider ( testParams . path ) . getLauncherArgs ( { host : 'something' , port : 1234 , waitUntilDebuggerAttaches : false } ) ;
57
- const expectedArgs = [ testParams . expectedPath , '--default' , '--host' , 'something' , '--port' , '1234' ] ;
58
- expect ( args ) . to . be . deep . equal ( expectedArgs ) ;
59
- } ) ;
60
- test ( 'Test remote debug launcher args (and wait for debugger to attach)' , async ( ) => {
61
- const args = new RemoteDebuggerLauncherScriptProvider ( testParams . path ) . getLauncherArgs ( { host : 'something' , port : 1234 , waitUntilDebuggerAttaches : true } ) ;
62
- const expectedArgs = [ testParams . expectedPath , '--default' , '--host' , 'something' , '--port' , '1234' , '--wait' ] ;
63
- expect ( args ) . to . be . deep . equal ( expectedArgs ) ;
55
+ } ) ;
56
+ } ) ;
57
+
58
+ suite ( 'External Debug Launcher' , ( ) => {
59
+ [
60
+ {
61
+ testName : 'When path to ptvsd launcher does not contains spaces' ,
62
+ path : path . join ( 'path' , 'to' , 'ptvsd_launcher' ) ,
63
+ expectedPath : 'path/to/ptvsd_launcher'
64
+ } ,
65
+ {
66
+ testName : 'When path to ptvsd launcher contains spaces' ,
67
+ path : path . join ( 'path' , 'to' , 'ptvsd_launcher' , 'with spaces' ) ,
68
+ expectedPath : '"path/to/ptvsd_launcher/with spaces"'
69
+ }
70
+ ] . forEach ( testParams => {
71
+ suite ( testParams . testName , async ( ) => {
72
+ test ( 'Test remote debug launcher args (and do not wait for debugger to attach)' , async ( ) => {
73
+ const args = new RemoteDebuggerExternalLauncherScriptProvider ( testParams . path ) . getLauncherArgs ( { host : 'something' , port : 1234 , waitUntilDebuggerAttaches : false } ) ;
74
+ const expectedArgs = [ testParams . expectedPath , '--default' , '--host' , 'something' , '--port' , '1234' ] ;
75
+ expect ( args ) . to . be . deep . equal ( expectedArgs ) ;
76
+ } ) ;
77
+ test ( 'Test remote debug launcher args (and wait for debugger to attach)' , async ( ) => {
78
+ const args = new RemoteDebuggerExternalLauncherScriptProvider ( testParams . path ) . getLauncherArgs ( { host : 'something' , port : 1234 , waitUntilDebuggerAttaches : true } ) ;
79
+ const expectedArgs = [ testParams . expectedPath , '--default' , '--host' , 'something' , '--port' , '1234' , '--wait' ] ;
80
+ expect ( args ) . to . be . deep . equal ( expectedArgs ) ;
81
+ } ) ;
64
82
} ) ;
65
83
} ) ;
66
84
} ) ;
0 commit comments