message: Add browsePath checks.
diff: @@ -76,5 +76,43 @@ suite('CppTools tests', () => {
  expect(configurations.length).to.eq(1);
  expect(configurations[0].configuration.defines.some(def => def === 'FLAG1' || def === 'FLAG2')).to.be.true;
  expect(configurations[0].configuration.defines).to.not.have.all.members(['FLAG1', 'FLAG2']);
  +
  + // Verify the per-folder browsePath.
  + let canProvideBrowseConfigPerFolder: boolean = await provider.canProvideBrowseConfigurationsPerFolder();
  + expect(canProvideBrowseConfigPerFolder).to.eq(true);
  + let browseConfig = await provider.provideFolderBrowseConfiguration(vscode.Uri.file(path.join(here, __filename)));
  + expect(browseConfig.browsePath.length).to.eq(1);
  + expect(browseConfig.browsePath[0]).to.eq(here);
  +
  + // Verify the browsePath with a different folder.
  + let smokeFolder = path.join(here, '../smoke');
  + const sourceFile2 = path.join(smokeFolder, 'main.cpp');
  + const uri2 = vscode.Uri.file(sourceFile2);
  + const codeModel2: codemodel_api.CodeModelContent = {
  + configurations: [{
  + projects: [{
  + name: 'cpptools-test2',
  + sourceDirectory: smokeFolder,
  + targets: [
  + {
  + name: 'target1',
  + type: 'EXECUTABLE',
  + fileGroups: [{
  + sources: [sourceFile2],
  + isGenerated: false,
  + compileFlags: '-DFLAG1',
  + language: 'CXX'
  + }]
  + }]
  + }]
  + }]
  + };
  + provider.updateConfigurationData({cache, codeModel: codeModel2, activeTarget: 'target1', folder: smokeFolder});
  + let configurations2 = await provider.provideConfigurations([uri2]);
  + expect(configurations2.length).to.eq(1);
  + expect(configurations2[0].configuration.defines).to.contain('FLAG1');
  + let browseConfig2 = await provider.provideFolderBrowseConfiguration(vscode.Uri.file(path.join(smokeFolder, "smoke.ts")));
  + expect(browseConfig2.browsePath.length).to.eq(1);
  + expect(browseConfig2.browsePath[0]).to.eq(smokeFolder);
  });
  });
  