Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix SetupLogging not being called in game test scenario #6504

Merged
merged 2 commits into from
Jan 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using osu.Framework.Allocation;
using osu.Framework.Platform;
using NUnit.Framework;

namespace TemplateGame.Game.Tests.Visual
Expand All @@ -10,15 +9,10 @@ public partial class TestSceneTemplateGameGame : TemplateGameTestScene
// Add visual tests to ensure correct behaviour of your game: https://github.com/ppy/osu-framework/wiki/Development-and-Testing
// You can make changes to classes associated with the tests and they will recompile and update immediately.

private TemplateGameGame game;

[BackgroundDependencyLoader]
private void load(GameHost host)
private void load()
{
game = new TemplateGameGame();
game.SetHost(host);

AddGame(game);
AddGame(new TemplateGameGame());
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using osu.Framework.Allocation;
using osu.Framework.Platform;
using NUnit.Framework;

namespace FlappyDon.Game.Tests.Visual
Expand All @@ -11,14 +10,10 @@ namespace FlappyDon.Game.Tests.Visual
[TestFixture]
public partial class TestSceneFlappyDonGame : FlappyDonTestScene
{
private FlappyDonGame game;

[BackgroundDependencyLoader]
private void load(GameHost host)
private void load()
{
game = new FlappyDonGame();
game.SetHost(host);
AddGame(game);
AddGame(new FlappyDonGame());
}
}
}
1 change: 1 addition & 0 deletions osu.Framework/Testing/TestScene.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ protected void AddGame([NotNull] Game game)
exitNestedGame();

nestedGame = game;
nestedGame.SetupLogging(host.Storage, host.CacheStorage);
nestedGame.SetHost(host);

base.Add(nestedGame);
Expand Down
Loading