All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] test: missing dependency for test/cmd/setexpr.c
@ 2021-02-17 11:58 Heinrich Schuchardt
  2021-02-19  4:52 ` Simon Glass
  2021-02-25 13:29 ` Tom Rini
  0 siblings, 2 replies; 5+ messages in thread
From: Heinrich Schuchardt @ 2021-02-17 11:58 UTC (permalink / raw)
  To: u-boot

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'

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---
 test/cmd/Makefile | 2 +-
 test/cmd_ut.c     | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/test/cmd/Makefile b/test/cmd/Makefile
index 5451e9ea90..c84df60395 100644
--- a/test/cmd/Makefile
+++ b/test/cmd/Makefile
@@ -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
diff --git a/test/cmd_ut.c b/test/cmd_ut.c
index 90674d5de5..8f3089890e 100644
--- a/test/cmd_ut.c
+++ b/test/cmd_ut.c
@@ -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

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

* [PATCH 1/1] test: missing dependency for test/cmd/setexpr.c
  2021-02-17 11:58 [PATCH 1/1] test: missing dependency for test/cmd/setexpr.c Heinrich Schuchardt
@ 2021-02-19  4:52 ` Simon Glass
  2021-02-19  5:08   ` Heinrich Schuchardt
  2021-02-25 13:29 ` Tom Rini
  1 sibling, 1 reply; 5+ messages in thread
From: Simon Glass @ 2021-02-19  4:52 UTC (permalink / raw)
  To: u-boot

Hi Heinrich,

On Wed, 17 Feb 2021 at 04:58, Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:
>
> 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'
>
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> ---
>  test/cmd/Makefile | 2 +-
>  test/cmd_ut.c     | 2 ++
>  2 files changed, 3 insertions(+), 1 deletion(-)

Reviewed-by: Simon Glass <sjg@chromium.org>

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

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

* [PATCH 1/1] test: missing dependency for test/cmd/setexpr.c
  2021-02-19  4:52 ` Simon Glass
@ 2021-02-19  5:08   ` Heinrich Schuchardt
  2021-02-20 11:55     ` Simon Glass
  0 siblings, 1 reply; 5+ messages in thread
From: Heinrich Schuchardt @ 2021-02-19  5:08 UTC (permalink / raw)
  To: u-boot

On 2/19/21 5:52 AM, Simon Glass wrote:
> Hi Heinrich,
>
> On Wed, 17 Feb 2021 at 04:58, Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:
>>
>> 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'
>>
>> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
>> ---
>>   test/cmd/Makefile | 2 +-
>>   test/cmd_ut.c     | 2 ++
>>   2 files changed, 3 insertions(+), 1 deletion(-)
>
> Reviewed-by: Simon Glass <sjg@chromium.org>
>
> 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

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

* [PATCH 1/1] test: missing dependency for test/cmd/setexpr.c
  2021-02-19  5:08   ` Heinrich Schuchardt
@ 2021-02-20 11:55     ` Simon Glass
  0 siblings, 0 replies; 5+ messages in thread
From: Simon Glass @ 2021-02-20 11:55 UTC (permalink / raw)
  To: u-boot

Hi Heinrich,

On Thu, 18 Feb 2021 at 22:08, Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:
>
> On 2/19/21 5:52 AM, Simon Glass wrote:
> > Hi Heinrich,
> >
> > On Wed, 17 Feb 2021 at 04:58, Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:
> >>
> >> 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'
> >>
> >> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> >> ---
> >>   test/cmd/Makefile | 2 +-
> >>   test/cmd_ut.c     | 2 ++
> >>   2 files changed, 3 insertions(+), 1 deletion(-)
> >
> > Reviewed-by: Simon Glass <sjg@chromium.org>
> >
> > 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.

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

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

* [PATCH 1/1] test: missing dependency for test/cmd/setexpr.c
  2021-02-17 11:58 [PATCH 1/1] test: missing dependency for test/cmd/setexpr.c Heinrich Schuchardt
  2021-02-19  4:52 ` Simon Glass
@ 2021-02-25 13:29 ` Tom Rini
  1 sibling, 0 replies; 5+ messages in thread
From: Tom Rini @ 2021-02-25 13:29 UTC (permalink / raw)
  To: u-boot

On Wed, Feb 17, 2021 at 12:58:14PM +0100, Heinrich Schuchardt wrote:

> 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'
> 
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> Reviewed-by: Simon Glass <sjg@chromium.org>

Applied to u-boot/master, thanks!

-- 
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>

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

end of thread, other threads:[~2021-02-25 13:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-17 11:58 [PATCH 1/1] test: missing dependency for test/cmd/setexpr.c Heinrich Schuchardt
2021-02-19  4:52 ` Simon Glass
2021-02-19  5:08   ` Heinrich Schuchardt
2021-02-20 11:55     ` Simon Glass
2021-02-25 13:29 ` Tom Rini

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.