public async executeRun()

in src/test-runner/run-tracker.ts [104:137]


  public async executeRun(
    callback: (
      item: vscode.TestItem,
      cancelToken: vscode.CancellationToken
    ) => Promise<void>
  ) {
    // All items below the roots of the TestRunRequest will be shown as enqueued.
    for (const item of this) {
      this.run.enqueued(item.testItem)
    }

    // Run the callback for each test case.
    for (const item of this) {
      if (this.cancelToken.isCancellationRequested) {
        this.run.appendOutput(
          'Run canceled by user.  Remaining items will be skipped.\r\n'
        )
        break
      }

      const initialStatus = TestCaseStatus.Started
      this.updateStatus(item.testItem, initialStatus)
      await callback(item.testItem, this.cancelToken)

      if (this.status.get(item.testItem) === initialStatus) {
        // If an updated status has not been set by the callback, consider it skipped.
        this.updateStatus(item.testItem, TestCaseStatus.Skipped)
      }
    }

    await Promise.all(this.pending)
    this.run.end()
    if (this.onDoneCallback) this.onDoneCallback()
  }