Only create nonempty test suites

Fixes #269.
This commit is contained in:
Jason Reed 2020-03-11 09:04:59 -04:00
Родитель b577c12d1c
Коммит 4968ad8a90
1 изменённых файлов: 8 добавлений и 3 удалений

Просмотреть файл

@ -168,15 +168,20 @@ export class QLTestAdapter extends DisposableObject implements TestAdapter {
this._tests.fire(<TestLoadStartedEvent>{ type: 'started' }); this._tests.fire(<TestLoadStartedEvent>{ type: 'started' });
const testDirectories = this.qlTestDiscovery.testDirectories; const testDirectories = this.qlTestDiscovery.testDirectories;
const children = testDirectories.map(
testDirectory => QLTestAdapter.createTestSuiteInfo(testDirectory, testDirectory.name)
);
const testSuite: TestSuiteInfo = { const testSuite: TestSuiteInfo = {
type: 'suite', type: 'suite',
label: 'CodeQL', label: 'CodeQL',
id: '.', id: '.',
children: testDirectories.map( children
testDirectory => QLTestAdapter.createTestSuiteInfo(testDirectory, testDirectory.name))
}; };
this._tests.fire(<TestLoadFinishedEvent>{ type: 'finished', suite: testSuite }); this._tests.fire(<TestLoadFinishedEvent>{
type: 'finished',
suite: children.length > 0 ? testSuite : undefined
});
} }
public async run(tests: string[]): Promise<void> { public async run(tests: string[]): Promise<void> {