@@ -624,7 +624,6 @@ async function handleRunRequestedTests(
624624 }
625625 const start = Date . now ( ) ;
626626 run . started ( test ) ;
627- const cmd = [ execPath , '--passed-tests=show' , `--routines=${ test . id } ` ] ;
628627
629628 if ( coverage ) {
630629 /**
@@ -633,7 +632,17 @@ async function handleRunRequestedTests(
633632 env [ 'GNATCOV_TRACE_FILE' ] = getTracePath ( test ) ;
634633 }
635634
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 ) ;
637646 const duration = Date . now ( ) - start ;
638647 if ( driver . status !== null ) {
639648 /**
@@ -1117,9 +1126,13 @@ function logAndRun(
11171126 run : vscode . TestRun ,
11181127 cmd : string [ ] ,
11191128 env ?: NodeJS . ProcessEnv ,
1129+ cwd ?: string ,
11201130) : cp . SpawnSyncReturns < Buffer > {
11211131 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+ } ) ;
11231136}
11241137
11251138/**
0 commit comments