[U-Boot,1/1] test: call hexdump tests via `ut lib`

Message ID 20190211172924.10451-1-xypron.glpk@gmx.de
State New
Delegated to: Tom Rini
Headers show
Series
  • [U-Boot,1/1] test: call hexdump tests via `ut lib`
Related show

Commit Message

Heinrich Schuchardt Feb. 11, 2019, 5:29 p.m.
The unit tests in test/lib/hexdump.c are not related to the device tree.
So they should be executed via `ut lib` and not via `ut dm`.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---
 test/lib/hexdump.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

Comments

Simon Goldschmidt Feb. 11, 2019, 7:42 p.m. | #1
Am 11.02.2019 um 18:29 schrieb Heinrich Schuchardt:
> The unit tests in test/lib/hexdump.c are not related to the device tree.
> So they should be executed via `ut lib` and not via `ut dm`.
> 
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

Reviewed-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

Excellent idea, I'll send the same for test/lib/lmb.c.

Thanks,
Simon

> ---
>   test/lib/hexdump.c | 9 +++++----
>   1 file changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/test/lib/hexdump.c b/test/lib/hexdump.c
> index 567b57686a..5dccf43886 100644
> --- a/test/lib/hexdump.c
> +++ b/test/lib/hexdump.c
> @@ -6,7 +6,8 @@
>   
>   #include <common.h>
>   #include <hexdump.h>
> -#include <dm/test.h>
> +#include <test/lib.h>
> +#include <test/test.h>
>   #include <test/ut.h>
>   
>   static int lib_test_hex_to_bin(struct unit_test_state *uts)
> @@ -32,7 +33,7 @@ static int lib_test_hex_to_bin(struct unit_test_state *uts)
>   	return 0;
>   }
>   
> -DM_TEST(lib_test_hex_to_bin, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
> +LIB_TEST(lib_test_hex_to_bin, 0);
>   
>   static int lib_test_hex2bin(struct unit_test_state *uts)
>   {
> @@ -62,7 +63,7 @@ static int lib_test_hex2bin(struct unit_test_state *uts)
>   	return 0;
>   }
>   
> -DM_TEST(lib_test_hex2bin, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
> +LIB_TEST(lib_test_hex2bin, 0);
>   
>   static int lib_test_bin2hex(struct unit_test_state *uts)
>   {
> @@ -92,4 +93,4 @@ static int lib_test_bin2hex(struct unit_test_state *uts)
>   	return 0;
>   }
>   
> -DM_TEST(lib_test_bin2hex, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
> +LIB_TEST(lib_test_bin2hex, 0);
>
Heinrich Schuchardt April 10, 2019, 12:08 a.m. | #2
On 2/11/19 8:42 PM, Simon Goldschmidt wrote:
> Am 11.02.2019 um 18:29 schrieb Heinrich Schuchardt:
>> The unit tests in test/lib/hexdump.c are not related to the device tree.
>> So they should be executed via `ut lib` and not via `ut dm`.
>>
>> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
>
> Reviewed-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

Hello Tom,

please, consider the patch for v2019-07.

Best regards

Heinrich

>
> Excellent idea, I'll send the same for test/lib/lmb.c.
>
> Thanks,
> Simon
>
>> ---
>>   test/lib/hexdump.c | 9 +++++----
>>   1 file changed, 5 insertions(+), 4 deletions(-)
>>
>> diff --git a/test/lib/hexdump.c b/test/lib/hexdump.c
>> index 567b57686a..5dccf43886 100644
>> --- a/test/lib/hexdump.c
>> +++ b/test/lib/hexdump.c
>> @@ -6,7 +6,8 @@
>>     #include <common.h>
>>   #include <hexdump.h>
>> -#include <dm/test.h>
>> +#include <test/lib.h>
>> +#include <test/test.h>
>>   #include <test/ut.h>
>>     static int lib_test_hex_to_bin(struct unit_test_state *uts)
>> @@ -32,7 +33,7 @@ static int lib_test_hex_to_bin(struct
>> unit_test_state *uts)
>>       return 0;
>>   }
>>   -DM_TEST(lib_test_hex_to_bin, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
>> +LIB_TEST(lib_test_hex_to_bin, 0);
>>     static int lib_test_hex2bin(struct unit_test_state *uts)
>>   {
>> @@ -62,7 +63,7 @@ static int lib_test_hex2bin(struct unit_test_state
>> *uts)
>>       return 0;
>>   }
>>   -DM_TEST(lib_test_hex2bin, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
>> +LIB_TEST(lib_test_hex2bin, 0);
>>     static int lib_test_bin2hex(struct unit_test_state *uts)
>>   {
>> @@ -92,4 +93,4 @@ static int lib_test_bin2hex(struct unit_test_state
>> *uts)
>>       return 0;
>>   }
>>   -DM_TEST(lib_test_bin2hex, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
>> +LIB_TEST(lib_test_bin2hex, 0);
>>
>
>

Patch

diff --git a/test/lib/hexdump.c b/test/lib/hexdump.c
index 567b57686a..5dccf43886 100644
--- a/test/lib/hexdump.c
+++ b/test/lib/hexdump.c
@@ -6,7 +6,8 @@ 
 
 #include <common.h>
 #include <hexdump.h>
-#include <dm/test.h>
+#include <test/lib.h>
+#include <test/test.h>
 #include <test/ut.h>
 
 static int lib_test_hex_to_bin(struct unit_test_state *uts)
@@ -32,7 +33,7 @@  static int lib_test_hex_to_bin(struct unit_test_state *uts)
 	return 0;
 }
 
-DM_TEST(lib_test_hex_to_bin, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
+LIB_TEST(lib_test_hex_to_bin, 0);
 
 static int lib_test_hex2bin(struct unit_test_state *uts)
 {
@@ -62,7 +63,7 @@  static int lib_test_hex2bin(struct unit_test_state *uts)
 	return 0;
 }
 
-DM_TEST(lib_test_hex2bin, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
+LIB_TEST(lib_test_hex2bin, 0);
 
 static int lib_test_bin2hex(struct unit_test_state *uts)
 {
@@ -92,4 +93,4 @@  static int lib_test_bin2hex(struct unit_test_state *uts)
 	return 0;
 }
 
-DM_TEST(lib_test_bin2hex, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
+LIB_TEST(lib_test_bin2hex, 0);