From: kernel test robot <lkp@intel.com>
To: Vitor Massaru Iha <vitor@massaru.org>, kunit-dev@googlegroups.com
Cc: kbuild-all@lists.01.org, fkostenzer@live.at,
brendanhiggins@google.com, linux-kernel@vger.kernel.org,
linux-kselftest@vger.kernel.org, tglx@linutronix.de,
andriy.shevchenko@linux.intel.com,
linux-kernel-mentees@lists.linuxfoundation.org
Subject: Re: [Linux-kernel-mentees] [PATCH v2] lib: kunit: Convert test_sort to KUnit test
Date: Mon, 3 Aug 2020 14:16:59 +0800 [thread overview]
Message-ID: <202008031451.DTPNfa1b%lkp@intel.com> (raw)
In-Reply-To: <20200729191151.476368-1-vitor@massaru.org>
[-- Attachment #1: Type: text/plain, Size: 2482 bytes --]
Hi Vitor,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on d43c7fb05765152d4d4a39a8ef957c4ea14d8847]
url: https://github.com/0day-ci/linux/commits/Vitor-Massaru-Iha/lib-kunit-Convert-test_sort-to-KUnit-test/20200730-031404
base: d43c7fb05765152d4d4a39a8ef957c4ea14d8847
config: x86_64-randconfig-s022-20200803 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-14) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.2-117-g8c7aee71-dirty
# save the attached .config to linux build tree
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All errors (new ones prefixed by >>):
ld: lib/sort_kunit.o: in function `kunit_test_suites_init':
>> lib/sort_kunit.c:47: undefined reference to `__kunit_test_suites_init'
ld: lib/sort_kunit.o: in function `sort_test':
>> lib/sort_kunit.c:19: undefined reference to `kunit_unary_assert_format'
>> ld: lib/sort_kunit.c:19: undefined reference to `kunit_do_assertion'
>> ld: lib/sort_kunit.c:30: undefined reference to `kunit_fail_assert_format'
ld: lib/sort_kunit.c:30: undefined reference to `kunit_do_assertion'
ld: lib/sort_kunit.o: in function `kunit_test_suites_exit':
>> lib/sort_kunit.c:47: undefined reference to `__kunit_test_suites_exit'
vim +47 lib/sort_kunit.c
13
14 static void __init sort_test(struct kunit *test)
15 {
16 int *a, i, r = 1;
17
18 a = kmalloc_array(TEST_LEN, sizeof(*a), GFP_KERNEL);
> 19 KUNIT_ASSERT_FALSE_MSG(test, a == NULL, "kmalloc_array failed");
20
21 for (i = 0; i < TEST_LEN; i++) {
22 r = (r * 725861) % 6599;
23 a[i] = r;
24 }
25
26 sort(a, TEST_LEN, sizeof(*a), cmpint, NULL);
27
28 for (i = 0; i < TEST_LEN-1; i++)
29 if (a[i] > a[i+1]) {
> 30 KUNIT_FAIL(test, "test has failed");
31 goto exit;
32 }
33 exit:
34 kfree(a);
35 }
36
37 static struct kunit_case __refdata sort_test_cases[] = {
38 KUNIT_CASE(sort_test),
39 {}
40 };
41
42 static struct kunit_suite sort_test_suite = {
43 .name = "sort",
44 .test_cases = sort_test_cases,
45 };
46
> 47 kunit_test_suites(&sort_test_suite);
48
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 31797 bytes --]
[-- Attachment #3: Type: text/plain, Size: 201 bytes --]
_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees
next prev parent reply other threads:[~2020-08-03 6:17 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-29 19:11 [Linux-kernel-mentees] [PATCH v2] lib: kunit: Convert test_sort to KUnit test Vitor Massaru Iha
2020-07-29 19:19 ` Andy Shevchenko
2020-07-29 19:59 ` Brendan Higgins via Linux-kernel-mentees
2020-08-03 8:57 ` Andy Shevchenko
2020-07-29 20:16 ` Vitor Massaru Iha
2020-08-03 6:16 ` kernel test robot [this message]
2020-08-03 7:28 ` kernel test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202008031451.DTPNfa1b%lkp@intel.com \
--to=lkp@intel.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=brendanhiggins@google.com \
--cc=fkostenzer@live.at \
--cc=kbuild-all@lists.01.org \
--cc=kunit-dev@googlegroups.com \
--cc=linux-kernel-mentees@lists.linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=vitor@massaru.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox