File tree Expand file tree Collapse file tree 3 files changed +20
-17
lines changed
org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets Expand file tree Collapse file tree 3 files changed +20
-17
lines changed Original file line number Diff line number Diff line change @@ -26,13 +26,22 @@ jobs:
26
26
- dmd-2.085.1
27
27
- dmd-2.090.1
28
28
arch : [x86_64]
29
+ buildType : [unittest]
29
30
include :
30
31
- os : windows-2019
31
32
dc : dmd-latest
32
33
arch : x86
33
34
- os : windows-2019
34
35
dc : ldc-latest
35
36
arch : x86
37
+ - os : ubuntu-20.04
38
+ dc : dmd-latest
39
+ arch : x86_64
40
+ buildType : optimized-unittests
41
+ - os : ubuntu-20.04
42
+ dc : ldc-latest
43
+ arch : x86_64
44
+ buildType : optimized-unittests
36
45
runs-on : ${{ matrix.os }}
37
46
steps :
38
47
- name : Checkout Repository
62
71
libxext-dev libxfixes-dev libxi-dev libxinerama-dev libxrandr-dev \
63
72
libxrender-dev libxtst-dev
64
73
65
- - name : Test DWT Gtk
74
+ - name : Test DWT Gtk (${{ matrix.buildType }})
66
75
if : ${{ matrix.os == 'ubuntu-20.04' }}
67
76
uses : GabrielBB/xvfb-action@v1 # X virtual framebuffer
68
77
with :
69
78
working-directory : ./
70
- run : dub test -c unittest-gtk
79
+ run : dub test -c unittest-gtk -b ${{ matrix.buildType }}
Original file line number Diff line number Diff line change @@ -67,7 +67,11 @@ configuration "windows-win32" {
67
67
dependency ":base" version="*"
68
68
}
69
69
70
- # Test configurations
70
+ # unittest settings
71
+ buildType "optimized-unittests" {
72
+ buildOptions "optimize" "unittests"
73
+ }
74
+
71
75
configuration "unittest-gtk" {
72
76
platforms "linux"
73
77
Original file line number Diff line number Diff line change @@ -920,28 +920,19 @@ protected override void create (DeviceData data) {
920
920
if (Default is null ) Default = this ;
921
921
}
922
922
923
- private static extern (C) int XErrorHandler( void * , XErrorEvent* ){
924
- getDwtLogger().error ( __FILE__ , __LINE__ , " *** XError" );
925
- byte * p;
926
- * p = 3 ;
927
- return 0 ;
928
- }
929
-
930
923
void createDisplay (DeviceData data) {
931
924
/* Required for g_main_context_wakeup */
932
925
if (! OS .g_thread_supported ()) {
933
926
OS .g_thread_init (null );
934
927
}
935
928
OS .gtk_set_locale();
936
- int cnt = 2 ;
937
- auto args = [ " name " .ptr, " --sync " .ptr, " " .ptr ] ;
938
- auto a = args.ptr;
939
- if ( ! OS .gtk_init_check (&cnt, &a )) {
929
+ // DWT: Needed to pass int* to gtk_init_check
930
+ int argc = 0 ;
931
+ if ( ! OS .gtk_init_check (&argc, null )) {
932
+ SWT .error ( SWT . ERROR_NO_HANDLES , null , " [gtk_init_check() failed] " );
940
933
}
941
- assert ( cnt is 1 );
942
934
if (OS .GDK_WINDOWING_X11 ()) xDisplay = cast (void * ) OS .GDK_DISPLAY ();
943
935
944
- OS .XSetErrorHandler( &Display.XErrorHandler );
945
936
char * ptr = OS .gtk_check_version (MAJOR , MINOR , MICRO );
946
937
if (ptr ! is null ) {
947
938
char [] buffer = fromStringz(ptr);
@@ -4287,4 +4278,3 @@ package struct CallbackData {
4287
4278
Display display;
4288
4279
void * data;
4289
4280
}
4290
-
You can’t perform that action at this time.
0 commit comments