Commit bcf41e4 1 parent 851ec5e commit bcf41e4 Copy full SHA for bcf41e4
File tree 3 files changed +19
-6
lines changed
3 files changed +19
-6
lines changed Original file line number Diff line number Diff line change @@ -42,9 +42,16 @@ public virtual void Setup(Driver driver)
42
42
testModule . IncludeDirs . Add ( path ) ;
43
43
44
44
Diagnostics . Message ( "Looking for tests in: {0}" , path ) ;
45
- var files = Directory . EnumerateFiles ( path , "*.h" ) ;
45
+ var files = Directory . EnumerateFiles ( path , "*.h" , SearchOption . AllDirectories ) ;
46
46
foreach ( var file in files )
47
+ {
48
+ string includeDir = Path . GetDirectoryName ( file ) ;
49
+ if ( ! testModule . IncludeDirs . Contains ( includeDir ) )
50
+ {
51
+ testModule . IncludeDirs . Add ( includeDir ) ;
52
+ }
47
53
testModule . Headers . Add ( Path . GetFileName ( file ) ) ;
54
+ }
48
55
}
49
56
50
57
public virtual void Preprocess ( Driver driver , ASTContext ctx )
Original file line number Diff line number Diff line change @@ -31,9 +31,14 @@ private Module GetModule(TranslationUnit unit)
31
31
includeDir = "." ;
32
32
includeDir = Path . GetFullPath ( includeDir ) ;
33
33
34
- return Options . Modules . FirstOrDefault (
35
- m => m . IncludeDirs . Any ( i => Path . GetFullPath ( i ) == includeDir ) ) ??
36
- Options . Modules [ 1 ] ;
34
+ Module module = Options . Modules . Find (
35
+ m => m . IncludeDirs . Any ( i => Path . GetFullPath ( i ) == includeDir ) ) ;
36
+ if ( module == null )
37
+ {
38
+ unit . ExplicitlyIgnore ( ) ;
39
+ module = Options . Modules [ 1 ] ;
40
+ }
41
+ return module ;
37
42
}
38
43
39
44
public override bool VisitDeclarationContext ( DeclarationContext context )
Original file line number Diff line number Diff line change @@ -215,7 +215,8 @@ private DeclarationContext GetDeclContextForDelegates(DeclarationContext @namesp
215
215
Namespace parent = null ;
216
216
if ( string . IsNullOrEmpty ( module . OutputNamespace ) )
217
217
{
218
- var groups = module . Units . SelectMany ( u => u . Declarations ) . OfType < Namespace > (
218
+ var groups = module . Units . Where ( u => u . IsGenerated ) . SelectMany (
219
+ u => u . Declarations ) . OfType < Namespace > (
219
220
) . GroupBy ( d => d . Name ) . Where ( g => g . Any ( d => d . HasDeclarations ) ) . ToList ( ) ;
220
221
if ( groups . Count == 1 )
221
222
parent = groups . Last ( ) . Last ( ) ;
@@ -231,7 +232,7 @@ private DeclarationContext GetDeclContextForDelegates(DeclarationContext @namesp
231
232
}
232
233
233
234
if ( parent == null )
234
- parent = module . Units . Last ( ) ;
235
+ parent = module . Units . Last ( u => u . IsGenerated ) ;
235
236
236
237
var namespaceDelegates = new Namespace
237
238
{
You can’t perform that action at this time.
0 commit comments