@@ -272,7 +272,11 @@ suite('CppTools tests', () => {
272272 const provider = new CppConfigurationProvider ( ) ;
273273 const cache = await CMakeCache . fromPath ( getTestResourceFilePath ( 'TestCMakeCache.txt' ) ) ;
274274 const sourceFile1 = path . join ( here , 'main.cpp' ) ;
275+ const headerFile1 = path . join ( here , 'main.h' ) ;
276+ const rcFile1 = path . join ( here , 'main.rc' ) ;
275277 const uri1 = vscode . Uri . file ( sourceFile1 ) ;
278+ const uri1_h = vscode . Uri . file ( headerFile1 ) ;
279+ const uri1_rc = vscode . Uri . file ( rcFile1 ) ;
276280 const codeModel1 : codeModel . CodeModelContent = {
277281 configurations : [ {
278282 name : "Release" ,
@@ -289,6 +293,16 @@ suite('CppTools tests', () => {
289293 defines : [ 'DEFINE1' ] ,
290294 compileCommandFragments : [ '-DFRAGMENT1' ] ,
291295 language : 'CXX'
296+ } ,
297+ {
298+ sources : [ headerFile1 ] ,
299+ isGenerated : false
300+ } ,
301+ {
302+ sources : [ rcFile1 ] ,
303+ isGenerated : false ,
304+ compileCommandFragments : [ '-DFRAGMENT_RC' ] ,
305+ language : 'RC'
292306 } ]
293307 } ,
294308 {
@@ -347,6 +361,12 @@ suite('CppTools tests', () => {
347361 expect ( configurations [ 0 ] . configuration . compilerFragments ) . to . contain ( '-DFRAGMENT1' ) ;
348362 expect ( configurations [ 0 ] . configuration . compilerArgs ) . to . be . empty ;
349363
364+ configurations = await provider . provideConfigurations ( [ uri1_h ] ) ;
365+ expect ( configurations [ 0 ] . configuration . compilerFragments ) . to . contain ( '-DFRAGMENT1' ) ;
366+
367+ configurations = await provider . provideConfigurations ( [ uri1_rc ] ) ;
368+ expect ( configurations [ 0 ] . configuration . compilerFragments ) . to . contain ( '-DFRAGMENT_RC' ) ;
369+
350370 provider . updateConfigurationData ( { cache, codeModelContent : codeModel1 , activeTarget : 'target2' , activeBuildTypeVariant : 'Release' , folder : here } ) ;
351371 configurations = await provider . provideConfigurations ( [ uri1 ] ) ;
352372 expect ( configurations . length ) . to . eq ( 1 ) ;
0 commit comments