1
1
using System ;
2
2
using System . Collections . Generic ;
3
+ using System . Diagnostics ;
3
4
using System . IO ;
4
5
using System . Linq ;
5
6
using System . Reflection ;
@@ -62,9 +63,9 @@ private static bool ReproduceTest(FileInfo fileInfo, SuitType suitType, bool che
62
63
var debugAssertFailed = message != null && message . Contains ( "Debug.Assert failed" ) ;
63
64
bool shouldInvoke = suitType switch
64
65
{
65
- SuitType . TestsOnly => ! test . IsError ,
66
- SuitType . ErrorsOnly => test . IsError ,
67
- SuitType . TestsAndErrors => ! debugAssertFailed ,
66
+ SuitType . TestsOnly => ! test . IsError || fileMode ,
67
+ SuitType . ErrorsOnly => test . IsError || fileMode ,
68
+ SuitType . TestsAndErrors => ! debugAssertFailed || fileMode ,
68
69
_ => false
69
70
} ;
70
71
if ( shouldInvoke )
@@ -79,6 +80,7 @@ private static bool ReproduceTest(FileInfo fileInfo, SuitType suitType, bool che
79
80
}
80
81
if ( checkResult && ! test . IsError && ! CompareObjects ( test . Expected , result ) )
81
82
{
83
+ Debug . Assert ( shouldInvoke ) ;
82
84
// TODO: use NUnit?
83
85
Console . ForegroundColor = ConsoleColor . Red ;
84
86
Console . Error . WriteLine ( "Test {0} failed! Expected {1}, but got {2}" , fileInfo . Name ,
@@ -124,7 +126,7 @@ private static bool ReproduceTest(FileInfo fileInfo, SuitType suitType, bool che
124
126
public static bool ReproduceTest ( FileInfo file , bool checkResult )
125
127
{
126
128
AppDomain . CurrentDomain . AssemblyResolve += TryLoadAssemblyFrom ;
127
- return ReproduceTest ( file , SuitType . TestsAndErrors , checkResult ) ;
129
+ return ReproduceTest ( file , SuitType . TestsAndErrors , checkResult , true ) ;
128
130
}
129
131
130
132
public static bool ReproduceTests ( DirectoryInfo testsDir , SuitType suitType = SuitType . TestsAndErrors )
0 commit comments