Mesa (master): meson: Add tests to suites

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Nov 20 17:15:04 UTC 2018


Module: Mesa
Branch: master
Commit: a999798daad7181110922a7e756eb1d8dfe55c4e
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=a999798daad7181110922a7e756eb1d8dfe55c4e

Author: Dylan Baker <dylan at pnwbakers.com>
Date:   Mon Nov 19 13:44:15 2018 -0800

meson: Add tests to suites

Meson test has a concepts of suites, which allow tests to be grouped
together. This allows for a subtest of tests to be run only (say only
the tests for nir). A test can be added to more than one suite, but for
the most part I've only added a test to a single suite, though I've
added a compiler group that includes nir, glsl, and glcpp tests.

To use this you'll need to invoke meson test directly, instead of ninja
test (which always runs all targets). it can be invoked as:
`meson test -C builddir --suite $suitename` (meson test has addition
options that are pretty useful).

Tested-By: Gert Wollny <gert.wollny at collabora.com>
Acked-by: Eric Engestrom <eric.engestrom at intel.com>

---

 src/broadcom/qpu/meson.build                  |  3 ++-
 src/compiler/glsl/glcpp/meson.build           |  1 +
 src/compiler/glsl/tests/meson.build           | 18 +++++++++++++-----
 src/compiler/nir/meson.build                  |  7 +++++--
 src/egl/meson.build                           |  6 ++++--
 src/gallium/drivers/llvmpipe/meson.build      |  3 ++-
 src/gallium/drivers/r300/meson.build          |  3 ++-
 src/gbm/meson.build                           |  3 ++-
 src/glx/tests/meson.build                     |  3 ++-
 src/intel/compiler/meson.build                |  3 ++-
 src/intel/isl/meson.build                     |  3 ++-
 src/intel/vulkan/meson.build                  |  3 ++-
 src/mapi/es1api/meson.build                   |  3 ++-
 src/mapi/es2api/meson.build                   |  3 ++-
 src/mapi/glapi/meson.build                    |  3 ++-
 src/mapi/shared-glapi/meson.build             |  3 ++-
 src/mesa/main/tests/meson.build               |  3 ++-
 src/mesa/state_tracker/tests/meson.build      |  8 +++++---
 src/util/meson.build                          |  9 ++++++---
 src/util/tests/fast_idiv_by_const/meson.build |  3 ++-
 src/util/tests/hash_table/meson.build         |  3 ++-
 src/util/tests/set/meson.build                |  3 ++-
 src/util/tests/string_buffer/meson.build      |  3 ++-
 src/util/tests/vma/meson.build                |  3 ++-
 24 files changed, 70 insertions(+), 33 deletions(-)

diff --git a/src/broadcom/qpu/meson.build b/src/broadcom/qpu/meson.build
index 8a40016064..279b09cb95 100644
--- a/src/broadcom/qpu/meson.build
+++ b/src/broadcom/qpu/meson.build
@@ -41,5 +41,6 @@ test(
     'qpu_disasm', 'tests/qpu_disasm.c',
     link_with: [libbroadcom_qpu, libmesa_util],
     include_directories: inc_common
-  )
+  ),
+  suite : ['broadcom'],
 )
diff --git a/src/compiler/glsl/glcpp/meson.build b/src/compiler/glsl/glcpp/meson.build
index a03d589b37..677baf1df1 100644
--- a/src/compiler/glsl/glcpp/meson.build
+++ b/src/compiler/glsl/glcpp/meson.build
@@ -70,6 +70,7 @@ if with_any_opengl and with_tests
         glcpp, join_paths(meson.current_source_dir(), 'tests'),
         '-- at 0@'.format(m),
       ],
+      suite : ['compiler', 'glcpp'],
     )
   endforeach
 endif
diff --git a/src/compiler/glsl/tests/meson.build b/src/compiler/glsl/tests/meson.build
index 2a41e30a28..02f3355c43 100644
--- a/src/compiler/glsl/tests/meson.build
+++ b/src/compiler/glsl/tests/meson.build
@@ -26,7 +26,8 @@ test(
     c_args : [c_vis_args, c_msvc_compat_args, no_override_init_args],
     include_directories : [inc_common, inc_compiler],
     link_with : [libglsl],
-  )
+  ),
+  suite : ['compiler', 'glsl'],
 )
 
 test(
@@ -38,7 +39,8 @@ test(
     include_directories : [inc_common, inc_glsl],
     link_with : [libglsl],
     dependencies : [dep_clock, dep_thread],
-  )
+  ),
+  suite : ['compiler', 'glsl'],
 )
 
 
@@ -54,7 +56,8 @@ test(
     include_directories : [inc_common, inc_glsl],
     link_with : [libglsl, libglsl_standalone, libglsl_util],
     dependencies : [dep_clock, dep_thread, idep_gtest],
-  )
+  ),
+  suite : ['compiler', 'glsl'],
 )
 
 test(
@@ -68,7 +71,8 @@ test(
     include_directories : [inc_common, inc_glsl],
     link_with : [libglsl, libglsl_util],
     dependencies : [dep_thread, idep_gtest],
-  )
+  ),
+  suite : ['compiler', 'glsl'],
 )
 
 test(
@@ -80,7 +84,8 @@ test(
     include_directories : [inc_common, inc_glsl],
     link_with : [libglsl, libglsl_util],
     dependencies : [dep_thread, idep_gtest],
-  )
+  ),
+  suite : ['compiler', 'glsl'],
 )
 
 test(
@@ -93,7 +98,9 @@ test(
       meson.source_root(), 'src', 'compiler', 'glsl', 'tests', 'warnings'
     ),
   ],
+  suite : ['compiler', 'glsl'],
 )
+
 test(
   'glsl optimization',
   prog_python,
@@ -101,4 +108,5 @@ test(
     join_paths(meson.current_source_dir(), 'optimization_test.py'),
     '--test-runner', glsl_test
   ],
+  suite : ['compiler', 'glsl'],
 )
diff --git a/src/compiler/nir/meson.build b/src/compiler/nir/meson.build
index b0c3a7feb3..61f61f0a34 100644
--- a/src/compiler/nir/meson.build
+++ b/src/compiler/nir/meson.build
@@ -246,8 +246,10 @@ if with_tests
       include_directories : [inc_common],
       dependencies : [dep_thread, idep_gtest, idep_nir],
       link_with : libmesa_util,
-    )
+    ), 
+    suite : ['compiler', 'nir'],
   )
+
   test(
     'nir_vars',
     executable(
@@ -257,6 +259,7 @@ if with_tests
       include_directories : [inc_common],
       dependencies : [dep_thread, idep_gtest, idep_nir],
       link_with : libmesa_util,
-    )
+    ),
+    suite : ['compiler', 'nir'],
   )
 endif
diff --git a/src/egl/meson.build b/src/egl/meson.build
index 372842967d..89bac2cd63 100644
--- a/src/egl/meson.build
+++ b/src/egl/meson.build
@@ -200,11 +200,13 @@ if with_tests
     test('egl-symbols-check',
       find_program('egl-symbols-check'),
       env : env_test,
-      args : libegl
+      args : libegl,
+      suite : ['egl'],
     )
   endif
   test('egl-entrypoint-check',
     find_program('egl-entrypoint-check'),
-    env : [ 'srcdir=' + meson.current_source_dir() ]
+    env : ['srcdir=' + meson.current_source_dir()],
+    suite : ['egl'],
   )
 endif
diff --git a/src/gallium/drivers/llvmpipe/meson.build b/src/gallium/drivers/llvmpipe/meson.build
index 0b0ac2a3a0..51562b10dc 100644
--- a/src/gallium/drivers/llvmpipe/meson.build
+++ b/src/gallium/drivers/llvmpipe/meson.build
@@ -119,7 +119,8 @@ if with_tests and with_gallium_softpipe and with_llvm
         dependencies : [dep_llvm, dep_dl, dep_thread, dep_clock],
         include_directories : [inc_gallium, inc_gallium_aux, inc_include, inc_src],
         link_with : [libllvmpipe, libgallium, libmesa_util],
-      )
+      ),
+      suite : ['llvmpipe'],
     )
   endforeach
 endif
diff --git a/src/gallium/drivers/r300/meson.build b/src/gallium/drivers/r300/meson.build
index d181048c51..f46aedffdf 100644
--- a/src/gallium/drivers/r300/meson.build
+++ b/src/gallium/drivers/r300/meson.build
@@ -158,6 +158,7 @@ if with_tests
       ],
       link_with : [libr300, libgallium, libmesa_util],
       dependencies : [dep_m, dep_clock, dep_dl, dep_thread, dep_unwind],
-    )
+    ),
+    suite : ['r300'],
   )
 endif
diff --git a/src/gbm/meson.build b/src/gbm/meson.build
index 007f50a9ae..b2ad667359 100644
--- a/src/gbm/meson.build
+++ b/src/gbm/meson.build
@@ -71,6 +71,7 @@ if with_tests
     'gbm-symbols-check',
     find_program('gbm-symbols-check'),
     env : env_test,
-    args : libgbm
+    args : libgbm,
+    suite : ['gbm'],
   )
 endif
diff --git a/src/glx/tests/meson.build b/src/glx/tests/meson.build
index fd9d4d433b..fa3ca9db8c 100644
--- a/src/glx/tests/meson.build
+++ b/src/glx/tests/meson.build
@@ -44,6 +44,7 @@ if with_shared_glapi
         include_directories('..'),
       ],
       dependencies : [dep_libdrm, dep_thread, idep_gtest]
-    )
+    ),
+    suite : ['glx'],
   )
 endif
diff --git a/src/intel/compiler/meson.build b/src/intel/compiler/meson.build
index 953e8dcc97..2124278cc0 100644
--- a/src/intel/compiler/meson.build
+++ b/src/intel/compiler/meson.build
@@ -157,7 +157,8 @@ if with_tests
           libintel_compiler, libintel_common, libintel_dev, libmesa_util, libisl,
         ],
         dependencies : [dep_thread, dep_dl, idep_gtest, idep_nir],
-      )
+      ),
+      suite : ['intel'],
     )
   endforeach
 endif
diff --git a/src/intel/isl/meson.build b/src/intel/isl/meson.build
index 62cde190e6..a6374f6c4f 100644
--- a/src/intel/isl/meson.build
+++ b/src/intel/isl/meson.build
@@ -96,6 +96,7 @@ if with_tests
       dependencies : dep_m,
       include_directories : [inc_common, inc_intel],
       link_with : [libisl, libintel_dev, libmesa_util],
-    )
+    ),
+    suite : ['intel'],
   )
 endif
diff --git a/src/intel/vulkan/meson.build b/src/intel/vulkan/meson.build
index b983486740..e30e922528 100644
--- a/src/intel/vulkan/meson.build
+++ b/src/intel/vulkan/meson.build
@@ -238,7 +238,8 @@ if with_tests
         include_directories : [
           inc_common, inc_intel, inc_compiler, inc_vulkan_util, inc_vulkan_wsi,
         ],
-      )
+      ),
+      suite : ['intel'],
     )
   endforeach
 endif
diff --git a/src/mapi/es1api/meson.build b/src/mapi/es1api/meson.build
index d8a77a41df..53e894f091 100644
--- a/src/mapi/es1api/meson.build
+++ b/src/mapi/es1api/meson.build
@@ -56,6 +56,7 @@ if with_tests
     'es1-ABI-check',
     find_program('ABI-check'),
     env : env_test,
-    args : libglesv1_cm
+    args : libglesv1_cm,
+    suite : ['mapi'],
   )
 endif
diff --git a/src/mapi/es2api/meson.build b/src/mapi/es2api/meson.build
index 891e6f7b27..1f397e2b75 100644
--- a/src/mapi/es2api/meson.build
+++ b/src/mapi/es2api/meson.build
@@ -56,6 +56,7 @@ if with_tests
     'es2-ABI-check',
     find_program('ABI-check'),
     env : env_test,
-    args : libgles2
+    args : libgles2,
+    suite : ['mapi'],
   )
 endif
diff --git a/src/mapi/glapi/meson.build b/src/mapi/glapi/meson.build
index 048bee8a1a..7e8bc38a81 100644
--- a/src/mapi/glapi/meson.build
+++ b/src/mapi/glapi/meson.build
@@ -87,6 +87,7 @@ if with_any_opengl and not with_shared_glapi and with_tests
       include_directories : [inc_include, inc_src, inc_mesa, inc_mapi],
       link_with : [libglapi_static],
       dependencies : [idep_gtest, dep_thread],
-    )
+    ),
+    suite : ['mapi'],
   )
 endif
diff --git a/src/mapi/shared-glapi/meson.build b/src/mapi/shared-glapi/meson.build
index dcc6079af3..41da9b1c1c 100644
--- a/src/mapi/shared-glapi/meson.build
+++ b/src/mapi/shared-glapi/meson.build
@@ -60,6 +60,7 @@ if with_any_opengl and with_tests
       include_directories : [inc_src, inc_include, inc_mapi],
       link_with : [libglapi],
       dependencies : [dep_thread, idep_gtest],
-    )
+    ),
+    suite : ['mapi'],
   )
 endif
diff --git a/src/mesa/main/tests/meson.build b/src/mesa/main/tests/meson.build
index d1bd81a560..4b39325154 100644
--- a/src/mesa/main/tests/meson.build
+++ b/src/mesa/main/tests/meson.build
@@ -41,5 +41,6 @@ test(
     include_directories : [inc_include, inc_src, inc_mapi, inc_mesa],
     dependencies : [idep_gtest, dep_clock, dep_dl, dep_thread],
     link_with : [libmesa_classic, link_main_test],
-  )
+  ),
+  suite : ['mesa'],
 )
diff --git a/src/mesa/state_tracker/tests/meson.build b/src/mesa/state_tracker/tests/meson.build
index 5c472104d8..892362b22f 100644
--- a/src/mesa/state_tracker/tests/meson.build
+++ b/src/mesa/state_tracker/tests/meson.build
@@ -35,8 +35,9 @@ test(
       libmesa_st_test_common, libmesa_gallium, libglapi, libgallium,
       libmesa_util,
     ],
-    dependencies : [idep_gtest, dep_thread]
-  )
+    dependencies : [idep_gtest, dep_thread],
+  ),
+  suite : ['st_mesa'],
 )
 
 test(
@@ -50,5 +51,6 @@ test(
       libmesa_util,
     ],
     dependencies : [idep_gtest, dep_thread]
-  )
+  ),
+  suite : ['st_mesa'],
 )
diff --git a/src/util/meson.build b/src/util/meson.build
index 156621aff6..397c222812 100644
--- a/src/util/meson.build
+++ b/src/util/meson.build
@@ -151,7 +151,8 @@ if with_tests
       include_directories : inc_common,
       link_with : libmesa_util,
       c_args : [c_msvc_compat_args],
-    )
+    ),
+    suite : ['util'],
   )
 
   test(
@@ -162,7 +163,8 @@ if with_tests
       include_directories : inc_common,
       c_args : [c_msvc_compat_args],
       dependencies : [dep_m],
-    )
+    ),
+    suite : ['util'],
   )
 
   test(
@@ -173,7 +175,8 @@ if with_tests
       include_directories : inc_common,
       link_with : libmesa_util,
       c_args : [c_msvc_compat_args],
-    )
+    ),
+    suite : ['util'],
   )
 
   subdir('tests/fast_idiv_by_const')
diff --git a/src/util/tests/fast_idiv_by_const/meson.build b/src/util/tests/fast_idiv_by_const/meson.build
index 8c3b79493f..90ac7d1597 100644
--- a/src/util/tests/fast_idiv_by_const/meson.build
+++ b/src/util/tests/fast_idiv_by_const/meson.build
@@ -26,5 +26,6 @@ test(
     dependencies : [dep_thread, dep_dl, idep_gtest],
     include_directories : inc_common,
     link_with : [libmesa_util],
-  )
+  ),
+  suite : ['util'],
 )
diff --git a/src/util/tests/hash_table/meson.build b/src/util/tests/hash_table/meson.build
index c7b03f19c5..d4de448aea 100644
--- a/src/util/tests/hash_table/meson.build
+++ b/src/util/tests/hash_table/meson.build
@@ -30,6 +30,7 @@ foreach t : ['clear', 'collision', 'delete_and_lookup', 'delete_management',
       dependencies : [dep_thread, dep_dl],
       include_directories : [inc_include, inc_util],
       link_with : libmesa_util,
-    )
+    ),
+    suite : ['util'],
   )
 endforeach
diff --git a/src/util/tests/set/meson.build b/src/util/tests/set/meson.build
index add3fc5602..5ab180c11e 100644
--- a/src/util/tests/set/meson.build
+++ b/src/util/tests/set/meson.build
@@ -26,5 +26,6 @@ test(
     dependencies : [dep_thread, dep_dl, idep_gtest],
     include_directories : inc_common,
     link_with : [libmesa_util],
-  )
+  ),
+  suite : ['util'],
 )
diff --git a/src/util/tests/string_buffer/meson.build b/src/util/tests/string_buffer/meson.build
index 9f42e3550a..f4e1a8e24e 100644
--- a/src/util/tests/string_buffer/meson.build
+++ b/src/util/tests/string_buffer/meson.build
@@ -26,5 +26,6 @@ test(
     dependencies : [dep_thread, dep_dl, idep_gtest],
     include_directories : inc_common,
     link_with : [libmesa_util],
-  )
+  ),
+  suite : ['util'],
 )
diff --git a/src/util/tests/vma/meson.build b/src/util/tests/vma/meson.build
index 53562db312..22137eb671 100644
--- a/src/util/tests/vma/meson.build
+++ b/src/util/tests/vma/meson.build
@@ -25,5 +25,6 @@ test(
     'vma_random_test.cpp',
     include_directories : [inc_include, inc_util],
     link_with : [libmesa_util],
-  )
+  ),
+  suite : ['util'],
 )




More information about the mesa-commit mailing list