@@ -624,7 +624,6 @@ async function handleRunRequestedTests(
624
624
}
625
625
const start = Date . now ( ) ;
626
626
run . started ( test ) ;
627
- const cmd = [ execPath , '--passed-tests=show' , `--routines=${ test . id } ` ] ;
628
627
629
628
if ( coverage ) {
630
629
/**
@@ -633,7 +632,17 @@ async function handleRunRequestedTests(
633
632
env [ 'GNATCOV_TRACE_FILE' ] = getTracePath ( test ) ;
634
633
}
635
634
636
- const driver = logAndRun ( run , cmd , env ) ;
635
+ /**
636
+ * Use a path relative to the workspace root in the command line to
637
+ * make log lines shorter.
638
+ */
639
+ const cmd = [
640
+ vscode . workspace . asRelativePath ( execPath ) ,
641
+ '--passed-tests=show' ,
642
+ `--routines=${ test . id } ` ,
643
+ ] ;
644
+ const testCwd = vscode . workspace . workspaceFolders ! [ 0 ] . uri . fsPath ;
645
+ const driver = logAndRun ( run , cmd , env , testCwd ) ;
637
646
const duration = Date . now ( ) - start ;
638
647
if ( driver . status !== null ) {
639
648
/**
@@ -1117,9 +1126,13 @@ function logAndRun(
1117
1126
run : vscode . TestRun ,
1118
1127
cmd : string [ ] ,
1119
1128
env ?: NodeJS . ProcessEnv ,
1129
+ cwd ?: string ,
1120
1130
) : cp . SpawnSyncReturns < Buffer > {
1121
1131
run . appendOutput ( `$ ${ cmd . map ( ( arg ) => `"${ arg } "` ) . join ( ' ' ) } \r\n` ) ;
1122
- return cp . spawnSync ( cmd [ 0 ] , cmd . slice ( 1 ) , { env : env } ) ;
1132
+ return cp . spawnSync ( cmd [ 0 ] , cmd . slice ( 1 ) , {
1133
+ env : env ,
1134
+ cwd : cwd ,
1135
+ } ) ;
1123
1136
}
1124
1137
1125
1138
/**
0 commit comments