Fixes #3689. Release builds broken (#3690)

* Initial commit

* added #if DEBUG_IDISPOSABLE

* Tweaked yml
This commit is contained in:
Tig
2024-08-23 09:22:00 -06:00
committed by GitHub
parent 385a1913f7
commit e21f158077
3 changed files with 28 additions and 6 deletions

View File

@@ -11,7 +11,7 @@ on:
- '**.md'
jobs:
build_and_test:
build_and_test_debug:
runs-on: ${{ matrix.os }}
strategy:
@@ -23,7 +23,7 @@ jobs:
timeout-minutes: 10
steps:
# Build
# Build (Debug)
- name: Checkout code
uses: actions/checkout@v4
@@ -76,6 +76,24 @@ jobs:
logs/
UnitTests/TestResults/
build_release:
# Ensure that RELEASE builds are not broken
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.x
dotnet-quality: 'ga'
- name: Build Release
run: dotnet build --configuration Release
# Note: this step is currently not writing to the gist for some reason
# - name: Create Test Coverage Badge
# uses: simon-k/dotnet-code-coverage-badge@v1.0.0

View File

@@ -620,8 +620,9 @@ public class ColorPickerTests
var hex = GetTextField (cp, ColorPickerPart.Hex);
#if DEBUG_IDISPOSABLE
Assert.All (new View [] { b1, b2, b3, tf1, tf2, tf3,hex }, b => Assert.False (b.WasDisposed));
#endif
cp.Style.ColorModel = ColorModel.RGB;
cp.ApplyStyleChanges ();
@@ -636,7 +637,9 @@ public class ColorPickerTests
var hexAfter = GetTextField (cp, ColorPickerPart.Hex);
// Old bars should be disposed
#if DEBUG_IDISPOSABLE
Assert.All (new View [] { b1, b2, b3, tf1, tf2, tf3,hex }, b => Assert.True (b.WasDisposed));
#endif
Assert.NotSame (hex,hexAfter);
Assert.NotSame (b1,b1After);

View File

@@ -258,7 +258,7 @@ public partial class ToplevelTests (ITestOutputHelper output)
top.Remove (top.StatusBar);
Assert.Null (top.StatusBar);
Assert.NotNull (statusBar);
#if true
#if DEBUG_IDISPOSABLE
Assert.False (menuBar.WasDisposed);
Assert.False (statusBar.WasDisposed);
menuBar.Dispose ();
@@ -407,7 +407,8 @@ public partial class ToplevelTests (ITestOutputHelper output)
win.NewMouseEvent (new () { Position = new (6, 0), Flags = MouseFlags.Button1Pressed });
//Assert.Null (Toplevel._dragPosition);
#if true
#if DEBUG_IDISPOSABLE
Assert.False (top.MenuBar.WasDisposed);
Assert.False (top.StatusBar.WasDisposed);
#endif
@@ -418,7 +419,7 @@ public partial class ToplevelTests (ITestOutputHelper output)
Assert.Null (top.StatusBar);
Assert.NotNull (menuBar);
Assert.NotNull (statusBar);
#if true
#if DEBUG_IDISPOSABLE
Assert.True (menuBar.WasDisposed);
Assert.True (statusBar.WasDisposed);
#endif