All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] support/testing/run-tests: fix --testcases option
@ 2022-07-27 15:02 Arnout Vandecappelle (Essensium/Mind)
  2022-07-27 16:20 ` Yann E. MORIN
  2022-08-30 22:27 ` Peter Korsgaard
  0 siblings, 2 replies; 4+ messages in thread
From: Arnout Vandecappelle (Essensium/Mind) @ 2022-07-27 15:02 UTC (permalink / raw)
  To: buildroot

The --testcases option of run-tests says how many test cases to build in
parallel. It automatically derives a jlevel from it by dividing the
number of cores + 1 by the number of parallel testcases. However, this
will typically result in a fractional number. Make doesn't like
fractional numbers as argument to -j.

Convert the number to integer (rounding up).

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
---
 support/testing/run-tests | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/support/testing/run-tests b/support/testing/run-tests
index 022209b414..f9c0bebc48 100755
--- a/support/testing/run-tests
+++ b/support/testing/run-tests
@@ -87,7 +87,7 @@ def main():
             return 1
         # same default BR2_JLEVEL as package/Makefile.in
         br2_jlevel = 1 + multiprocessing.cpu_count()
-        each_testcase = br2_jlevel / args.testcases
+        each_testcase = int((br2_jlevel + args.testcases - 1) / args.testcases)
         if each_testcase < 1:
             each_testcase = 1
         BRConfigTest.jlevel = each_testcase
-- 
2.35.3

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-08-30 22:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-27 15:02 [Buildroot] [PATCH] support/testing/run-tests: fix --testcases option Arnout Vandecappelle (Essensium/Mind)
2022-07-27 16:20 ` Yann E. MORIN
2022-07-27 16:43   ` Arnout Vandecappelle
2022-08-30 22:27 ` Peter Korsgaard

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.