Commit 85c9f3a
Eric Biggers
lib/crc: tests: Make crc_kunit test only the enabled CRC variants
Like commit 4478e8e ("lib/crypto: tests: Depend on library options
rather than selecting them") did with the crypto library tests, make
crc_kunit depend on the code it tests rather than selecting it. This
follows the standard convention for KUnit and fixes an issue where
enabling KUNIT_ALL_TESTS enabled non-test code.
crc_kunit does differ from the crypto library tests in that it
consolidates the tests for multiple CRC variants, with 5 kconfig
options, into one KUnit suite. Since depending on *all* of these
kconfig options would greatly restrict the ability to enable crc_kunit,
instead just depend on *any* of these options. Update crc_kunit
accordingly to test only the reachable code.
Alternatively we could split crc_kunit into 5 test suites. But keeping
it as one is simpler for now.
Fixes: e47d9b1 ("lib/crc_kunit.c: add KUnit test suite for CRC library functions")
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20260306033557.250499-2-ebiggers@kernel.org
Signed-off-by: Eric Biggers <ebiggers@kernel.org>1 parent 1f318b9 commit 85c9f3a
2 files changed
Lines changed: 23 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
102 | | - | |
| 102 | + | |
103 | 103 | | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | 104 | | |
110 | 105 | | |
111 | 106 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
268 | 268 | | |
269 | 269 | | |
270 | 270 | | |
271 | | - | |
272 | | - | |
| 271 | + | |
273 | 272 | | |
274 | 273 | | |
275 | 274 | | |
| |||
294 | 293 | | |
295 | 294 | | |
296 | 295 | | |
| 296 | + | |
297 | 297 | | |
298 | | - | |
299 | | - | |
| 298 | + | |
300 | 299 | | |
301 | 300 | | |
302 | 301 | | |
| |||
318 | 317 | | |
319 | 318 | | |
320 | 319 | | |
| 320 | + | |
321 | 321 | | |
322 | | - | |
323 | | - | |
| 322 | + | |
324 | 323 | | |
325 | 324 | | |
326 | 325 | | |
| |||
342 | 341 | | |
343 | 342 | | |
344 | 343 | | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
345 | 347 | | |
346 | 348 | | |
347 | 349 | | |
| |||
414 | 416 | | |
415 | 417 | | |
416 | 418 | | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
417 | 422 | | |
418 | 423 | | |
419 | 424 | | |
| |||
463 | 468 | | |
464 | 469 | | |
465 | 470 | | |
| 471 | + | |
466 | 472 | | |
467 | 473 | | |
| 474 | + | |
468 | 475 | | |
469 | 476 | | |
| 477 | + | |
| 478 | + | |
470 | 479 | | |
471 | 480 | | |
| 481 | + | |
| 482 | + | |
472 | 483 | | |
473 | 484 | | |
| 485 | + | |
| 486 | + | |
474 | 487 | | |
475 | 488 | | |
476 | 489 | | |
477 | 490 | | |
478 | 491 | | |
479 | 492 | | |
| 493 | + | |
| 494 | + | |
480 | 495 | | |
481 | 496 | | |
482 | 497 | | |
483 | 498 | | |
| 499 | + | |
484 | 500 | | |
485 | 501 | | |
486 | 502 | | |
| |||
0 commit comments