Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

Commit

Permalink
chg: user provided flag handling when running tests (#1976)
Browse files Browse the repository at this point in the history
  • Loading branch information
rschmied authored and ramya-rao-a committed Oct 10, 2018
1 parent 1411ca6 commit 61ce472
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/testUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ export function goTest(testconfig: TestConfig): Thenable<boolean> {
}

let testTags: string = testconfig.goConfig['testTags'] !== null ? testconfig.goConfig['testTags'] : testconfig.goConfig['buildTags'];
let args: Array<string> = ['test', ...testconfig.flags];
let args: Array<string> = ['test'];
let testType: string = testconfig.isBenchmark ? 'Benchmarks' : 'Tests';

if (testconfig.isBenchmark) {
Expand Down Expand Up @@ -231,11 +231,14 @@ export function goTest(testconfig: TestConfig): Thenable<boolean> {
outTargets.push('<long arguments omitted>');
} else {
outTargets.push(...targets);
outTargets.push(...testconfig.flags);
}
outputChannel.appendLine(['Running tool:', goRuntimePath, ...outTargets].join(' '));
outputChannel.appendLine('');

args.push(...targets);
// ensure that user provided flags are appended last (allow use of -args ...)
args.push(...testconfig.flags);

let tp = cp.spawn(goRuntimePath, args, { env: testEnvVars, cwd: testconfig.dir });
const outBuf = new LineBuffer();
Expand Down

0 comments on commit 61ce472

Please sign in to comment.