From 7cba593a85692d2bdb8dcaf9e5709e066292899d Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 30 Jan 2021 21:40:11 +0100 Subject: [PATCH 01/19] Fix ignoring paths for the GitHub CI builds This was broken in 52d63eedd2 (Don't rerun CI builds for docs-only changes, 2021-01-28) and no builds were run at all as the result. --- .github/workflows/ci.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bddc0b91c1..7f4f7dd368 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,15 +5,15 @@ on: push: branches: - master - paths: - - '!docs' - - '!interface' + paths-ignore: + - 'docs' + - 'interface' pull_request: branches: - master - paths: - - '!docs' - - '!interface' + paths-ignore: + - 'docs' + - 'interface' jobs: build: From c58dc66056c74ad8dcf3a066028b7e0f9ebd92b1 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 30 Jan 2021 21:31:55 +0100 Subject: [PATCH 02/19] Assume gcc compiler by default Don't require defining gcc key in all matrix elements. --- .github/workflows/ci.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7f4f7dd368..f166979c87 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,7 +24,6 @@ jobs: include: - name: wxGTK Ubuntu 20.04 with ASAN runner: ubuntu-20.04 - compiler: gcc configure_flags: --disable-compat30 --disable-sys-libs --with-libcurl gtk_version: 3 skip_samples: true @@ -62,11 +61,8 @@ jobs: allow_warn_opt="-Wno-error=#warnings" ;; - gcc) - echo CC=gcc >> $GITHUB_ENV - echo CXX=g++ >> $GITHUB_ENV - echo LD=g++ >> $GITHUB_ENV - + '') + # Assume gcc. allow_warn_opt="-Wno-error=cpp" ;; From 21fc24879983e83afbed719791f3e7fe444254a1 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 30 Jan 2021 21:32:37 +0100 Subject: [PATCH 03/19] Use GTK 3 by default Don't require defining gtk_version for all matrix elements neither. --- .github/workflows/ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f166979c87..c84ab5abec 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,11 +25,10 @@ jobs: - name: wxGTK Ubuntu 20.04 with ASAN runner: ubuntu-20.04 configure_flags: --disable-compat30 --disable-sys-libs --with-libcurl - gtk_version: 3 skip_samples: true use_asan: true env: - wxGTK_VERSION: ${{ matrix.gtk_version }} + wxGTK_VERSION: ${{ matrix.gtk_version && matrix.gtk_version || 3 }} wxCONFIGURE_FLAGS: ${{ matrix.configure_flags }} wxUSE_ASAN: ${{ matrix.use_asan && 1 || 0 }} From ce5f1351411a1040f9f957f499dc18e2daf9ae3e Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 30 Jan 2021 21:35:35 +0100 Subject: [PATCH 04/19] Fix allow_warnings check We should disallow warnings when this flag is not defined, not when it is. --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c84ab5abec..18e955e0c7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -70,7 +70,7 @@ jobs: ;; esac - if [ ${{ matrix.allow_warnings }} ]; then + if [ -z ${{ matrix.allow_warnings }} ]; then error_opts="-Werror $allow_warn_opt" echo "wxMAKEFILE_ERROR_CXXFLAGS=$error_opts" >> $GITHUB_ENV echo "wxMAKEFILE_CXXFLAGS=$wxMAKEFILE_CXXFLAGS $error_opts" >> $GITHUB_ENV From 9e3079a69556dd104406f720e0df84f61776be8b Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 30 Jan 2021 21:41:50 +0100 Subject: [PATCH 05/19] Define wxUSE_XVFB for GitHub CI builds too This is used in the test code to determine whether it's running under Xvfb. --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 18e955e0c7..3893f048c6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,6 +31,7 @@ jobs: wxGTK_VERSION: ${{ matrix.gtk_version && matrix.gtk_version || 3 }} wxCONFIGURE_FLAGS: ${{ matrix.configure_flags }} wxUSE_ASAN: ${{ matrix.use_asan && 1 || 0 }} + wxUSE_XVFB: ${{ matrix.use_xvfb && 1 || 0 }} steps: - name: Checkout From bc8f766b045425fd0535ef9a58cbff11c30d2a52 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 30 Jan 2021 21:36:14 +0100 Subject: [PATCH 06/19] Add other Linux builds using configure to GitHub Actions CI This is almost, although not quite, the same as we do in .travis.yml. Note that CMake builds are not supported here yet. --- .github/workflows/ci.yml | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3893f048c6..d91d7334b6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,13 +20,53 @@ jobs: runs-on: ${{ matrix.runner }} name: ${{ matrix.name }} strategy: + fail-fast: false matrix: include: + - name: wxGTK 2 Ubuntu 16.04 + runner: ubuntu-16.04 + gtk_version: 2 + - name: wxGTK 3 Ubuntu 16.04 static + runner: ubuntu-16.04 + configure_flags: --disable-shared + - name: wxGTK 2 UTF-8 Ubuntu 18.04 + runner: ubuntu-18.04 + gtk_version: 2 + configure_flags: --enable-utf8 --enable-utf8only --enable-monolithic + - name: wxGTK 3 STL Ubuntu 18.04 + runner: ubuntu-18.04 + configure_flags: --enable-cxx11 --enable-stl --disable-compat30 + - name: wxGTK 3 Ubuntu 18.04 with clang + runner: ubuntu-18.04 + compiler: clang + configure_flags: --disable-sys-libs --with-libcurl + - name: wxGTK ANSI Ubuntu 20.04 + runner: ubuntu-20.04 + configure_flags: --disable-unicode + skip_samples: true - name: wxGTK Ubuntu 20.04 with ASAN runner: ubuntu-20.04 configure_flags: --disable-compat30 --disable-sys-libs --with-libcurl skip_samples: true use_asan: true + - name: wxX11 Ubuntu 18.04 + runner: ubuntu-18.04 + configure_flags: --with-x11 --enable-pch --disable-stc + skip_samples: true + - name: wxDFB Ubuntu 18.04 + runner: ubuntu-18.04 + configure_flags: --with-directfb --enable-pch --disable-stc + skip_samples: true + allow_warnings: true + - name: wxMotif Ubuntu 18.04 + runner: ubuntu-18.04 + configure_flags: --with-motif --enable-pch --disable-stc + skip_samples: true + - name: wxQt Ubuntu 18.04 + runner: ubuntu-18.04 + configure_flags: --with-qt --enable-pch --without-opengl + skip_samples: true + env: wxGTK_VERSION: ${{ matrix.gtk_version && matrix.gtk_version || 3 }} wxCONFIGURE_FLAGS: ${{ matrix.configure_flags }} From 29030d0c05ee702a967a1c2d0f586b91f48cea0a Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 30 Jan 2021 22:40:10 +0100 Subject: [PATCH 07/19] Reformat the job names Try to make them appear more consistently in the Actions UI. No real changes. --- .github/workflows/ci.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d91d7334b6..1c63cf1d9e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,46 +23,46 @@ jobs: fail-fast: false matrix: include: - - name: wxGTK 2 Ubuntu 16.04 + - name: Ubuntu 16.04 wxGTK 2 runner: ubuntu-16.04 gtk_version: 2 - - name: wxGTK 3 Ubuntu 16.04 static + - name: Ubuntu 16.04 wxGTK 3 static runner: ubuntu-16.04 configure_flags: --disable-shared - - name: wxGTK 2 UTF-8 Ubuntu 18.04 + - name: Ubuntu 18.04 wxGTK 2 UTF-8 runner: ubuntu-18.04 gtk_version: 2 configure_flags: --enable-utf8 --enable-utf8only --enable-monolithic - - name: wxGTK 3 STL Ubuntu 18.04 + - name: Ubuntu 18.04 wxGTK 3 STL runner: ubuntu-18.04 configure_flags: --enable-cxx11 --enable-stl --disable-compat30 - - name: wxGTK 3 Ubuntu 18.04 with clang + - name: Ubuntu 18.04 wxGTK 3 with clang runner: ubuntu-18.04 compiler: clang configure_flags: --disable-sys-libs --with-libcurl - - name: wxGTK ANSI Ubuntu 20.04 + - name: Ubuntu 20.04 wxGTK ANSI runner: ubuntu-20.04 configure_flags: --disable-unicode skip_samples: true - - name: wxGTK Ubuntu 20.04 with ASAN + - name: Ubuntu 20.04 wxGTK with ASAN runner: ubuntu-20.04 configure_flags: --disable-compat30 --disable-sys-libs --with-libcurl skip_samples: true use_asan: true - - name: wxX11 Ubuntu 18.04 + - name: Ubuntu 18.04 wxX11 runner: ubuntu-18.04 configure_flags: --with-x11 --enable-pch --disable-stc skip_samples: true - - name: wxDFB Ubuntu 18.04 + - name: Ubuntu 18.04 wxDFB runner: ubuntu-18.04 configure_flags: --with-directfb --enable-pch --disable-stc skip_samples: true allow_warnings: true - - name: wxMotif Ubuntu 18.04 + - name: Ubuntu 18.04 wxMotif runner: ubuntu-18.04 configure_flags: --with-motif --enable-pch --disable-stc skip_samples: true - - name: wxQt Ubuntu 18.04 + - name: Ubuntu 18.04 wxQt runner: ubuntu-18.04 configure_flags: --with-qt --enable-pch --without-opengl skip_samples: true From bde95c388ceb409d7c6f986b6d4068ec9b37f5dd Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 30 Jan 2021 22:49:24 +0100 Subject: [PATCH 08/19] Fix linking of the GUI test when using static libraries We need to explicitly link with the system libraries required in this case, as static wxwebview library doesn't pull them in (it's also better to link with them explicitly even when using shared libraries, but in this case linking at least still worked due to transitive dependencies). --- tests/Makefile.in | 6 ++++-- tests/makefile.gcc | 4 ++-- tests/makefile.vc | 4 ++-- tests/test.bkl | 4 ++++ tests/test_vc7_test_allheaders.vcproj | 8 ++++---- tests/test_vc7_test_gui.vcproj | 8 ++++---- tests/test_vc8_test_allheaders.vcproj | 16 ++++++++-------- tests/test_vc8_test_gui.vcproj | 16 ++++++++-------- tests/test_vc9_test_allheaders.vcproj | 16 ++++++++-------- tests/test_vc9_test_gui.vcproj | 16 ++++++++-------- 10 files changed, 52 insertions(+), 46 deletions(-) diff --git a/tests/Makefile.in b/tests/Makefile.in index 7411ba28e2..2e9ed4409a 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -38,6 +38,8 @@ EXTRALIBS_XML = @EXTRALIBS_XML@ EXTRALIBS_HTML = @EXTRALIBS_HTML@ EXTRALIBS_MEDIA = @EXTRALIBS_MEDIA@ EXTRALIBS_GUI = @EXTRALIBS_GUI@ +EXTRALIBS_STC = @EXTRALIBS_STC@ +EXTRALIBS_WEBVIEW = @EXTRALIBS_WEBVIEW@ WX_CPPFLAGS = @WX_CPPFLAGS@ WX_CXXFLAGS = @WX_CXXFLAGS@ WX_LDFLAGS = @WX_LDFLAGS@ @@ -481,7 +483,7 @@ test$(EXEEXT): $(TEST_OBJECTS) @COND_SHARED_1_USE_GUI_1@ $(SHARED_LD_MODULE_CXX) $@ $(TEST_DRAWINGPLUGIN_OBJECTS) -L$(LIBDIRNAME) $(LDFLAGS) $(WX_LDFLAGS) $(__WXLIB_CORE_p) $(__WXLIB_BASE_p) $(__WXLIB_MONO_p) $(__LIB_SCINTILLA_IF_MONO_p) $(__LIB_TIFF_p) $(__LIB_JPEG_p) $(__LIB_PNG_p) $(EXTRALIBS_FOR_GUI) $(__LIB_ZLIB_p) $(__LIB_REGEX_p) $(__LIB_EXPAT_p) $(EXTRALIBS_FOR_BASE) $(LIBS) @COND_USE_GUI_1@test_gui$(EXEEXT): $(TEST_GUI_OBJECTS) $(__test_gui___win32rc) -@COND_USE_GUI_1@ $(CXX) -o $@ $(TEST_GUI_OBJECTS) -L$(LIBDIRNAME) $(SAMPLES_RPATH_FLAG) $(LDFLAGS) $(WX_LDFLAGS) $(__WXLIB_WEBVIEW_p) $(__WXLIB_STC_p) $(__WXLIB_AUI_p) $(__WXLIB_RICHTEXT_p) $(__WXLIB_MEDIA_p) $(EXTRALIBS_MEDIA) $(__WXLIB_XRC_p) $(__WXLIB_XML_p) $(EXTRALIBS_XML) $(__WXLIB_HTML_p) $(EXTRALIBS_HTML) $(__WXLIB_CORE_p) $(__WXLIB_NET_p) $(__WXLIB_BASE_p) $(__WXLIB_MONO_p) $(__LIB_SCINTILLA_IF_MONO_p) $(__LIB_TIFF_p) $(__LIB_JPEG_p) $(__LIB_PNG_p) $(EXTRALIBS_FOR_GUI) $(__LIB_ZLIB_p) $(__LIB_REGEX_p) $(__LIB_EXPAT_p) $(EXTRALIBS_FOR_BASE) $(LIBS) +@COND_USE_GUI_1@ $(CXX) -o $@ $(TEST_GUI_OBJECTS) -L$(LIBDIRNAME) $(SAMPLES_RPATH_FLAG) $(LDFLAGS) $(WX_LDFLAGS) $(__WXLIB_WEBVIEW_p) $(EXTRALIBS_WEBVIEW) $(__WXLIB_STC_p) $(EXTRALIBS_STC) $(__WXLIB_AUI_p) $(__WXLIB_RICHTEXT_p) $(__WXLIB_MEDIA_p) $(EXTRALIBS_MEDIA) $(__WXLIB_XRC_p) $(__WXLIB_XML_p) $(EXTRALIBS_XML) $(__WXLIB_HTML_p) $(EXTRALIBS_HTML) $(__WXLIB_CORE_p) $(__WXLIB_NET_p) $(__WXLIB_BASE_p) $(__WXLIB_MONO_p) $(__LIB_SCINTILLA_IF_MONO_p) $(__LIB_TIFF_p) $(__LIB_JPEG_p) $(__LIB_PNG_p) $(EXTRALIBS_FOR_GUI) $(__LIB_ZLIB_p) $(__LIB_REGEX_p) $(__LIB_EXPAT_p) $(EXTRALIBS_FOR_BASE) $(LIBS) @COND_PLATFORM_MACOSX_1_USE_GUI_1@test_gui.app/Contents/PkgInfo: $(__test_gui___depname) $(top_srcdir)/src/osx/carbon/Info.plist.in $(top_srcdir)/src/osx/carbon/wxmac.icns @COND_PLATFORM_MACOSX_1_USE_GUI_1@ mkdir -p test_gui.app/Contents @@ -509,7 +511,7 @@ test$(EXEEXT): $(TEST_OBJECTS) @COND_USE_PCH_1@ $(BK_MAKE_PCH) ./.pch/testprec_test_gui/testprec.h.gch testprec.h $(CXX) $(TEST_GUI_CXXFLAGS) @COND_USE_GUI_1@test_allheaders$(EXEEXT): $(TEST_ALLHEADERS_OBJECTS) $(__test_allheaders___win32rc) -@COND_USE_GUI_1@ $(CXX) -o $@ $(TEST_ALLHEADERS_OBJECTS) -L$(LIBDIRNAME) $(SAMPLES_RPATH_FLAG) $(LDFLAGS) $(WX_LDFLAGS) $(__WXLIB_WEBVIEW_p) $(__WXLIB_STC_p) $(__WXLIB_CORE_p) $(__WXLIB_NET_p) $(__WXLIB_BASE_p) $(__WXLIB_MONO_p) $(__LIB_SCINTILLA_IF_MONO_p) $(__LIB_TIFF_p) $(__LIB_JPEG_p) $(__LIB_PNG_p) $(EXTRALIBS_FOR_GUI) $(__LIB_ZLIB_p) $(__LIB_REGEX_p) $(__LIB_EXPAT_p) $(EXTRALIBS_FOR_BASE) $(LIBS) +@COND_USE_GUI_1@ $(CXX) -o $@ $(TEST_ALLHEADERS_OBJECTS) -L$(LIBDIRNAME) $(SAMPLES_RPATH_FLAG) $(LDFLAGS) $(WX_LDFLAGS) $(__WXLIB_WEBVIEW_p) $(EXTRALIBS_WEBVIEW) $(__WXLIB_STC_p) $(EXTRALIBS_STC) $(__WXLIB_CORE_p) $(__WXLIB_NET_p) $(__WXLIB_BASE_p) $(__WXLIB_MONO_p) $(__LIB_SCINTILLA_IF_MONO_p) $(__LIB_TIFF_p) $(__LIB_JPEG_p) $(__LIB_PNG_p) $(EXTRALIBS_FOR_GUI) $(__LIB_ZLIB_p) $(__LIB_REGEX_p) $(__LIB_EXPAT_p) $(EXTRALIBS_FOR_BASE) $(LIBS) @COND_PLATFORM_MACOSX_1_USE_GUI_1@test_allheaders.app/Contents/PkgInfo: $(__test_allheaders___depname) $(top_srcdir)/src/osx/carbon/Info.plist.in $(top_srcdir)/src/osx/carbon/wxmac.icns @COND_PLATFORM_MACOSX_1_USE_GUI_1@ mkdir -p test_allheaders.app/Contents diff --git a/tests/makefile.gcc b/tests/makefile.gcc index a8e7e2fd1b..3de7e88824 100644 --- a/tests/makefile.gcc +++ b/tests/makefile.gcc @@ -534,7 +534,7 @@ ifeq ($(USE_GUI),1) $(OBJS)\test_gui.exe: $(TEST_GUI_OBJECTS) $(OBJS)\test_gui_sample_rc.o $(foreach f,$(subst \,/,$(TEST_GUI_OBJECTS)),$(shell echo $f >> $(subst \,/,$@).rsp.tmp)) @move /y $@.rsp.tmp $@.rsp >nul - $(CXX) -o $@ @$@.rsp $(__DEBUGINFO) $(__THREADSFLAG) -L$(LIBDIRNAME) $(____CAIRO_LIBDIR_FILENAMES) $(LDFLAGS) $(__WXLIB_WEBVIEW_p) $(__WXLIB_STC_p) $(__WXLIB_AUI_p) $(__WXLIB_RICHTEXT_p) $(__WXLIB_MEDIA_p) $(__WXLIB_XRC_p) $(__WXLIB_XML_p) $(__WXLIB_HTML_p) $(__WXLIB_CORE_p) $(__WXLIB_NET_p) $(__WXLIB_BASE_p) $(__WXLIB_MONO_p) $(__LIB_SCINTILLA_IF_MONO_p) $(__LIB_TIFF_p) $(__LIB_JPEG_p) $(__LIB_PNG_p) -lwxzlib$(WXDEBUGFLAG) -lwxregex$(WXUNICODEFLAG)$(WXDEBUGFLAG) -lwxexpat$(WXDEBUGFLAG) $(EXTRALIBS_FOR_BASE) $(__CAIRO_LIB_p) -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lwinspool -lwinmm -lshell32 -lshlwapi -lcomctl32 -lole32 -loleaut32 -luuid -lrpcrt4 -ladvapi32 -lversion -lwsock32 -lwininet -loleacc -luxtheme + $(CXX) -o $@ @$@.rsp $(__DEBUGINFO) $(__THREADSFLAG) -L$(LIBDIRNAME) $(____CAIRO_LIBDIR_FILENAMES) $(LDFLAGS) $(__WXLIB_WEBVIEW_p) $(__WXLIB_STC_p) -limm32 $(__WXLIB_AUI_p) $(__WXLIB_RICHTEXT_p) $(__WXLIB_MEDIA_p) $(__WXLIB_XRC_p) $(__WXLIB_XML_p) $(__WXLIB_HTML_p) $(__WXLIB_CORE_p) $(__WXLIB_NET_p) $(__WXLIB_BASE_p) $(__WXLIB_MONO_p) $(__LIB_SCINTILLA_IF_MONO_p) $(__LIB_TIFF_p) $(__LIB_JPEG_p) $(__LIB_PNG_p) -lwxzlib$(WXDEBUGFLAG) -lwxregex$(WXUNICODEFLAG)$(WXDEBUGFLAG) -lwxexpat$(WXDEBUGFLAG) $(EXTRALIBS_FOR_BASE) $(__CAIRO_LIB_p) -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lwinspool -lwinmm -lshell32 -lshlwapi -lcomctl32 -lole32 -loleaut32 -luuid -lrpcrt4 -ladvapi32 -lversion -lwsock32 -lwininet -loleacc -luxtheme @-del $@.rsp endif @@ -542,7 +542,7 @@ ifeq ($(USE_GUI),1) $(OBJS)\test_allheaders.exe: $(TEST_ALLHEADERS_OBJECTS) $(OBJS)\test_allheaders_sample_rc.o $(foreach f,$(subst \,/,$(TEST_ALLHEADERS_OBJECTS)),$(shell echo $f >> $(subst \,/,$@).rsp.tmp)) @move /y $@.rsp.tmp $@.rsp >nul - $(CXX) -o $@ @$@.rsp $(__DEBUGINFO) $(__THREADSFLAG) -L$(LIBDIRNAME) $(____CAIRO_LIBDIR_FILENAMES) $(LDFLAGS) $(__WXLIB_WEBVIEW_p) $(__WXLIB_STC_p) $(__WXLIB_CORE_p) $(__WXLIB_NET_p) $(__WXLIB_BASE_p) $(__WXLIB_MONO_p) $(__LIB_SCINTILLA_IF_MONO_p) $(__LIB_TIFF_p) $(__LIB_JPEG_p) $(__LIB_PNG_p) -lwxzlib$(WXDEBUGFLAG) -lwxregex$(WXUNICODEFLAG)$(WXDEBUGFLAG) -lwxexpat$(WXDEBUGFLAG) $(EXTRALIBS_FOR_BASE) $(__CAIRO_LIB_p) -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lwinspool -lwinmm -lshell32 -lshlwapi -lcomctl32 -lole32 -loleaut32 -luuid -lrpcrt4 -ladvapi32 -lversion -lwsock32 -lwininet -loleacc -luxtheme + $(CXX) -o $@ @$@.rsp $(__DEBUGINFO) $(__THREADSFLAG) -L$(LIBDIRNAME) $(____CAIRO_LIBDIR_FILENAMES) $(LDFLAGS) $(__WXLIB_WEBVIEW_p) $(__WXLIB_STC_p) -limm32 $(__WXLIB_CORE_p) $(__WXLIB_NET_p) $(__WXLIB_BASE_p) $(__WXLIB_MONO_p) $(__LIB_SCINTILLA_IF_MONO_p) $(__LIB_TIFF_p) $(__LIB_JPEG_p) $(__LIB_PNG_p) -lwxzlib$(WXDEBUGFLAG) -lwxregex$(WXUNICODEFLAG)$(WXDEBUGFLAG) -lwxexpat$(WXDEBUGFLAG) $(EXTRALIBS_FOR_BASE) $(__CAIRO_LIB_p) -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lwinspool -lwinmm -lshell32 -lshlwapi -lcomctl32 -lole32 -loleaut32 -luuid -lrpcrt4 -ladvapi32 -lversion -lwsock32 -lwininet -loleacc -luxtheme @-del $@.rsp endif diff --git a/tests/makefile.vc b/tests/makefile.vc index 59a26828c4..bf64776efe 100644 --- a/tests/makefile.vc +++ b/tests/makefile.vc @@ -969,14 +969,14 @@ $(OBJS)\test_drawingplugin.dll: $(TEST_DRAWINGPLUGIN_OBJECTS) !if "$(USE_GUI)" == "1" $(OBJS)\test_gui.exe: $(OBJS)\test_gui_dummy.obj $(TEST_GUI_OBJECTS) $(OBJS)\test_gui_sample.res link /NOLOGO /OUT:$@ $(__DEBUGINFO_5) /pdb:"$(OBJS)\test_gui.pdb" $(__DEBUGINFO_51) $(LINK_TARGET_CPU) /LIBPATH:$(LIBDIRNAME) $(WIN32_DPI_LINKFLAG) /SUBSYSTEM:CONSOLE $(____CAIRO_LIBDIR_FILENAMES) $(LDFLAGS) @<< - $(TEST_GUI_OBJECTS) $(TEST_GUI_RESOURCES) $(__WXLIB_WEBVIEW_p) $(__WXLIB_STC_p) $(__WXLIB_AUI_p) $(__WXLIB_RICHTEXT_p) $(__WXLIB_MEDIA_p) $(__WXLIB_XRC_p) $(__WXLIB_XML_p) $(__WXLIB_HTML_p) $(__WXLIB_CORE_p) $(__WXLIB_NET_p) $(__WXLIB_BASE_p) $(__WXLIB_MONO_p) $(__LIB_SCINTILLA_IF_MONO_p) $(__LIB_TIFF_p) $(__LIB_JPEG_p) $(__LIB_PNG_p) wxzlib$(WXDEBUGFLAG).lib wxregex$(WXUNICODEFLAG)$(WXDEBUGFLAG).lib wxexpat$(WXDEBUGFLAG).lib $(EXTRALIBS_FOR_BASE) $(__CAIRO_LIB_p) kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib + $(TEST_GUI_OBJECTS) $(TEST_GUI_RESOURCES) $(__WXLIB_WEBVIEW_p) $(__WXLIB_STC_p) imm32.lib $(__WXLIB_AUI_p) $(__WXLIB_RICHTEXT_p) $(__WXLIB_MEDIA_p) $(__WXLIB_XRC_p) $(__WXLIB_XML_p) $(__WXLIB_HTML_p) $(__WXLIB_CORE_p) $(__WXLIB_NET_p) $(__WXLIB_BASE_p) $(__WXLIB_MONO_p) $(__LIB_SCINTILLA_IF_MONO_p) $(__LIB_TIFF_p) $(__LIB_JPEG_p) $(__LIB_PNG_p) wxzlib$(WXDEBUGFLAG).lib wxregex$(WXUNICODEFLAG)$(WXDEBUGFLAG).lib wxexpat$(WXDEBUGFLAG).lib $(EXTRALIBS_FOR_BASE) $(__CAIRO_LIB_p) kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib << !endif !if "$(USE_GUI)" == "1" $(OBJS)\test_allheaders.exe: $(OBJS)\test_allheaders_dummy.obj $(TEST_ALLHEADERS_OBJECTS) $(OBJS)\test_allheaders_sample.res link /NOLOGO /OUT:$@ $(__DEBUGINFO_5) /pdb:"$(OBJS)\test_allheaders.pdb" $(__DEBUGINFO_68) $(LINK_TARGET_CPU) /LIBPATH:$(LIBDIRNAME) $(WIN32_DPI_LINKFLAG) /SUBSYSTEM:CONSOLE $(____CAIRO_LIBDIR_FILENAMES) $(LDFLAGS) @<< - $(TEST_ALLHEADERS_OBJECTS) $(TEST_ALLHEADERS_RESOURCES) $(__WXLIB_WEBVIEW_p) $(__WXLIB_STC_p) $(__WXLIB_CORE_p) $(__WXLIB_NET_p) $(__WXLIB_BASE_p) $(__WXLIB_MONO_p) $(__LIB_SCINTILLA_IF_MONO_p) $(__LIB_TIFF_p) $(__LIB_JPEG_p) $(__LIB_PNG_p) wxzlib$(WXDEBUGFLAG).lib wxregex$(WXUNICODEFLAG)$(WXDEBUGFLAG).lib wxexpat$(WXDEBUGFLAG).lib $(EXTRALIBS_FOR_BASE) $(__CAIRO_LIB_p) kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib + $(TEST_ALLHEADERS_OBJECTS) $(TEST_ALLHEADERS_RESOURCES) $(__WXLIB_WEBVIEW_p) $(__WXLIB_STC_p) imm32.lib $(__WXLIB_CORE_p) $(__WXLIB_NET_p) $(__WXLIB_BASE_p) $(__WXLIB_MONO_p) $(__LIB_SCINTILLA_IF_MONO_p) $(__LIB_TIFF_p) $(__LIB_JPEG_p) $(__LIB_PNG_p) wxzlib$(WXDEBUGFLAG).lib wxregex$(WXUNICODEFLAG)$(WXDEBUGFLAG).lib wxexpat$(WXDEBUGFLAG).lib $(EXTRALIBS_FOR_BASE) $(__CAIRO_LIB_p) kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib shlwapi.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib version.lib wsock32.lib wininet.lib << !endif diff --git a/tests/test.bkl b/tests/test.bkl index cf13a29326..ddc3b8b2c1 100644 --- a/tests/test.bkl +++ b/tests/test.bkl @@ -289,7 +289,9 @@ wxWebView or wxSTC is not available. --> $(WXLIB_WEBVIEW) + $(EXTRALIBS_WEBVIEW) $(WXLIB_STC) + $(EXTRALIBS_STC) aui richtext media @@ -320,7 +322,9 @@ wxWebView or wxSTC is not available. --> $(WXLIB_WEBVIEW) + $(EXTRALIBS_WEBVIEW) $(WXLIB_STC) + $(EXTRALIBS_STC) core net base diff --git a/tests/test_vc7_test_allheaders.vcproj b/tests/test_vc7_test_allheaders.vcproj index 10d59826fe..2b32664bb6 100644 --- a/tests/test_vc7_test_allheaders.vcproj +++ b/tests/test_vc7_test_allheaders.vcproj @@ -49,7 +49,7 @@ Date: Sat, 30 Jan 2021 23:15:09 +0100 Subject: [PATCH 09/19] Recognize GitHub Actions as a CI environment in the test This is necessary to activate the existing workarounds in the GUI tests. --- tests/test.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/test.cpp b/tests/test.cpp index b59347da91..e8a842da14 100644 --- a/tests/test.cpp +++ b/tests/test.cpp @@ -405,10 +405,11 @@ extern bool IsAutomaticTest() s_isAutomatic = username == wxASCII_STR("buildbot") || username.Matches(wxASCII_STR("sandbox*")); - // Also recognize Travis and AppVeyor CI environments. + // Also recognize various CI environments. if ( !s_isAutomatic ) { s_isAutomatic = wxGetEnv(wxASCII_STR("TRAVIS"), NULL) || + wxGetEnv(wxASCII_STR("GITHUB_ACTIONS"), NULL) || wxGetEnv(wxASCII_STR("APPVEYOR"), NULL); } } From fd3897c2ab2c05fdc7909b46ca82d8db34c5ace6 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 30 Jan 2021 22:53:43 +0100 Subject: [PATCH 10/19] Enable GUI tests for the selected builds --- .github/workflows/ci.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1c63cf1d9e..23027117c8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,20 +26,25 @@ jobs: - name: Ubuntu 16.04 wxGTK 2 runner: ubuntu-16.04 gtk_version: 2 + use_xvfb: true - name: Ubuntu 16.04 wxGTK 3 static runner: ubuntu-16.04 configure_flags: --disable-shared + use_xvfb: true - name: Ubuntu 18.04 wxGTK 2 UTF-8 runner: ubuntu-18.04 gtk_version: 2 configure_flags: --enable-utf8 --enable-utf8only --enable-monolithic + use_xvfb: true - name: Ubuntu 18.04 wxGTK 3 STL runner: ubuntu-18.04 configure_flags: --enable-cxx11 --enable-stl --disable-compat30 + use_xvfb: true - name: Ubuntu 18.04 wxGTK 3 with clang runner: ubuntu-18.04 compiler: clang configure_flags: --disable-sys-libs --with-libcurl + use_xvfb: true - name: Ubuntu 20.04 wxGTK ANSI runner: ubuntu-20.04 configure_flags: --disable-unicode @@ -49,6 +54,7 @@ jobs: configure_flags: --disable-compat30 --disable-sys-libs --with-libcurl skip_samples: true use_asan: true + use_xvfb: true - name: Ubuntu 18.04 wxX11 runner: ubuntu-18.04 configure_flags: --with-x11 --enable-pch --disable-stc From 07dfc18cc0bad88a125bc3792d24389c781b188d Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 31 Jan 2021 00:09:48 +0100 Subject: [PATCH 11/19] Disable wxWebView in ASAN CI build Running wxWebView tests with ASAN results in "ASan runtime does not come first in initial library list" warnings and doesn't work currently, so disable wxWebView in this build for now to have a chance of passing the tests. It would be better to actually fix this, of course, but this will have to wait until later. --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 23027117c8..66bc2ec0a8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -51,7 +51,7 @@ jobs: skip_samples: true - name: Ubuntu 20.04 wxGTK with ASAN runner: ubuntu-20.04 - configure_flags: --disable-compat30 --disable-sys-libs --with-libcurl + configure_flags: --disable-compat30 --disable-sys-libs --with-libcurl --disable-webview skip_samples: true use_asan: true use_xvfb: true From 367930f57d36754858de83564ee45438b0ece8a1 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 31 Jan 2021 00:14:28 +0100 Subject: [PATCH 12/19] Fix setting LSAN_OPTIONS Export them in the step running the test, not when configuring. --- .github/workflows/ci.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 66bc2ec0a8..60c15d0fe1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -137,8 +137,6 @@ jobs: fi if [ ${{ matrix.use_asan }} ]; then - export LSAN_OPTIONS=suppressions=$(pwd)/misc/suppressions/lsan - wxASAN_CFLAGS="-fsanitize=address -fno-omit-frame-pointer" wxASAN_CXXFLAGS=$wxASAN_CFLAGS wxASAN_LDFLAGS="-fsanitize=address" @@ -192,6 +190,9 @@ jobs: - name: Testing GUI using Xvfb if: matrix.skip_testing != true && matrix.skip_gui != true && matrix.use_xvfb run: | + if [ ${{ matrix.use_asan }} ]; then + export LSAN_OPTIONS=suppressions=$(pwd)/misc/suppressions/lsan + fi pushd tests xvfb-run -a -s '-screen 0 1600x1200x24' ./test_gui popd From e0a927af94545d4accdde9549eaf8a92fb7ac86a Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 31 Jan 2021 00:28:08 +0100 Subject: [PATCH 13/19] Wait for wxDataViewCtrl relayout under GTK in the unit test A single wxYield() doesn't seem to be enough, at least not when running in GitHub Actions environment, so wait for a longer time. --- tests/controls/dataviewctrltest.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/tests/controls/dataviewctrltest.cpp b/tests/controls/dataviewctrltest.cpp index f970c886b2..ffca55b260 100644 --- a/tests/controls/dataviewctrltest.cpp +++ b/tests/controls/dataviewctrltest.cpp @@ -329,9 +329,18 @@ TEST_CASE_METHOD(SingleSelectDataViewCtrlTestCase, m_dvc->EnsureVisible(last); #ifdef __WXGTK__ - // And again to let it scroll the correct items into view. - wxYield(); -#endif + // Wait for the list control to be relaid out. + wxStopWatch sw; + while ( m_dvc->GetTopItem() == m_root ) + { + if ( sw.Time() > 500 ) + { + WARN("Timed out waiting for wxDataViewCtrl layout"); + break; + } + wxYield(); + } +#endif // __WXGTK__ // Check that this was indeed the case. const wxDataViewItem top = m_dvc->GetTopItem(); From 4da635e2dc1a87b266aac701925c82184fdec735 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 31 Jan 2021 00:29:31 +0100 Subject: [PATCH 14/19] Simplify WaitForPaint::YieldUntilPainted() Don't return anything from it, just warn directly -- this is what all the existing callers did, so it's simpler if the function just does it itself instead of forcing them to check its return value. Also reset m_painted after yielding, so that YieldUntilPainted() could be called again, if necessary. --- tests/controls/gridtest.cpp | 5 +---- tests/waitforpaint.h | 18 ++++++++++++------ tests/window/setsize.cpp | 5 +---- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/tests/controls/gridtest.cpp b/tests/controls/gridtest.cpp index 72d6f8ae4b..2b99364655 100644 --- a/tests/controls/gridtest.cpp +++ b/tests/controls/gridtest.cpp @@ -122,10 +122,7 @@ GridTestCase::GridTestCase() m_grid->Refresh(); m_grid->Update(); - if ( !waitForPaint.YieldUntilPainted() ) - { - WARN("Grid not repainted until timeout expiration"); - } + waitForPaint.YieldUntilPainted(); } GridTestCase::~GridTestCase() diff --git a/tests/waitforpaint.h b/tests/waitforpaint.h index 481fcc8b9a..0a1891901b 100644 --- a/tests/waitforpaint.h +++ b/tests/waitforpaint.h @@ -29,8 +29,8 @@ public: } // This function waits up to the given number of milliseconds for the paint - // event to come and returns true if we did get it or false otherwise. - bool YieldUntilPainted(int timeoutInMS = 250) const + // event to come and logs a warning if we didn't get it. + void YieldUntilPainted(int timeoutInMS = 250) { wxStopWatch sw; for ( ;; ) @@ -38,10 +38,17 @@ public: wxYield(); if ( m_painted ) - return true; + { + // Reset it in case YieldUntilPainted() is called again. + m_painted = false; + break; + } if ( sw.Time() > timeoutInMS ) - return false; + { + WARN("Didn't get a paint event until timeout expiration"); + break; + } } } @@ -85,9 +92,8 @@ public: { } - bool YieldUntilPainted(int WXUNUSED(timeoutInMS) = 250) const + void YieldUntilPainted(int WXUNUSED(timeoutInMS) = 250) { - return true; } }; diff --git a/tests/window/setsize.cpp b/tests/window/setsize.cpp index e65861e57d..566f84fd54 100644 --- a/tests/window/setsize.cpp +++ b/tests/window/setsize.cpp @@ -98,10 +98,7 @@ TEST_CASE("wxWindow::MovePreservesSize", "[window][size][move]") w->Show(); - if ( !waitForPaint.YieldUntilPainted() ) - { - WARN("Didn't get a paint event until timeout expiration"); - } + waitForPaint.YieldUntilPainted(); const wxRect rectOrig = w->GetRect(); From 0718f641f5410dead76cfb4a0a9220ec553b851f Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 31 Jan 2021 02:16:21 +0100 Subject: [PATCH 15/19] Install more debug symbols for ASAN builds Install glib and gtk symbols which are required to get full information from the LeakSanitizer stack traces. --- build/tools/before_install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/tools/before_install.sh b/build/tools/before_install.sh index 374b5823ff..378d9b00b8 100755 --- a/build/tools/before_install.sh +++ b/build/tools/before_install.sh @@ -61,7 +61,7 @@ case $(uname -s) in $SUDO apt-get update # Install the symbols to allow LSAN suppression list to work. - $SUDO apt-get install -y libfontconfig1-dbgsym + $SUDO apt-get install -y libfontconfig1-dbgsym libglib2.0-0-dbgsym libgtk-3-0-dbgsym fi fi ;; From 2aba3ad0e177d34bfd435823daedca395767acb5 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 31 Jan 2021 14:32:55 +0100 Subject: [PATCH 16/19] Ignore leak from atk_bridge_adaptor_init() when using ASAN There doesn't seem to be any way to avoid calling it or freeing (multiple) memory blocks allocated by it. --- build/tools/before_install.sh | 2 +- misc/suppressions/lsan | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/build/tools/before_install.sh b/build/tools/before_install.sh index 378d9b00b8..a88f9d2987 100755 --- a/build/tools/before_install.sh +++ b/build/tools/before_install.sh @@ -61,7 +61,7 @@ case $(uname -s) in $SUDO apt-get update # Install the symbols to allow LSAN suppression list to work. - $SUDO apt-get install -y libfontconfig1-dbgsym libglib2.0-0-dbgsym libgtk-3-0-dbgsym + $SUDO apt-get install -y libfontconfig1-dbgsym libglib2.0-0-dbgsym libgtk-3-0-dbgsym libatk-bridge2.0-0-dbgsym fi fi ;; diff --git a/misc/suppressions/lsan b/misc/suppressions/lsan index 694ce9f9b6..8d67265369 100644 --- a/misc/suppressions/lsan +++ b/misc/suppressions/lsan @@ -8,3 +8,7 @@ leak:FcLangSetCreate leak:FcPatternObjectInsertElt leak:FcValueListCreate leak:FcValueSave + +# This leak happens during GTK initialization. Requires debug symbols for +# libatk-bridge2.0. +leak:atk_bridge_adaptor_init From ef1bf6df1f01a9e26e5c7f348ed576d411195efe Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 31 Jan 2021 14:34:01 +0100 Subject: [PATCH 17/19] Disable fast unwind on malloc in ASAN builds This makes things much, much slower, but unfortunately seems to be the only way to avoid memory leak reports when running the tests as without it the suppression is not used because the stack is truncated, i.e. we only see Direct leak of 24 byte(s) in 1 object(s) allocated from: #0 0x7f0968253bc8 in malloc (/lib/x86_64-linux-gnu/libasan.so.5+0x10dbc8) #1 0x7f09675aacb8 in g_malloc ../../../glib/gmem.c:102 in the output when the actual stack, seen with fast_unwind_on_malloc=0, is Direct leak of 24 byte(s) in 1 object(s) allocated from: #0 0x7f12b913bbc8 in malloc (/lib/x86_64-linux-gnu/libasan.so.5+0x10dbc8) #1 0x7f12b8496cd8 in g_malloc ../../../glib/gmem.c:102 #2 0x7f12b84b0f93 in g_strdup ../../../glib/gstrfuncs.c:363 #3 0x7f12b49adb2a in atk_bridge_adaptor_init ../atk-adaptor/bridge.c:1039 #4 0x7f12b566d753 in _gtk_accessibility_init ../../../../gtk/a11y/gtkaccessibility.c:992 #5 0x7f12b5821cfc in default_display_notify_cb ../../../../gtk/gtkmain.c:714 #6 0x7f12b5589801 in g_closure_invoke ../../../gobject/gclosure.c:810 #7 0x7f12b559d813 in signal_emit_unlocked_R ../../../gobject/gsignal.c:3742 #8 0x7f12b55a8b9d in g_signal_emit_valist ../../../gobject/gsignal.c:3498 #9 0x7f12b55a90d2 in g_signal_emit ../../../gobject/gsignal.c:3554 #10 0x7f12b558e283 in g_object_dispatch_properties_changed ../../../gobject/gobject.c:1206 #11 0x7f12b55906f1 in g_object_notify_by_spec_internal ../../../gobject/gobject.c:1299 #12 0x7f12b55906f1 in g_object_notify ../../../gobject/gobject.c:1347 #13 0x7f12b5dbf54f in _gdk_display_manager_add_display ../../../../gdk/gdkdisplaymanager.c:479 #14 0x7f12b5589a55 in _g_closure_invoke_va ../../../gobject/gclosure.c:873 #15 0x7f12b55a8b27 in g_signal_emit_valist ../../../gobject/gsignal.c:3407 #16 0x7f12b55a9b7b in g_signal_emit_by_name ../../../gobject/gsignal.c:3594 #17 0x7f12b5ded21a in _gdk_x11_display_open ../../../../../gdk/x11/gdkdisplay-x11.c:1803 #18 0x7f12b5dbf377 in gdk_display_manager_open_display ../../../../gdk/gdkdisplaymanager.c:462 #19 0x7f12b5822f6a in gtk_init_check ../../../../gtk/gtkmain.c:1109 #20 0x7f12b5822f6a in gtk_init_check ../../../../gtk/gtkmain.c:1101 #21 0x7f12b6fd1dad in wxApp::Initialize(int&, wchar_t**) ... --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 60c15d0fe1..42258bd0dd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -192,6 +192,7 @@ jobs: run: | if [ ${{ matrix.use_asan }} ]; then export LSAN_OPTIONS=suppressions=$(pwd)/misc/suppressions/lsan + export ASAN_OPTIONS=fast_unwind_on_malloc=0 fi pushd tests xvfb-run -a -s '-screen 0 1600x1200x24' ./test_gui From 584494f3b531ba6f7be3337d9c7a7ab93e4af64f Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 31 Jan 2021 16:30:05 +0100 Subject: [PATCH 18/19] Skip wxDataViewCtrl unit test when using ASAN with wxGTK Somehow ASAN reports a memory leak in this test: Direct leak of 24 byte(s) in 1 object(s) allocated from: #0 0x7fc54732ebc8 in malloc (/lib/x86_64-linux-gnu/libasan.so.5+0x10dbc8) #1 0x7fc546685cb8 in g_malloc ../../../glib/gmem.c:102 #2 0x7fc543a49b41 in _gtk_rbtree_new ../../../../gtk/gtkrbtree.c:333 #3 0x7fc543b0831a in gtk_tree_view_real_expand_row ../../../../gtk/gtktreeview.c:12922 #4 0x7fc543b1087a in gtk_tree_view_expand_row ../../../../gtk/gtktreeview.c:12983 #5 0x7fc5453ba344 in wxDataViewCtrl::DoExpand(wxDataViewItem const&, bool) src/gtk/dataview.cpp:5013 #6 0x7fc5458e5a0e in wxDataViewCtrlBase::ExpandAncestors(wxDataViewItem const&) src/common/datavcmn.cpp:1297 #7 0x7fc5453bce08 in wxDataViewCtrl::SetSelections(wxDataViewItemArray const&) src/gtk/dataview.cpp:5228 #8 0x5557834c5745 in test controls/dataviewctrltest.cpp:178 #9 0x5557834d688c in invoke ../3rdparty/catch/include/internal/catch_test_registry.hpp:25 #10 0x5557831434ef in Catch::TestCase::invoke() const ../3rdparty/catch/include/internal/catch_test_case_info.hpp:176 #11 0x55578317f10f in Catch::RunContext::invokeActiveTestCase() (/home/runner/work/wxWidgets/wxWidgets/tests/test_gui+0x1bc10f) #12 0x55578317e9dd in Catch::RunContext::runCurrentTest(std::__cxx11::basic_string, std::allocator >&, std::__cxx11::basic_string, std::allocator >&) (/home/runner/work/wxWidgets/wxWidgets/tests/test_gui+0x1bb9dd) #13 0x55578317b5cc in Catch::RunContext::runTest(Catch::TestCase const&) (/home/runner/work/wxWidgets/wxWidgets/tests/test_gui+0x1b85cc) #14 0x55578313c64a in Catch::runTests(Catch::Ptr const&) ../3rdparty/catch/include/internal/../catch_session.hpp:82 #15 0x555783180e05 in Catch::Session::runInternal() (/home/runner/work/wxWidgets/wxWidgets/tests/test_gui+0x1bde05) #16 0x555783180931 in Catch::Session::run() (/home/runner/work/wxWidgets/wxWidgets/tests/test_gui+0x1bd931) #17 0x555783180899 in Catch::Session::run(int, char const* const*) (/home/runner/work/wxWidgets/wxWidgets/tests/test_gui+0x1bd899) #18 0x55578315719a in TestApp::RunTests() test.cpp:635 #19 0x5557831a63c7 in TestApp::OnIdle(wxIdleEvent&) (/home/runner/work/wxWidgets/wxWidgets/tests/test_gui+0x1e33c7) #20 0x7fc5446bbbfe in wxAppConsoleBase::HandleEvent(wxEvtHandler*, void (wxEvtHandler::*)(wxEvent&), wxEvent&) const src/common/appbase.cpp:654 #21 0x7fc5446bbdba in wxAppConsoleBase::CallEventHandler(wxEvtHandler*, wxEventFunctor&, wxEvent&) const src/common/appbase.cpp:666 #22 0x7fc5449b29dd in wxEvtHandler::ProcessEventIfMatchesId(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&) src/common/event.cpp:1416 #23 0x7fc5449b47f4 in wxEvtHandler::SearchDynamicEventTable(wxEvent&) src/common/event.cpp:1888 #24 0x7fc5449b32be in wxEvtHandler::TryHereOnly(wxEvent&) src/common/event.cpp:1609 #25 0x7fc5449b70a7 in wxEvtHandler::TryBeforeAndHere(wxEvent&) include/wx/event.h:3949 #26 0x7fc5449b2f72 in wxEvtHandler::ProcessEventLocally(wxEvent&) src/common/event.cpp:1546 #27 0x7fc5449b2ec5 in wxEvtHandler::ProcessEvent(wxEvent&) src/common/event.cpp:1519 #28 0x555783156ef7 in TestApp::ProcessEvent(wxEvent&) test.cpp:615 #29 0x7fc5446badef in wxAppConsoleBase::ProcessIdle() src/common/appbase.cpp:431 but only if another wxDataViewCtrl test runs after it, i.e. there is no leak when running just this test on its own. This doesn't seem to make sense, as wxDataViewCtrl, and hence GtkTreeView, is destroyed at the end of the test and it shouldn't be possible for a test running later to affect the presence or absence of a memory leak in it, so it might be a LeakSanitizer bug, but this doesn't help actually getting rid of it. The only other possibility would be to suppress this leak, but this doesn't seem ideal, as we could suppress some other real leak too, so for now just skip this test when using ASAN. --- tests/controls/dataviewctrltest.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/controls/dataviewctrltest.cpp b/tests/controls/dataviewctrltest.cpp index ffca55b260..53f8e0ea18 100644 --- a/tests/controls/dataviewctrltest.cpp +++ b/tests/controls/dataviewctrltest.cpp @@ -171,6 +171,15 @@ TEST_CASE_METHOD(MultiSelectDataViewCtrlTestCase, "wxDVC::DeleteSelected", "[wxDataViewCtrl][delete]") { +#ifdef __WXGTK__ + wxString useASAN; + if ( wxGetEnv("wxUSE_ASAN", &useASAN) && useASAN == "1" ) + { + WARN("Skipping test resulting in a memory leak report with wxGTK"); + return; + } +#endif // __WXGTK__ + wxDataViewItemArray sel; sel.push_back(m_child1); sel.push_back(m_grandchild); From eb00c53f5a009068920ae9601a7fbb5dff1b5966 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 31 Jan 2021 17:34:04 +0100 Subject: [PATCH 19/19] Remove Travis CI builds that now run on GitHub CI There is no need to run essentially the same builds on two different services. --- .travis.yml | 40 ---------------------------------------- 1 file changed, 40 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2841c20a28..c1e8519c52 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,34 +14,10 @@ jobs: compiler: gcc env: wxGTK_VERSION=2 wxUSE_XVFB=1 name: wxGTK 2 Ubuntu 14.04 - - dist: xenial - compiler: gcc - env: wxGTK_VERSION=3 - name: wxGTK 3 Ubuntu 16.04 - - dist: bionic - compiler: gcc - env: wxGTK_VERSION=2 wxCONFIGURE_FLAGS="--enable-utf8 --enable-utf8only --enable-monolithic" wxUSE_XVFB=1 - name: wxGTK 2 UTF-8 Ubuntu 18.04 - - dist: bionic - compiler: gcc - env: wxGTK_VERSION=3 wxCONFIGURE_FLAGS="--enable-cxx11 --disable-compat30 --enable-stl" wxMAKEFILE_CXXFLAGS=-std=c++11 wxMAKEFILE_LDFLAGS=-Wl,--no-as-needed wxUSE_XVFB=1 - name: wxGTK 3 STL Ubuntu 18.04 - - dist: bionic - compiler: clang - env: wxGTK_VERSION=2 wxCONFIGURE_FLAGS="--disable-shared --disable-sys-libs --disable-webview" wxUSE_XVFB=1 - name: wxGTK 2 clang Ubuntu 18.04 - dist: bionic compiler: gcc env: wxGTK_VERSION=3 wxTOOLSET=cmake wxCMAKE_GENERATOR="Unix Makefiles" name: wxGTK 3 CMake Ubuntu 18.04 - - dist: focal - compiler: gcc - env: wxGTK_VERSION=2 wxCONFIGURE_FLAGS="--disable-compat30 --disable-unicode" wxSKIP_SAMPLES=1 - name: wxGTK ANSI Ubuntu 20.04 - - dist: focal - compiler: gcc - env: wxGTK_VERSION=3 wxCONFIGURE_FLAGS="--disable-compat30 --disable-sys-libs" wxSKIP_SAMPLES=1 - name: wxGTK Ubuntu 20.04 - os: osx osx_image: xcode7.3 compiler: clang @@ -64,22 +40,6 @@ jobs: osx_image: xcode11.4 env: wxTOOLSET=cmake wxCMAKE_GENERATOR=Xcode wxCMAKE_DEFINES="-DCMAKE_SYSTEM_NAME=iOS -DCMAKE_FIND_ROOT_PATH=/usr/local -DCMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED=NO" wxCMAKE_SAMPLES=OFF wxCMAKE_TESTS=OFF name: wxOSX iOS CMake Xcode 11.4 - - dist: bionic - compiler: gcc - env: wxCONFIGURE_FLAGS="--with-x11 --enable-pch --disable-stc" wxSKIP_SAMPLES=1 - name: wxX11 Ubuntu 18.04 - - dist: bionic - compiler: gcc - env: wxCONFIGURE_FLAGS="--with-directfb --enable-pch --disable-stc" wxSKIP_SAMPLES=1 wxALLOW_WARNINGS=1 - name: wxDFB Ubuntu 18.04 - - dist: bionic - compiler: gcc - env: wxCONFIGURE_FLAGS="--with-motif --enable-pch --disable-stc" wxSKIP_SAMPLES=1 - name: wxMotif Ubuntu 18.04 - - dist: bionic - compiler: gcc - env: wxCONFIGURE_FLAGS="--with-qt --enable-pch --without-opengl" wxSKIP_SAMPLES=1 - name: wxQt Ubuntu 18.04 - os: linux arch: arm64 env: wxGTK_VERSION=3 wxCONFIGURE_FLAGS="--disable-sys-libs" wxLXC=1