eclipse-platform / eclipse.platform.swt

Eclipse SWT
https://www.eclipse.org/swt/
Eclipse Public License 2.0
112 stars 135 forks source link

Migrate win32 unit tests to JUnit 5 and reduce test visibility #1298 #1305

Closed HeikoKlare closed 3 months ago

HeikoKlare commented 3 months ago

This migrates the unit tests placed in the SWT win32 production fragments to JUnit 5. The visibility of the test classes is reduced to packaged protected as allowed by JUnit 5.

This resolves the API errors as reported in #1298.

Fixes https://github.com/eclipse-platform/eclipse.platform.swt/issues/1298

github-actions[bot] commented 3 months ago

Test Results

   470 files  ±0     470 suites  ±0   7m 59s :stopwatch: - 1m 10s  4 135 tests ±0   4 127 :white_check_mark: ±0   8 :zzz: ±0  0 :x: ±0  16 336 runs  ±0  16 244 :white_check_mark: ±0  92 :zzz: ±0  0 :x: ±0 

Results for commit 36cab269. ± Comparison against base commit f40502d5.

vogella commented 3 months ago

LGTM

HeikoKlare commented 3 months ago

Tests are still properly executed, even with reduced test class visibility after JUnit 5 migration:

[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.422 s -- in org.eclipse.swt.graphics.GCWin32Tests
[INFO] Running org.eclipse.swt.graphics.PathWin32Tests
[INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.031 s -- in org.eclipse.swt.graphics.PathWin32Tests
[INFO] Running org.eclipse.swt.graphics.TextLayoutWin32Tests
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.031 s -- in org.eclipse.swt.graphics.TextLayoutWin32Tests
[INFO] Running org.eclipse.swt.graphics.TransformWin32Tests
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.015 s -- in org.eclipse.swt.graphics.TransformWin32Tests
[INFO] Running org.eclipse.swt.internal.DefaultSWTFontRegistryTests
[INFO] Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.016 s -- in org.eclipse.swt.internal.DefaultSWTFontRegistryTests
[INFO] Running org.eclipse.swt.internal.ScalingSWTFontRegistryTests
[INFO] Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.015 s -- in org.eclipse.swt.internal.ScalingSWTFontRegistryTests
[INFO] Running org.eclipse.swt.widgets.ControlWin32Tests
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.016 s -- in org.eclipse.swt.widgets.ControlWin32Tests
[INFO] Running org.eclipse.swt.widgets.WidgetWin32Tests
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.078 s -- in org.eclipse.swt.widgets.WidgetWin32Tests
HeikoKlare commented 3 months ago

@merks are you fine with merging this as it subsumes your proposal #1303?

merks commented 3 months ago

@HeikoKlare

Of course that's fine. I only created the other PR because I already had it in my workspace for testing the effect.