meson: Add tests to suites
authorDylan Baker <dylan@pnwbakers.com>
Mon, 19 Nov 2018 21:44:15 +0000 (13:44 -0800)
committerDylan Baker <dylan@pnwbakers.com>
Tue, 20 Nov 2018 17:09:22 +0000 (09:09 -0800)
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@collabora.com>
Acked-by: Eric Engestrom <eric.engestrom@intel.com>
24 files changed:
src/broadcom/qpu/meson.build
src/compiler/glsl/glcpp/meson.build
src/compiler/glsl/tests/meson.build
src/compiler/nir/meson.build
src/egl/meson.build
src/gallium/drivers/llvmpipe/meson.build
src/gallium/drivers/r300/meson.build
src/gbm/meson.build
src/glx/tests/meson.build
src/intel/compiler/meson.build
src/intel/isl/meson.build
src/intel/vulkan/meson.build
src/mapi/es1api/meson.build
src/mapi/es2api/meson.build
src/mapi/glapi/meson.build
src/mapi/shared-glapi/meson.build
src/mesa/main/tests/meson.build
src/mesa/state_tracker/tests/meson.build
src/util/meson.build
src/util/tests/fast_idiv_by_const/meson.build
src/util/tests/hash_table/meson.build
src/util/tests/set/meson.build
src/util/tests/string_buffer/meson.build
src/util/tests/vma/meson.build

index 8a40016064d8362bc598eb4458561a4201ab1b63..279b09cb95a0138b02f110e2997c90dec77af6fa 100644 (file)
@@ -41,5 +41,6 @@ test(
     'qpu_disasm', 'tests/qpu_disasm.c',
     link_with: [libbroadcom_qpu, libmesa_util],
     include_directories: inc_common
     'qpu_disasm', 'tests/qpu_disasm.c',
     link_with: [libbroadcom_qpu, libmesa_util],
     include_directories: inc_common
-  )
+  ),
+  suite : ['broadcom'],
 )
 )
index a03d589b3701738286b4009f115917fc80824eb4..677baf1df109c5df56fb5f94713c88412e0fba9b 100644 (file)
@@ -70,6 +70,7 @@ if with_any_opengl and with_tests
         glcpp, join_paths(meson.current_source_dir(), 'tests'),
         '--@0@'.format(m),
       ],
         glcpp, join_paths(meson.current_source_dir(), 'tests'),
         '--@0@'.format(m),
       ],
+      suite : ['compiler', 'glcpp'],
     )
   endforeach
 endif
     )
   endforeach
 endif
index 2a41e30a28d51a1bb74133188330cfc7a43b9b17..02f3355c43cb2ea1c27377882b41901a7d553a08 100644 (file)
@@ -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],
     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(
 )
 
 test(
@@ -38,7 +39,8 @@ test(
     include_directories : [inc_common, inc_glsl],
     link_with : [libglsl],
     dependencies : [dep_clock, dep_thread],
     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],
     include_directories : [inc_common, inc_glsl],
     link_with : [libglsl, libglsl_standalone, libglsl_util],
     dependencies : [dep_clock, dep_thread, idep_gtest],
-  )
+  ),
+  suite : ['compiler', 'glsl'],
 )
 
 test(
 )
 
 test(
@@ -68,7 +71,8 @@ test(
     include_directories : [inc_common, inc_glsl],
     link_with : [libglsl, libglsl_util],
     dependencies : [dep_thread, idep_gtest],
     include_directories : [inc_common, inc_glsl],
     link_with : [libglsl, libglsl_util],
     dependencies : [dep_thread, idep_gtest],
-  )
+  ),
+  suite : ['compiler', 'glsl'],
 )
 
 test(
 )
 
 test(
@@ -80,7 +84,8 @@ test(
     include_directories : [inc_common, inc_glsl],
     link_with : [libglsl, libglsl_util],
     dependencies : [dep_thread, idep_gtest],
     include_directories : [inc_common, inc_glsl],
     link_with : [libglsl, libglsl_util],
     dependencies : [dep_thread, idep_gtest],
-  )
+  ),
+  suite : ['compiler', 'glsl'],
 )
 
 test(
 )
 
 test(
@@ -93,7 +98,9 @@ test(
       meson.source_root(), 'src', 'compiler', 'glsl', 'tests', 'warnings'
     ),
   ],
       meson.source_root(), 'src', 'compiler', 'glsl', 'tests', 'warnings'
     ),
   ],
+  suite : ['compiler', 'glsl'],
 )
 )
+
 test(
   'glsl optimization',
   prog_python,
 test(
   'glsl optimization',
   prog_python,
@@ -101,4 +108,5 @@ test(
     join_paths(meson.current_source_dir(), 'optimization_test.py'),
     '--test-runner', glsl_test
   ],
     join_paths(meson.current_source_dir(), 'optimization_test.py'),
     '--test-runner', glsl_test
   ],
+  suite : ['compiler', 'glsl'],
 )
 )
index b0c3a7feb31ce1a870f9b6650e865476603f1bd3..61f61f0a34bbfc492fa27c87d8af890dfb0f9736 100644 (file)
@@ -246,8 +246,10 @@ if with_tests
       include_directories : [inc_common],
       dependencies : [dep_thread, idep_gtest, idep_nir],
       link_with : libmesa_util,
       include_directories : [inc_common],
       dependencies : [dep_thread, idep_gtest, idep_nir],
       link_with : libmesa_util,
-    )
+    ), 
+    suite : ['compiler', 'nir'],
   )
   )
+
   test(
     'nir_vars',
     executable(
   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,
       include_directories : [inc_common],
       dependencies : [dep_thread, idep_gtest, idep_nir],
       link_with : libmesa_util,
-    )
+    ),
+    suite : ['compiler', 'nir'],
   )
 endif
   )
 endif
index 372842967d37f98e8b8bd0d5c6f7c44754cd19fe..89bac2cd63347504120d277abe35ce28e8344974 100644 (file)
@@ -200,11 +200,13 @@ if with_tests
     test('egl-symbols-check',
       find_program('egl-symbols-check'),
       env : env_test,
     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'),
     )
   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
   )
 endif
index 0b0ac2a3a023fb7bb12fb1b797ddff07e32266f7..51562b10dc7d7b9ff4820bf888405c0df3a29f69 100644 (file)
@@ -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],
         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
     )
   endforeach
 endif
index d181048c51d9a8efa0ab79ce5c4e39fce876bbb5..f46aedffdfed2f329e3fbf46da01e79d03258064 100644 (file)
@@ -158,6 +158,7 @@ if with_tests
       ],
       link_with : [libr300, libgallium, libmesa_util],
       dependencies : [dep_m, dep_clock, dep_dl, dep_thread, dep_unwind],
       ],
       link_with : [libr300, libgallium, libmesa_util],
       dependencies : [dep_m, dep_clock, dep_dl, dep_thread, dep_unwind],
-    )
+    ),
+    suite : ['r300'],
   )
 endif
   )
 endif
index 007f50a9ae3268c0682ac63b6b28f96b3909b045..b2ad66735926fc33881375b16ebe3d594ee91f6c 100644 (file)
@@ -71,6 +71,7 @@ if with_tests
     'gbm-symbols-check',
     find_program('gbm-symbols-check'),
     env : env_test,
     'gbm-symbols-check',
     find_program('gbm-symbols-check'),
     env : env_test,
-    args : libgbm
+    args : libgbm,
+    suite : ['gbm'],
   )
 endif
   )
 endif
index fd9d4d433b2d4edf0febcf6e4ea26cc70c36f4e1..fa3ca9db8cd99d9320a6e95d9b98f5fefaa56391 100644 (file)
@@ -44,6 +44,7 @@ if with_shared_glapi
         include_directories('..'),
       ],
       dependencies : [dep_libdrm, dep_thread, idep_gtest]
         include_directories('..'),
       ],
       dependencies : [dep_libdrm, dep_thread, idep_gtest]
-    )
+    ),
+    suite : ['glx'],
   )
 endif
   )
 endif
index 953e8dcc9718d675cb7b0471f807645d390adcba..2124278cc04f8d45839381b525b0b481f434bd81 100644 (file)
@@ -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],
           libintel_compiler, libintel_common, libintel_dev, libmesa_util, libisl,
         ],
         dependencies : [dep_thread, dep_dl, idep_gtest, idep_nir],
-      )
+      ),
+      suite : ['intel'],
     )
   endforeach
 endif
     )
   endforeach
 endif
index 62cde190e6e8a0b963843f79d0088c800843ad73..a6374f6c4f3fa2049e364d1ac91981782d592281 100644 (file)
@@ -96,6 +96,7 @@ if with_tests
       dependencies : dep_m,
       include_directories : [inc_common, inc_intel],
       link_with : [libisl, libintel_dev, libmesa_util],
       dependencies : dep_m,
       include_directories : [inc_common, inc_intel],
       link_with : [libisl, libintel_dev, libmesa_util],
-    )
+    ),
+    suite : ['intel'],
   )
 endif
   )
 endif
index b983486740725734b9169c210d919f622c4f5907..e30e92252898094c349d73bcf856c5cc1b545ff3 100644 (file)
@@ -238,7 +238,8 @@ if with_tests
         include_directories : [
           inc_common, inc_intel, inc_compiler, inc_vulkan_util, inc_vulkan_wsi,
         ],
         include_directories : [
           inc_common, inc_intel, inc_compiler, inc_vulkan_util, inc_vulkan_wsi,
         ],
-      )
+      ),
+      suite : ['intel'],
     )
   endforeach
 endif
     )
   endforeach
 endif
index d8a77a41df2ccf71aba651735885f9e28ad8e391..53e894f091c1446e33ea0c60438c2c6c9933a894 100644 (file)
@@ -56,6 +56,7 @@ if with_tests
     'es1-ABI-check',
     find_program('ABI-check'),
     env : env_test,
     'es1-ABI-check',
     find_program('ABI-check'),
     env : env_test,
-    args : libglesv1_cm
+    args : libglesv1_cm,
+    suite : ['mapi'],
   )
 endif
   )
 endif
index 891e6f7b27b7a037b090a4893c20f38e29f6e7ed..1f397e2b752976a876648a84fc8f17d167d58148 100644 (file)
@@ -56,6 +56,7 @@ if with_tests
     'es2-ABI-check',
     find_program('ABI-check'),
     env : env_test,
     'es2-ABI-check',
     find_program('ABI-check'),
     env : env_test,
-    args : libgles2
+    args : libgles2,
+    suite : ['mapi'],
   )
 endif
   )
 endif
index 048bee8a1ad279f203e29ab6a112fcd691555be7..7e8bc38a817681076c073a266b991ffe51bc75b3 100644 (file)
@@ -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],
       include_directories : [inc_include, inc_src, inc_mesa, inc_mapi],
       link_with : [libglapi_static],
       dependencies : [idep_gtest, dep_thread],
-    )
+    ),
+    suite : ['mapi'],
   )
 endif
   )
 endif
index dcc6079af3d6eee9928e7ae8137d862f06bbe6ac..41da9b1c1c5ad0be39a8a3b6e7f9d799fd60b97d 100644 (file)
@@ -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],
       include_directories : [inc_src, inc_include, inc_mapi],
       link_with : [libglapi],
       dependencies : [dep_thread, idep_gtest],
-    )
+    ),
+    suite : ['mapi'],
   )
 endif
   )
 endif
index d1bd81a5604eaf5866d23076f2e36206791eaf81..4b39325154ec5ab5bb0e47bfb90ddf83470cb656 100644 (file)
@@ -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],
     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'],
 )
 )
index 5c472104d854d41d7b26bfdd4e4e8e6c619e5933..892362b22ff898f0f1f84392cb178b3486b8798c 100644 (file)
@@ -35,8 +35,9 @@ test(
       libmesa_st_test_common, libmesa_gallium, libglapi, libgallium,
       libmesa_util,
     ],
       libmesa_st_test_common, libmesa_gallium, libglapi, libgallium,
       libmesa_util,
     ],
-    dependencies : [idep_gtest, dep_thread]
-  )
+    dependencies : [idep_gtest, dep_thread],
+  ),
+  suite : ['st_mesa'],
 )
 
 test(
 )
 
 test(
@@ -50,5 +51,6 @@ test(
       libmesa_util,
     ],
     dependencies : [idep_gtest, dep_thread]
       libmesa_util,
     ],
     dependencies : [idep_gtest, dep_thread]
-  )
+  ),
+  suite : ['st_mesa'],
 )
 )
index 156621aff651de405d52408aef54e014327437ff..397c2228129230f7d663e67b40558949fe82a82c 100644 (file)
@@ -151,7 +151,8 @@ if with_tests
       include_directories : inc_common,
       link_with : libmesa_util,
       c_args : [c_msvc_compat_args],
       include_directories : inc_common,
       link_with : libmesa_util,
       c_args : [c_msvc_compat_args],
-    )
+    ),
+    suite : ['util'],
   )
 
   test(
   )
 
   test(
@@ -162,7 +163,8 @@ if with_tests
       include_directories : inc_common,
       c_args : [c_msvc_compat_args],
       dependencies : [dep_m],
       include_directories : inc_common,
       c_args : [c_msvc_compat_args],
       dependencies : [dep_m],
-    )
+    ),
+    suite : ['util'],
   )
 
   test(
   )
 
   test(
@@ -173,7 +175,8 @@ if with_tests
       include_directories : inc_common,
       link_with : libmesa_util,
       c_args : [c_msvc_compat_args],
       include_directories : inc_common,
       link_with : libmesa_util,
       c_args : [c_msvc_compat_args],
-    )
+    ),
+    suite : ['util'],
   )
 
   subdir('tests/fast_idiv_by_const')
   )
 
   subdir('tests/fast_idiv_by_const')
index 8c3b79493ffde6b20e39de39b02b3af965fa1991..90ac7d15972ddd97bae729b30e51710b37bc9f7f 100644 (file)
@@ -26,5 +26,6 @@ test(
     dependencies : [dep_thread, dep_dl, idep_gtest],
     include_directories : inc_common,
     link_with : [libmesa_util],
     dependencies : [dep_thread, dep_dl, idep_gtest],
     include_directories : inc_common,
     link_with : [libmesa_util],
-  )
+  ),
+  suite : ['util'],
 )
 )
index c7b03f19c56fb5a6a5da830d5bd64b54aea49edf..d4de448aea562aa47626aa83f72bc141bc3cd3b8 100644 (file)
@@ -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,
       dependencies : [dep_thread, dep_dl],
       include_directories : [inc_include, inc_util],
       link_with : libmesa_util,
-    )
+    ),
+    suite : ['util'],
   )
 endforeach
   )
 endforeach
index add3fc56020736f51721a7de3ac0dd043bfc662e..5ab180c11ebe4abc78016b0483fb06bccbef8ef6 100644 (file)
@@ -26,5 +26,6 @@ test(
     dependencies : [dep_thread, dep_dl, idep_gtest],
     include_directories : inc_common,
     link_with : [libmesa_util],
     dependencies : [dep_thread, dep_dl, idep_gtest],
     include_directories : inc_common,
     link_with : [libmesa_util],
-  )
+  ),
+  suite : ['util'],
 )
 )
index 9f42e3550ae15c63f2cefec0d7cffbd14bafafd5..f4e1a8e24e646ea57128efd4692f18fa43d0efdd 100644 (file)
@@ -26,5 +26,6 @@ test(
     dependencies : [dep_thread, dep_dl, idep_gtest],
     include_directories : inc_common,
     link_with : [libmesa_util],
     dependencies : [dep_thread, dep_dl, idep_gtest],
     include_directories : inc_common,
     link_with : [libmesa_util],
-  )
+  ),
+  suite : ['util'],
 )
 )
index 53562db312bdd2d59fc2dc7b2f5b3e6373a55f1e..22137eb671e9ea646ce0bc5d71980acf1a92af9f 100644 (file)
@@ -25,5 +25,6 @@ test(
     'vma_random_test.cpp',
     include_directories : [inc_include, inc_util],
     link_with : [libmesa_util],
     'vma_random_test.cpp',
     include_directories : [inc_include, inc_util],
     link_with : [libmesa_util],
-  )
+  ),
+  suite : ['util'],
 )
 )