File tree Expand file tree Collapse file tree
ModVerify.CliApp/Settings
test/ModVerify.CliApp.Test Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -36,13 +36,14 @@ private AppVerifySettings BuildFromVerifyVerb(VerifyVerbOption verifyOptions)
3636 ParallelVerifiers = verifyOptions . Parallel ? 4 : 1 ,
3737 VerifiersProvider = new DefaultGameVerifiersProvider ( ) ,
3838 FailFastSettings = failFastSetting ,
39+ UseLiveVirtualFileSystem = true ,
3940 GameVerifySettings = new GameVerifySettings
4041 {
4142 IgnoreAsserts = verifyOptions . IgnoreAsserts ,
42- ThrowsOnMinimumSeverity = failFastSetting . IsFailFast
43+ ThrowsOnMinimumSeverity = failFastSetting . IsFailFast
4344 ? failFastSetting . MinumumSeverity
4445 // The app shall not make a specific verifier throw, but it should always run to completion.
45- : null
46+ : null
4647 }
4748 } ,
4849 AppFailsOnMinimumSeverity = verifyOptions . MinimumFailureSeverity ,
Original file line number Diff line number Diff line change 1818using Microsoft . Extensions . DependencyInjection ;
1919using Microsoft . Extensions . Logging ;
2020using PG . StarWarsGame . Engine ;
21+ using PG . StarWarsGame . Engine . IO ;
2122
2223namespace AET . ModVerify ;
2324
@@ -83,14 +84,18 @@ protected override async Task PrepareCoreAsync(CancellationToken token)
8384 try
8485 {
8586 var engineService = ServiceProvider . GetRequiredService < IPetroglyphStarWarsGameEngineService > ( ) ;
87+ Action < PetroglyphFileSystem > ? configureFs = _serviceSettings . UseLiveVirtualFileSystem
88+ ? static fs => fs . UseLiveVirtualStrategy ( )
89+ : null ;
90+
8691 _gameEngine = await engineService . InitializeAsync (
8792 _verificationTarget . Engine ,
8893 _verificationTarget . Location ,
8994 _engineErrorReporter ,
9095 _engineInitializationReporter ,
9196 false ,
92- configureFileSystem : fs => fs . UseLiveVirtualStrategy ( ) ,
93- cancellationToken : CancellationToken . None ) . ConfigureAwait ( false ) ;
97+ configureFs ,
98+ CancellationToken . None ) . ConfigureAwait ( false ) ;
9499 }
95100 catch ( Exception e )
96101 {
Original file line number Diff line number Diff line change @@ -9,4 +9,6 @@ public sealed class VerifierServiceSettings
99 public FailFastSetting FailFastSettings { get ; init ; } = FailFastSetting . NoFailFast ;
1010
1111 public int ParallelVerifiers { get ; init ; } = 4 ;
12+
13+ public bool UseLiveVirtualFileSystem { get ; init ; } = false ;
1214}
Original file line number Diff line number Diff line change @@ -107,4 +107,20 @@ public void BuildSettings_UseDefaultBaseline_Alone_DoesNotThrow()
107107 var settings = _builder . BuildSettings ( options ) ;
108108 Assert . NotNull ( settings ) ;
109109 }
110+
111+ [ Fact ]
112+ public void BuildSettings_VerifyVerb_UsesLiveVirtualFileSystem ( )
113+ {
114+ var options = new VerifyVerbOption { TargetPath = "myPath" } ;
115+ var settings = ( AppVerifySettings ) _builder . BuildSettings ( options ) ;
116+ Assert . True ( settings . VerifierServiceSettings . UseLiveVirtualFileSystem ) ;
117+ }
118+
119+ [ Fact ]
120+ public void BuildSettings_CreateBaselineVerb_DoesNotUseLiveVirtualFileSystem ( )
121+ {
122+ var options = new CreateBaselineVerbOption { TargetPath = "myPath" , OutputFile = "out.json" } ;
123+ var settings = ( AppBaselineSettings ) _builder . BuildSettings ( options ) ;
124+ Assert . False ( settings . VerifierServiceSettings . UseLiveVirtualFileSystem ) ;
125+ }
110126}
You can’t perform that action at this time.
0 commit comments