Skip to contentSkip to conversation

package/ltp-testsuite: simplify code to exclude test-cases

PATCH New Yann E. MORIN 2 participants 3 messages Jan 26, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/ltp-testsuite: simplify code to exclude test-cases

We have three conditions under which some tests may get removed:
uClibc, musl, static libraries. All three use the same mechanism to exclude those test-cases: remove the files.

The first two use a common variable to list the affected files, and share the same hook of their own to iterate over that list, while the third has its own hook.

This is not very clean, so switch to using a single variable and a single hook for all three conditions.

---
 package/ltp-testsuite/ltp-testsuite.mk | 22 ++++++++--------------
 1 file changed, 8 insertions(+), 14 deletions(-)
package/ltp-testsuite/ltp-testsuite.mk +8 -14
index 4d7aa451b5..43ee134d1c 100644
@@ -65,12 +65,11 @@ LTP_TESTSUITE_CONF_ENV += \
 	SYSROOT="$(STAGING_DIR)"
 
 # uclibc: bessel support normally not enabled
-ifeq ($(BR2_TOOLCHAIN_USES_UCLIBC),y)
-LTP_TESTSUITE_UNSUPPORTED_TEST_CASES = \
+LTP_TESTSUITE_UNSUPPORTED_TEST_CASES_$(BR2_TOOLCHAIN_USES_UCLIBC) += \
 	testcases/misc/math/float/bessel/ \
 	testcases/misc/math/float/float_bessel.c
-else ifeq ($(BR2_TOOLCHAIN_USES_MUSL),y)
-LTP_TESTSUITE_UNSUPPORTED_TEST_CASES = \
+
+LTP_TESTSUITE_UNSUPPORTED_TEST_CASES_$(BR2_TOOLCHAIN_USES_MUSL) += \
 	testcases/kernel/sched/process_stress/process.c \
 	testcases/kernel/syscalls/confstr/confstr01.c \
 	testcases/kernel/syscalls/fmtmsg/fmtmsg01.c \
@@ -79,22 +78,17 @@ LTP_TESTSUITE_UNSUPPORTED_TEST_CASES = \
 	testcases/kernel/syscalls/timer_create/timer_create01.c \
 	testcases/kernel/syscalls/timer_create/timer_create03.c \
 	utils/benchmark/ebizzy-0.3
-endif
+
+# ldd command build system tries to build a shared library unconditionally.
+LTP_TESTSUITE_UNSUPPORTED_TEST_CASES_$(BR2_STATIC_LIBS) += \
+	testcases/commands/ldd
 
 define LTP_TESTSUITE_REMOVE_UNSUPPORTED_TESTCASES
-	$(foreach f,$(LTP_TESTSUITE_UNSUPPORTED_TEST_CASES),
+	$(foreach f,$(LTP_TESTSUITE_UNSUPPORTED_TEST_CASES_y),
 		rm -rf $(@D)/$(f)
 	)
 endef
 
 LTP_TESTSUITE_POST_PATCH_HOOKS += LTP_TESTSUITE_REMOVE_UNSUPPORTED_TESTCASES
 
-# ldd command build system tries to build a shared library unconditionally.
-ifeq ($(BR2_STATIC_LIBS),y)
-define LTP_TESTSUITE_REMOVE_LDD
-	rm -rf $(@D)/testcases/commands/ldd
-endef
-LTP_TESTSUITE_POST_PATCH_HOOKS += LTP_TESTSUITE_REMOVE_LDD
-endif
-
 $(eval $(autotools-package))
Signature · 1 line
2.25.1
#1 lore raw

PATCH 1/1 package/ltp-testsuite: simplify code to exclude test-cases

Hi Yann,

Quoted 10 lines

We have three conditions under which some tests may get removed:
uClibc, musl, static libraries. All three use the same mechanism to exclude those test-cases: remove the files.

The first two use a common variable to list the affected files, and share the same hook of their own to iterate over that list, while the third has its own hook.

This is not very clean, so switch to using a single variable and a single hook for all three conditions.

Nice cleanup, thank you!

Kind regards,
Petr

author Applied
#2 lore raw

PATCH 1/1 package/ltp-testsuite: simplify code to exclude test-cases

Petr, All,

On 2021-01-26 18:58 +0100, Petr Vorel spake thusly:

Quoted 11 lines
Quoted 10 lines

We have three conditions under which some tests may get removed:
uClibc, musl, static libraries. All three use the same mechanism to exclude those test-cases: remove the files.

The first two use a common variable to list the affected files, and share the same hook of their own to iterate over that list, while the third has its own hook.

This is not very clean, so switch to using a single variable and a single hook for all three conditions.

Nice cleanup, thank you!

:-)

Quoted 1 line

Applied to master, thanks for the review.

Regards,
Yann E. MORIN.

Quoted 6 lines

Kind regards,
Petr
_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'