Skip to contentSkip to conversation

test: missing dependency for test/cmd/setexpr.c

PATCH New Heinrich Schuchardt 3 participants 5 messages Feb 17, 2021 – Feb 25, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 test: missing dependency for test/cmd/setexpr.c

test/cmd/setexpr.c cannot be linked with CONFIG_CMD_SETEXPR=n:

ld.bfd: test/built-in.o: in function `setexpr_test_sub':
test/cmd/setexpr.c:227: undefined reference to setexpr_regex_sub' ld.bfd: test/built-in.o: in function setexpr_test_backref':
test/cmd/setexpr.c:267: undefined reference to `setexpr_regex_sub'

---
 test/cmd/Makefile | 2 +-
 test/cmd_ut.c     | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)
test/cmd/Makefile +1 -1
index 5451e9ea90..c84df60395 100644
@@ -8,4 +8,4 @@ endif
 obj-y += mem.o
 obj-$(CONFIG_CMD_MEM_SEARCH) += mem_search.o
 obj-$(CONFIG_CMD_PWM) += pwm.o
-obj-y += setexpr.o
+obj-$(CONFIG_CMD_SETEXPR) += setexpr.o
test/cmd_ut.c +2 -0
index 90674d5de5..8f3089890e 100644
@@ -75,8 +75,10 @@ static struct cmd_tbl cmd_ut_sub[] = {
 	U_BOOT_CMD_MKENT(log, CONFIG_SYS_MAXARGS, 1, do_ut_log, "", ""),
 #endif
 	U_BOOT_CMD_MKENT(mem, CONFIG_SYS_MAXARGS, 1, do_ut_mem, "", ""),
+#ifdef CONFIG_CMD_SETEXPR
 	U_BOOT_CMD_MKENT(setexpr, CONFIG_SYS_MAXARGS, 1, do_ut_setexpr, "",
 			 ""),
+#endif
 #ifdef CONFIG_UT_TIME
 	U_BOOT_CMD_MKENT(time, CONFIG_SYS_MAXARGS, 1, do_ut_time, "", ""),
 #endif

--
2.30.0

#1 lore raw

PATCH 1/1 test: missing dependency for test/cmd/setexpr.c

Hi Heinrich,

Quoted 8 lines · Heinrich Schuchardt

test/cmd/setexpr.c cannot be linked with CONFIG_CMD_SETEXPR=n:

ld.bfd: test/built-in.o: in function `setexpr_test_sub':
test/cmd/setexpr.c:227: undefined reference to setexpr_regex_sub' ld.bfd: test/built-in.o: in function setexpr_test_backref':
test/cmd/setexpr.c:267: undefined reference to `setexpr_regex_sub'

Quoted 5 lines
---
 test/cmd/Makefile | 2 +-
 test/cmd_ut.c     | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

But I wonder what the goal is here. There is an assumption at present that sandbox runs these tests and has the required features enabled. What are you trying to do?

- Simon

#2 lore raw

PATCH 1/1 test: missing dependency for test/cmd/setexpr.c

Quoted 17 lines · Simon Glass

Hi Heinrich,

Quoted 8 lines · Heinrich Schuchardt

test/cmd/setexpr.c cannot be linked with CONFIG_CMD_SETEXPR=n:

ld.bfd: test/built-in.o: in function `setexpr_test_sub':
test/cmd/setexpr.c:227: undefined reference to setexpr_regex_sub' ld.bfd: test/built-in.o: in function setexpr_test_backref':
test/cmd/setexpr.c:267: undefined reference to `setexpr_regex_sub'

Quoted 5 lines
---
  test/cmd/Makefile | 2 +-
  test/cmd_ut.c     | 2 ++
  2 files changed, 3 insertions(+), 1 deletion(-)
Quoted 6 lines

But I wonder what the goal is here. There is an assumption at present that sandbox runs these tests and has the required features enabled. What are you trying to do?

CONFIG_UNIT_TEST does not depend on the architecture.

I enable and run unit tests on my real hardware, e.g. under RISC-V. Tests that cannot be built or run with the current configuration should not lead to build failures.

Best regards

Heinrich

#3 lore raw

PATCH 1/1 test: missing dependency for test/cmd/setexpr.c

Hi Heinrich,

Quoted 26 lines · Heinrich Schuchardt
Quoted 17 lines · Simon Glass

Hi Heinrich,

Quoted 8 lines · Heinrich Schuchardt

test/cmd/setexpr.c cannot be linked with CONFIG_CMD_SETEXPR=n:

ld.bfd: test/built-in.o: in function `setexpr_test_sub':
test/cmd/setexpr.c:227: undefined reference to setexpr_regex_sub' ld.bfd: test/built-in.o: in function setexpr_test_backref':
test/cmd/setexpr.c:267: undefined reference to `setexpr_regex_sub'

Quoted 5 lines
---
  test/cmd/Makefile | 2 +-
  test/cmd_ut.c     | 2 ++
  2 files changed, 3 insertions(+), 1 deletion(-)
Quoted 6 lines

But I wonder what the goal is here. There is an assumption at present that sandbox runs these tests and has the required features enabled. What are you trying to do?

Quoted 5 lines

CONFIG_UNIT_TEST does not depend on the architecture.

I enable and run unit tests on my real hardware, e.g. under RISC-V. Tests that cannot be built or run with the current configuration should not lead to build failures.

If you want to support this we probably have quite a few things to fix up. It might be worth doing it all at once and documenting what sort of tests are permitted on real hardware. For example, some tests rely on the test .dts and resetting DM which probably won't go down well on real hardware. Are you just thinking about the cmd tests for now?

What sort of bugs are you trying to find?

Regards,
Simon

#4 lore raw

PATCH 1/1 test: missing dependency for test/cmd/setexpr.c

In reply to Heinrich Schuchardt
Quoted 9 lines · Heinrich Schuchardt

test/cmd/setexpr.c cannot be linked with CONFIG_CMD_SETEXPR=n:

ld.bfd: test/built-in.o: in function `setexpr_test_sub':
test/cmd/setexpr.c:227: undefined reference to setexpr_regex_sub' ld.bfd: test/built-in.o: in function setexpr_test_backref':
test/cmd/setexpr.c:267: undefined reference to `setexpr_regex_sub'

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210225/63943a13/attachment.sig>