[gtk/wip/nirbheek/gtk-3-24-meson: 419/420] meson: Cleanup tests and gdk testsuite



commit bd5afb0390282d65eb144926b589ea567a4a45ae
Author: Nirbheek Chauhan <nirbheek centricular com>
Date:   Tue Dec 4 13:45:28 2018 +0530

    meson: Cleanup tests and gdk testsuite

 tests/meson.build         | 350 +++++++++++++++++++---------------------------
 testsuite/gdk/meson.build |  50 +++----
 2 files changed, 173 insertions(+), 227 deletions(-)
---
diff --git a/tests/meson.build b/tests/meson.build
index 2fdc5ebd5d..586fe2f45e 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -1,212 +1,156 @@
-
-test_animated_resizing = executable('animated-resizing',
-  'animated-resizing.c',
-  'frame-stats.c',
-  'frame-stats.h',
-  'variable.c',
-  'variable.h',
-  dependencies: libgtk_dep
-)
-test_animted_revealing = executable('animated-revealing',
-  'animated-revealing.c',
-  'frame-stats.c',
-  'frame-stats.h',
-  'variable.c',
-  'variable.h',
-  dependencies: libgtk_dep
-)
-test_scrolling_performance = executable('scrolling-performance',
-  'scrolling-performance.c',
-  'frame-stats.c',
-  'frame-stats.h',
-  'variable.c',
-  'variable.h',
-  dependencies: libgtk_dep
-)
-test_blur_performance = executable('blur-performance',
-  'blur-performance.c',
-  '../gtk/gtkcairoblur.c',
-  dependencies: libgtk_dep
-)
-test_video_timer = executable('video-timer',
-  'video-timer.c',
-  'variable.c',
-  'variable.h',
-  dependencies: libgtk_dep
-)
-test_print = executable('testprint',
-  'testprint.c',
-  'testprintfileoperation.c',
-  'testprintfileoperation.h',
-  dependencies: libgtk_dep
-)
-
-test_offscren = executable('testoffscreen',
-  'testoffscreen.c',
-  'gtkoffscreenbox.c',
-  'gtkoffscreenbox.h',
-  dependencies: libgtk_dep
-)
-test_gdkgears = executable('gdkgears',
-  'gdkgears.c',
-  'gtkgears.c',
-  'gtkgears.h',
-  dependencies: libgtk_dep
-)
-test_glblending = executable('testglblending',
-  'testglblending.c',
-  'gtkgears.c',
-  'gtkgears.h',
-  dependencies: libgtk_dep
-)
-
-test_boxcss = executable('testboxcss', 'testboxcss.c', dependencies: libgtk_dep)
-test_entrycompletion = executable('testentrycompletion', 'testentrycompletion.c', dependencies: libgtk_dep)
-test_entryicons = executable('testentryicons', 'testentryicons.c', dependencies: libgtk_dep)
-test_filechooser = executable('testfilechooser', 'testfilechooser.c', dependencies: libgtk_dep)
-test_filechooserbutton = executable('testfilechooserbutton', 'testfilechooserbutton.c', dependencies: 
libgtk_dep)
-test_flowbox = executable('testflowbox', 'testflowbox.c', dependencies: libgtk_dep)
-test_fontselection = executable('testfontselection', 'testfontselection.c', dependencies: libgtk_dep)
-test_fontselectiondialog = executable('testfontselectiondialog', 'testfontselectiondialog.c', dependencies: 
libgtk_dep)
-test_fontchooser = executable('testfontchooser', 'testfontchooser.c', dependencies: libgtk_dep)
-test_fontoptions = executable('testfontoptions', 'testfontoptions.c', dependencies: libgtk_dep)
-test_grid = executable('testgrid', 'testgrid.c', dependencies: libgtk_dep)
-# TODO: Can't find the x11/gdkx.h
-#test_gtk = executable('testgtk', 'testgtk.c', dependencies: libgtk_dep)
-test_treechanging = executable('testtreechanging', 'testtreechanging.c', dependencies: libgtk_dep)
-test_treednd = executable('testtreednd', 'testtreednd.c', dependencies: libgtk_dep)
-test_treeedit = executable('testtreeedit', 'testtreeedit.c', dependencies: libgtk_dep)
-test_treemodel = executable('testtreemodel', 'testtreemodel.c', dependencies: libgtk_dep)
-test_treeview = executable('testtreeview', 'testtreeview.c', dependencies: libgtk_dep)
-test_treefocus = executable('testtreefocus', 'testtreefocus.c', dependencies: libgtk_dep)
-test_treeflow = executable('testtreeflow', 'testtreeflow.c', dependencies: libgtk_dep)
-test_treecolumns = executable('testtreecolumns', 'testtreecolumns.c', dependencies: libgtk_dep)
-test_treecolumnsizing = executable('testtreecolumnsizing', 'testtreecolumnsizing.c', dependencies: 
libgtk_dep)
-test_treesort = executable('testtreesort', 'testtreesort.c', dependencies: libgtk_dep)
-test_toolbar = executable('testtoolbar', 'testtoolbar.c', dependencies: libgtk_dep)
-test_toolbar2 = executable('testtoolbar2', 'testtoolbar2.c', dependencies: libgtk_dep)
-test_menubutton = executable('testmenubutton', 'testmenubutton.c', dependencies: libgtk_dep)
-test_spinbutton = executable('testspinbutton', 'testspinbutton.c', dependencies: libgtk_dep)
-test_statusicon = executable('teststatusicon', 'teststatusicon.c', dependencies: libgtk_dep)
-test_merge = executable('testmerge', 'testmerge.c', dependencies: libgtk_dep)
-test_actions = executable('testactions', 'testactions.c', dependencies: libgtk_dep)
-test_baseline = executable('testbaseline', 'testbaseline.c', dependencies: libgtk_dep)
-test_bbox = executable('testbbox', 'testbbox.c', dependencies: libgtk_dep)
-test_buttons = executable('testbuttons', 'testbuttons.c', dependencies: libgtk_dep)
-test_frame = executable('testframe', 'testframe.c', dependencies: libgtk_dep)
-test_geometry = executable('testgeometry', 'testgeometry.c', dependencies: libgtk_dep)
-test_giconpixbuf = executable('testgiconpixbuf', 'testgiconpixbuf.c', dependencies: libgtk_dep)
-test_iconview = executable('testiconview', 'testiconview.c', dependencies: libgtk_dep)
-test_iconview_keynav = executable('testiconview_keynav', 'testiconview-keynav.c', dependencies: libgtk_dep)
-test_numerableicon = executable('testnumerableicon', 'testnumerableicon.c', dependencies: libgtk_dep)
-test_recentchooser = executable('testrecentchooser', 'testrecentchooser.c', dependencies: libgtk_dep)
-test_grouping = executable('testgrouping', 'testgrouping.c', dependencies: libgtk_dep)
-test_tooltips = executable('testtooltips', 'testtooltips.c', dependencies: libgtk_dep)
-test_recentchoosermenu = executable('testrecentchoosermenu', 'testrecentchoosermenu.c', dependencies: 
libgtk_dep)
-test_volumebutton = executable('testvolumebutton', 'testvolumebutton.c', dependencies: libgtk_dep)
-test_scrolledwindow = executable('testscrolledwindow', 'testscrolledwindow.c', dependencies: libgtk_dep)
-test_cellarea = executable('testcellarea', 'testcellarea.c', dependencies: libgtk_dep)
-test_treemenu = executable('testtreemenu', 'testtreemenu.c', dependencies: libgtk_dep)
-test_offscreenwindow = executable('testoffscreenwindow', 'testoffscreenwindow.c', dependencies: libgtk_dep)
-test_overlay = executable('testoverlay', 'testoverlay.c', dependencies: libgtk_dep)
-test_overlaystyleclass = executable('testoverlaystyleclass', 'testoverlaystyleclass.c', dependencies: 
libgtk_dep)
-test_appchooser = executable('testappchooser', 'testappchooser.c', dependencies: libgtk_dep)
-test_windows = executable('testwindows', 'testwindows.c', dependencies: libgtk_dep)
-test_expand = executable('testexpand', 'testexpand.c', dependencies: libgtk_dep)
-test_expander = executable('testexpander', 'testexpander.c', dependencies: libgtk_dep)
-test_switch = executable('testswitch', 'testswitch.c', dependencies: libgtk_dep)
-test_styleexamples = executable('styleexamples', 'styleexamples.c', dependencies: libgtk_dep)
-test_toplevelembed = executable('testtoplevelembed', 'testtoplevelembed.c', dependencies: libgtk_dep)
-test_textview = executable('testtextview', 'testtextview.c', dependencies: libgtk_dep)
-test_animation = executable('testanimation', 'testanimation.c', dependencies: libgtk_dep)
-test_pixbuf_scale = executable('testpixbuf_scale', 'testpixbuf-scale.c', dependencies: libgtk_dep)
-test_pixbuf_color = executable('testpixbuf_color', 'testpixbuf-color.c', dependencies: libgtk_dep)
-test_pixbuf_save = executable('testpixbuf_save', 'testpixbuf-save.c', dependencies: libgtk_dep)
-test_colorchooser = executable('testcolorchooser', 'testcolorchooser.c', dependencies: libgtk_dep)
-test_colorchooser2 = executable('testcolorchooser2', 'testcolorchooser2.c', dependencies: libgtk_dep)
-test_kineticscrolling = executable('testkineticscrolling', 'testkineticscrolling.c', dependencies: 
libgtk_dep)
-test_stack = executable('teststack', 'teststack.c', dependencies: libgtk_dep)
-test_revealer = executable('testrevealer', 'testrevealer.c', dependencies: libgtk_dep)
-test_revealer2 = executable('testrevealer2', 'testrevealer2.c', dependencies: libgtk_dep)
-test_titlebar = executable('testtitlebar', 'testtitlebar.c', dependencies: libgtk_dep)
-test_windowsize = executable('testwindowsize', 'testwindowsize.c', dependencies: libgtk_dep)
-test_listmodel = executable('listmodel', 'listmodel.c', dependencies: libgtk_dep)
-test_popover = executable('testpopover', 'testpopover.c', dependencies: libgtk_dep)
-test_cairo = executable('testcairo', 'testcairo.c', dependencies: libgtk_dep)
-test_overlayscroll = executable('overlayscroll', 'overlayscroll.c', dependencies: libgtk_dep)
-test_syncscroll = executable('syncscroll', 'syncscroll.c', dependencies: libgtk_dep)
-test_subsurface = executable('subsurface', 'subsurface.c', dependencies: libgtk_dep)
-test_motion_compression = executable('motion-compression', 'motion-compression.c', dependencies: libgtk_dep)
-test_simple = executable('simple', 'simple.c', dependencies: libgtk_dep)
-test_flicker = executable('flicker', 'flicker.c', dependencies: libgtk_dep)
-test_print_editor = executable('print-editor', 'print-editor.c', dependencies: libgtk_dep)
-test_accel = executable('testaccel', 'testaccel.c', dependencies: libgtk_dep)
-test_adjustsize = executable('testadjustsize', 'testadjustsize.c', dependencies: libgtk_dep)
-test_appchooserbutton = executable('testappchooserbutton', 'testappchooserbutton.c', dependencies: 
libgtk_dep)
-test_assistant = executable('testassistant', 'testassistant.c', dependencies: libgtk_dep)
-test_box = executable('testbox', 'testbox.c', dependencies: libgtk_dep)
-test_calendar = executable('testcalendar', 'testcalendar.c', dependencies: libgtk_dep)
-test_clipboard = executable('testclipboard', 'testclipboard.c', dependencies: libgtk_dep)
-test_combo = executable('testcombo', 'testcombo.c', dependencies: libgtk_dep)
-test_combochange = executable('testcombochange', 'testcombochange.c', dependencies: libgtk_dep)
-test_cellrenderertext = executable('testcellrenderertext', 'testcellrenderertext.c', dependencies: 
libgtk_dep)
-test_dialog = executable('testdialog', 'testdialog.c', dependencies: libgtk_dep)
-test_dnd = executable('testdnd', 'testdnd.c', dependencies: libgtk_dep)
-test_dnd2 = executable('testdnd2', 'testdnd2.c', dependencies: libgtk_dep)
-test_ellipsise = executable('testellipsise', 'testellipsise.c', dependencies: libgtk_dep)
-test_emblems = executable('testemblems', 'testemblems.c', dependencies: libgtk_dep)
-test_fullscreen = executable('testfullscreen', 'testfullscreen.c', dependencies: libgtk_dep)
-test_headerbar = executable('testheaderbar', 'testheaderbar.c', dependencies: libgtk_dep)
-test_heightforwidth = executable('testheightforwidth', 'testheightforwidth.c', dependencies: libgtk_dep)
-test_icontheme = executable('testicontheme', 'testicontheme.c', dependencies: libgtk_dep)
-test_image = executable('testimage', 'testimage.c', dependencies: libgtk_dep)
-test_input = executable('testinput', 'testinput.c', dependencies: libgtk_dep)
-test_list = executable('testlist', 'testlist.c', dependencies: libgtk_dep)
-test_list2 = executable('testlist2', 'testlist2.c', dependencies: libgtk_dep)
-test_list3 = executable('testlist3', 'testlist3.c', dependencies: libgtk_dep)
-test_levelbar = executable('testlevelbar', 'testlevelbar.c', dependencies: libgtk_dep)
-test_lockbutton = executable('testlockbutton', 'testlockbutton.c', dependencies: libgtk_dep)
-test_mountoperation = executable('testmountoperation', 'testmountoperation.c', dependencies: libgtk_dep)
-test_multidisplay = executable('testmultidisplay', 'testmultidisplay.c', dependencies: libgtk_dep)
-test_notebookdnd = executable('testnotebookdnd', 'testnotebookdnd.c', dependencies: libgtk_dep)
-test_nouiprint = executable('testnouiprint', 'testnouiprint.c', dependencies: libgtk_dep)
-test_orientable = executable('testorientable', 'testorientable.c', dependencies: libgtk_dep)
-test_richtext = executable('testrichtext', 'testrichtext.c', dependencies: libgtk_dep)
-test_scale = executable('testscale', 'testscale.c', dependencies: libgtk_dep)
-test_selection = executable('testselection', 'testselection.c', dependencies: libgtk_dep)
-test_selectionmode = executable('testselectionmode', 'testselectionmode.c', dependencies: libgtk_dep)
-test_stockbuttonmenu = executable('teststockbuttonmenu', 'teststockbuttonmenu.c', dependencies: libgtk_dep)
-test_stresstest_toolbar = executable('stresstest-oolbar', 'stresstest-toolbar.c', dependencies: libgtk_dep)
-test_verticalcells = executable('testverticalcells', 'testverticalcells.c', dependencies: libgtk_dep)
-test_treestoretest = executable('treestoretest', 'treestoretest.c', dependencies: libgtk_dep)
-test_xinerama = executable('testxinerama', 'testxinerama.c', dependencies: libgtk_dep)
-test_scrolledge = executable('testscrolledge', 'testscrolledge.c', dependencies: libgtk_dep)
-test_noscreen = executable('testnoscreen', 'testnoscreen.c', dependencies: libgtk_dep)
-test_treepos = executable('testtreepos', 'testtreepos.c', dependencies: libgtk_dep)
-test_sensitive = executable('testsensitive', 'testsensitive.c', dependencies: libgtk_dep)
-test_gmenu = executable('testgmenu', 'testgmenu.c', dependencies: libgtk_dep)
-test_logout = executable('testlogout', 'testlogout.c', dependencies: libgtk_dep)
-test_splitheaders = executable('testsplitheaders', 'testsplitheaders.c', dependencies: libgtk_dep)
-test_actionbar = executable('testactionbar', 'testactionbar.c', dependencies: libgtk_dep)
-test_popup = executable('testpopup', 'testpopup.c', dependencies: libgtk_dep)
-test_popupat = executable('testpopupat', 'testpopupat.c', dependencies: libgtk_dep)
+gtk_tests = [
+  # testname, optional extra sources
+  ['animated-resizing', ['frame-stats.c', 'variable.c']],
+  ['animated-revealing', ['frame-stats.c', 'variable.c']],
+  ['scrolling-performance', ['frame-stats.c', 'variable.c']],
+  ['blur-performance', ['../gtk/gtkcairoblur.c']],
+  ['flicker'],
+  ['gdkgears', ['gtkgears.c']],
+  ['listmodel'],
+  ['motion-compression'],
+  ['styleexamples'],
+  ['overlayscroll'],
+  ['print-editor'],
+  ['simple'],
+  ['subsurface'],
+  ['syncscroll'],
+  ['testaccel'],
+  ['testactionbar'],
+  ['testactions'],
+  ['testadjustsize'],
+  ['testanimation'],
+  ['testappchooserbutton'],
+  ['testappchooser'],
+  ['testassistant'],
+  ['testbaseline'],
+  ['testbbox'],
+  ['testbox'],
+  ['testboxcss'],
+  ['testbuttons'],
+  ['testcairo'],
+  ['testcalendar'],
+  ['testcellarea'],
+  ['testcellrenderertext'],
+  ['testclipboard'],
+  ['testcolorchooser'],
+  ['testcombo'],
+  ['testcombochange'],
+  ['testdialog'],
+  ['testdnd'],
+  ['testellipsise'],
+  ['testemblems'],
+  ['testentrycompletion'],
+  ['testentryicons'],
+  ['testexpand'],
+  ['testexpander'],
+  ['testfilechooserbutton'],
+  ['testfilechooser'],
+  ['testflowbox'],
+  ['testfontchooser'],
+  ['testfontoptions'],
+  ['testfontselection'],
+  ['testfontselectiondialog'],
+  ['testframe'],
+  ['testfullscreen'],
+  ['testgeometry'],
+  ['testgiconpixbuf'],
+  ['testglblending', ['gtkgears.c']],
+  ['testgmenu'],
+  ['testgrid'],
+  ['testgrouping'],
+  ['testgtk'],
+  ['testheaderbar'],
+  ['testheightforwidth'],
+  ['testicontheme'],
+  ['testiconview'],
+  ['testimage'],
+  ['testinput'],
+  ['testkineticscrolling'],
+  ['testlevelbar'],
+  ['testlist'],
+  ['testlockbutton'],
+  ['testlogout'],
+  ['testmenubutton'],
+  ['testmerge'],
+  ['testmountoperation'],
+  ['testmultidisplay'],
+  ['testnoscreen'],
+  ['testnotebookdnd'],
+  ['testnouiprint'],
+  ['testnumerableicon'],
+  ['testoffscreen', ['gtkoffscreenbox.c']],
+  ['testoffscreenwindow'],
+  ['testorientable'],
+  ['testoverlay'],
+  ['testoverlaystyleclass'],
+  ['testpopover'],
+  ['testpopupat'],
+  ['testpopup'],
+  ['testprint', ['testprintfileoperation.c']],
+  ['testrecentchooser'],
+  ['testrecentchoosermenu'],
+  ['testrevealer'],
+  ['testrichtext'],
+  ['testscale'],
+  ['testscrolledge'],
+  ['testscrolledwindow'],
+  ['testselection'],
+  ['testselectionmode'],
+  ['testsensitive'],
+  ['testspinbutton'],
+  ['testsplitheaders'],
+  ['teststack'],
+  ['teststatusicon'],
+  ['teststockbuttonmenu'],
+  ['testswitch'],
+  ['testtextview'],
+  ['testtitlebar'],
+  ['testtoolbar'],
+  ['testtooltips'],
+  ['testtoplevelembed'],
+  ['testtreechanging'],
+  ['testtreecolumns'],
+  ['testtreecolumnsizing'],
+  ['testtreednd'],
+  ['testtreeedit'],
+  ['testtreeflow'],
+  ['testtreefocus'],
+  ['testtreemenu'],
+  ['testtreemodel'],
+  ['testtreepos'],
+  ['testtreesort'],
+  ['testtreeview'],
+  ['testverticalcells'],
+  ['testvolumebutton'],
+  ['testwindows'],
+  ['testwindowsize'],
+  ['testxinerama'],
+  ['treestoretest'],
+  ['video-timer', ['variable.c']],
+]
 
 # Conditionally compiled tests
 if x11_enabled
-  test_socket = executable('testsocket',
-    'testsocket.c',
-    'testsocket_common.c',
-    dependencies: libgtk_dep
-  )
-  test_socket_child = executable('testsocket_child',
-    'testsocket_child.c',
-    'testsocket_common.c',
-    dependencies: libgtk_dep
-  )
+  gtk_tests += [
+    ['testsocket', ['testsocket_common.c']],
+    ['testsocket_child', ['testsocket_common.c']],
+  ]
 endif
 
 if os_linux
-  test_fontchooserdialog = executable('testfontchooserdialog', 'testfontchooserdialog.c', dependencies: 
libgtk_dep)
+  gtk_tests += [['testfontchooserdialog']]
 endif
 
+# Pass the source dir here so programs can change into the source directory
+# and find .ui files and .png files and such that they load at runtime
+test_args = ['-DGTK_SRCDIR="@0@"'.format(meson.current_source_dir())]
+
+foreach t: gtk_tests
+  test_name = t.get(0)
+  test_srcs = ['@0@.c'.format(test_name), t.get(1, [])]
+  executable(test_name, test_srcs,
+             c_args: test_args,
+             dependencies: [libgtk_dep, libm])
+endforeach
+
 subdir('visuals')
diff --git a/testsuite/gdk/meson.build b/testsuite/gdk/meson.build
index 326c6545a8..ca84758e4f 100644
--- a/testsuite/gdk/meson.build
+++ b/testsuite/gdk/meson.build
@@ -1,24 +1,26 @@
-
-test_cairo = executable('cairo', 'cairo.c', dependencies: libgtk_dep)
-test('gdk/cairo', test_cairo)
-
-test_display = executable('display', 'display.c', dependencies: libgtk_dep)
-test('gdk/display', test_display)
-
-test_encoding = executable('encoding', 'encoding.c', dependencies: libgtk_dep)
-test('gdk/encoding', test_encoding)
-
-test_keysyms = executable('keysyms', 'keysyms.c', dependencies: libgtk_dep)
-test('gdk/keysyms', test_keysyms)
-
-test_rectangle = executable('rectangle', 'rectangle.c', dependencies: libgtk_dep)
-test('gdk/rectangle', test_rectangle)
-
-test_rgba = executable('rgba', 'rgba.c', dependencies: libgtk_dep)
-test('gdk/rgba', test_rgba)
-
-test_seat = executable('seat', 'seat.c', dependencies: libgtk_dep)
-test('gdk/seat', test_seat)
-
-test_visual = executable('visual', 'visual.c', dependencies: libgtk_dep)
-test('gdk/visual', test_visual)
+tests = [
+  'cairo',
+  'display',
+  'encoding',
+  'keysyms',
+  'rectangle',
+  'rgba',
+  'seat',
+  'visual',
+]
+
+foreach t : tests
+  test_exe = executable(t, '@0@.c'.format(t),
+                        dependencies: libgtk_dep)
+
+  test(t, test_exe,
+       args: [ '--tap', '-k' ],
+       env: [ 'GIO_USE_VOLUME_MONITOR=unix',
+              'GSETTINGS_BACKEND=memory',
+              'GTK_CSD=1',
+              'G_ENABLE_DIAGNOSTIC=0',
+              'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()),
+              'G_TEST_BUILDDIR=@0@'.format(meson.current_build_dir())
+            ],
+       suite: 'gdk')
+endforeach


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]