Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mauro.chehab@linux.intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t v3 4/5] tests/meson.build: create testlists for tests
Date: Thu,  6 Jul 2023 17:06:37 +0200	[thread overview]
Message-ID: <20230706150638.581415-5-mauro.chehab@linux.intel.com> (raw)
In-Reply-To: <20230706150638.581415-1-mauro.chehab@linux.intel.com>

From: Mauro Carvalho Chehab <mchehab@kernel.org>

Let's dynamically create testlists for during build time, as this
can speed up a lot the validation check for testplan.

Ideally, all it would need to to that would be to use this
logic at the end of tests/meson.build:

    foreach testexe : test_executables
        prog = testexe.name()

        output = prog.split('/').get(-1) + '.testlist'
        custom_target(output,
                     build_by_default : true,
                     command : [ testexe, '--show-testlist'],
                     capture : true,
                     output : output)

Unfortunately, this requies Meson >= 0.54. So, we need to add
one custom_target per executable() call.

Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
---
 tests/meson.build | 54 +++++++++++++++++++++++++++++++++++++++++------
 1 file changed, 47 insertions(+), 7 deletions(-)

diff --git a/tests/meson.build b/tests/meson.build
index 3116c458d60b..6fe5d863c70a 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -353,33 +353,54 @@ test_executables = []
 test_list = []
 
 foreach prog : test_progs
-	test_executables += executable(prog, [prog + '.c'] + extra_sources.get(prog, []),
+	testexe = executable(prog, [prog + '.c'] + extra_sources.get(prog, []),
 		   dependencies : test_deps + extra_dependencies.get(prog, []),
 		   install_dir : libexecdir,
 		   install_rpath : libexecdir_rpathdir,
 		   install : true)
+	test_executables += testexe
 	test_list += prog
+	name = prog.split('/').get(-1)
+	custom_target(name + '.testlist',
+		     build_by_default : true,
+		     command : [testexe, '--show-testlist'],
+		     capture : true,
+		     output : name + '.testlist')
 endforeach
 
 foreach prog : i915_progs
-	test_executables += executable(prog,
+	testexe = executable(prog,
 		   [join_paths('i915', prog + '.c')] + extra_sources.get(prog, []),
 		   dependencies : test_deps + extra_dependencies.get(prog, []),
 		   install_dir : libexecdir,
 		   install_rpath : libexecdir_rpathdir,
 		   install : true)
+	test_executables += testexe
 	test_list += prog
+	name = prog.split('/').get(-1)
+	custom_target(name + '.testlist',
+		     build_by_default : true,
+		     command : [testexe, '--show-testlist'],
+		     capture : true,
+		     output : name + '.testlist')
 endforeach
 
 if build_xe
 	foreach prog : xe_progs
-		test_executables += executable(prog,
+		testexe = executable(prog,
 			   [join_paths('xe', prog + '.c')] + extra_sources.get(prog, []),
 			   dependencies : test_deps + extra_dependencies.get(prog, []),
 			   install_dir : libexecdir,
 			   install_rpath : libexecdir_rpathdir,
 			   install : true)
 		test_list += prog
+		test_executables += testexe
+		name = prog.split('/').get(-1)
+		custom_target(name + '.testlist',
+			     build_by_default : true,
+			     command : [testexe, '--show-testlist'],
+			     capture : true,
+			     output : name + '.testlist')
 	endforeach
 	build_info += 'Xe **experimental** tests enabled.'
 endif
@@ -395,7 +416,7 @@ endforeach
 
 if chamelium.found()
 	foreach prog : chamelium_progs
-		test_executables += executable(prog,
+		testexe = executable(prog,
 				 [join_paths('chamelium', prog + '.c'),
 					join_paths('chamelium', 'kms_chamelium_helper.c')],
 				 dependencies : test_deps,
@@ -403,16 +424,30 @@ if chamelium.found()
 				 install_rpath : libexecdir_rpathdir,
 				 install : true)
 		test_list += prog
+		test_executables += testexe
+		name = prog.split('/').get(-1)
+		custom_target(name + '.testlist',
+			     build_by_default : true,
+			     command : [testexe, '--show-testlist'],
+			     capture : true,
+			     output : name + '.testlist')
 	endforeach
 	test_deps += chamelium
 
-	test_executables += executable('kms_chamelium_color',
+	name = 'kms_chamelium_color'
+	testexe = executable('kms_chamelium_color',
 				[ 'chamelium/kms_chamelium_color.c', 'kms_color_helper.c' ],
 				dependencies : test_deps + [ chamelium ],
 				install_dir : libexecdir,
 				install_rpath : libexecdir_rpathdir,
 				install : true)
-	test_list += 'kms_chamelium_color'
+	test_list += name
+	test_executables += testexe
+	custom_target(name + '.testlist',
+		     build_by_default : true,
+		     command : [testexe, '--show-testlist'],
+		     capture : true,
+		     output : name + '.testlist')
 endif
 
 subdir('amdgpu')
@@ -448,11 +483,16 @@ foreach prog : test_list
 	test('testcase check ' + prog, test_script, args : prog)
 endforeach
 
-executable('gem_stress', 'i915/gem_stress.c',
+testexe = executable('gem_stress', 'i915/gem_stress.c',
 	   install : true,
 	   install_dir : libexecdir,
 	   install_rpath : libexecdir_rpathdir,
 	   dependencies : igt_deps)
+custom_target('gem_stress.testlist',
+                build_by_default : true,
+                command : [testexe, '--show-testlist'],
+                capture : true,
+                output : 'gem_stress.testlist')
 
 image_files = [
   '1080p-left.png',
-- 
2.40.1

  parent reply	other threads:[~2023-07-06 15:06 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-06 15:06 [igt-dev] [PATCH i-g-t v3 0/5] Speedup IGT build time Mauro Carvalho Chehab
2023-07-06 15:06 ` [igt-dev] [PATCH i-g-t v3 1/5] tests/meson.build: Simplify builds for core and i915 targets Mauro Carvalho Chehab
2023-07-06 15:06 ` [igt-dev] [PATCH i-g-t v3 2/5] lib/igt_core: use the macro when checking for list_subtests Mauro Carvalho Chehab
2023-07-06 15:06 ` [igt-dev] [PATCH i-g-t v3 3/5] lib/igt_core: add an option to show the testlist Mauro Carvalho Chehab
2023-07-06 15:06 ` Mauro Carvalho Chehab [this message]
2023-07-06 15:06 ` [igt-dev] [PATCH i-g-t v3 5/5] scripts/test_list.py: speedup testlist check logic Mauro Carvalho Chehab
2023-07-06 17:45 ` [igt-dev] ✗ Fi.CI.BUILD: failure for Speedup IGT build time (rev3) Patchwork
2023-07-07  5:26 ` [igt-dev] ✗ Fi.CI.BUILD: failure for Speedup IGT build time (rev4) Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230706150638.581415-5-mauro.chehab@linux.intel.com \
    --to=mauro.chehab@linux.intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox