File tree Expand file tree Collapse file tree 3 files changed +19
-6
lines changed Expand file tree Collapse file tree 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)
4242 testModule . IncludeDirs . Add ( path ) ;
4343
4444 Diagnostics . Message ( "Looking for tests in: {0}" , path ) ;
45- var files = Directory . EnumerateFiles ( path , "*.h" ) ;
45+ var files = Directory . EnumerateFiles ( path , "*.h" , SearchOption . AllDirectories ) ;
4646 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+ }
4753 testModule . Headers . Add ( Path . GetFileName ( file ) ) ;
54+ }
4855 }
4956
5057 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)
3131 includeDir = "." ;
3232 includeDir = Path . GetFullPath ( includeDir ) ;
3333
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 ;
3742 }
3843
3944 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
215215 Namespace parent = null ;
216216 if ( string . IsNullOrEmpty ( module . OutputNamespace ) )
217217 {
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 > (
219220 ) . GroupBy ( d => d . Name ) . Where ( g => g . Any ( d => d . HasDeclarations ) ) . ToList ( ) ;
220221 if ( groups . Count == 1 )
221222 parent = groups . Last ( ) . Last ( ) ;
@@ -231,7 +232,7 @@ private DeclarationContext GetDeclContextForDelegates(DeclarationContext @namesp
231232 }
232233
233234 if ( parent == null )
234- parent = module . Units . Last ( ) ;
235+ parent = module . Units . Last ( u => u . IsGenerated ) ;
235236
236237 var namespaceDelegates = new Namespace
237238 {
You can’t perform that action at this time.
0 commit comments