|
1 | 1 | # SPDX-License-Identifier: BSD-3-Clause
|
2 | 2 | # Copyright(c) 2017 Intel Corporation
|
3 | 3 |
|
| 4 | +if not get_option('tests') |
| 5 | + subdir_done() |
| 6 | +endif |
| 7 | + |
4 | 8 | test_sources = files('commands.c',
|
5 | 9 | 'packet_burst_generator.c',
|
6 | 10 | 'sample_packet_forward.c',
|
@@ -335,86 +339,85 @@ if get_option('default_library') == 'static'
|
335 | 339 | link_libs = dpdk_drivers
|
336 | 340 | endif
|
337 | 341 |
|
338 |
| -if get_option('tests') |
339 |
| - dpdk_test = executable('dpdk-test', |
340 |
| - test_sources, |
341 |
| - link_whole: link_libs, |
342 |
| - dependencies: test_dep_objs, |
343 |
| - c_args: [cflags, '-DALLOW_EXPERIMENTAL_API'], |
344 |
| - install_rpath: driver_install_path, |
345 |
| - install: false) |
| 342 | +dpdk_test = executable('dpdk-test', |
| 343 | + test_sources, |
| 344 | + link_whole: link_libs, |
| 345 | + dependencies: test_dep_objs, |
| 346 | + c_args: [cflags, '-DALLOW_EXPERIMENTAL_API'], |
| 347 | + install_rpath: driver_install_path, |
| 348 | + install: false) |
346 | 349 |
|
347 |
| - # some perf tests (eg: memcpy perf autotest)take very long |
348 |
| - # to complete, so timeout to 10 minutes |
349 |
| - timeout_seconds = 600 |
350 |
| - timeout_seconds_fast = 10 |
351 |
| - |
352 |
| - # Retrieve the number of CPU cores, defaulting to 4. |
353 |
| - num_cores = '0-3' |
354 |
| - if host_machine.system() == 'linux' |
355 |
| - num_cores = run_command('cat', |
356 |
| - '/sys/devices/system/cpu/present' |
357 |
| - ).stdout().strip() |
358 |
| - elif host_machine.system() == 'freebsd' |
359 |
| - snum_cores = run_command('/sbin/sysctl', '-n', |
360 |
| - 'hw.ncpu').stdout().strip() |
361 |
| - inum_cores = snum_cores.to_int() - 1 |
362 |
| - num_cores = '0-@0@'.format(inum_cores) |
363 |
| - endif |
| 350 | +# some perf tests (eg: memcpy perf autotest)take very long |
| 351 | +# to complete, so timeout to 10 minutes |
| 352 | +timeout_seconds = 600 |
| 353 | +timeout_seconds_fast = 10 |
364 | 354 |
|
365 |
| - num_cores_arg = '-l ' + num_cores |
| 355 | +# Retrieve the number of CPU cores, defaulting to 4. |
| 356 | +num_cores = '0-3' |
| 357 | +if host_machine.system() == 'linux' |
| 358 | + num_cores = run_command('cat', |
| 359 | + '/sys/devices/system/cpu/present' |
| 360 | + ).stdout().strip() |
| 361 | +elif host_machine.system() == 'freebsd' |
| 362 | + snum_cores = run_command('/sbin/sysctl', '-n', |
| 363 | + 'hw.ncpu').stdout().strip() |
| 364 | + inum_cores = snum_cores.to_int() - 1 |
| 365 | + num_cores = '0-@0@'.format(inum_cores) |
| 366 | +endif |
366 | 367 |
|
367 |
| - test_args = [num_cores_arg, '-n 4'] |
368 |
| - foreach arg : fast_parallel_test_names |
369 |
| - if host_machine.system() == 'linux' |
370 |
| - test(arg, dpdk_test, |
371 |
| - env : ['DPDK_TEST=' + arg], |
372 |
| - args : test_args + |
373 |
| - ['--file-prefix=@0@'.format(arg)], |
374 |
| - timeout : timeout_seconds_fast, |
375 |
| - suite : 'fast-tests') |
376 |
| - else |
377 |
| - test(arg, dpdk_test, |
378 |
| - env : ['DPDK_TEST=' + arg], |
379 |
| - args : test_args, |
380 |
| - timeout : timeout_seconds_fast, |
381 |
| - suite : 'fast-tests') |
382 |
| - endif |
383 |
| - endforeach |
| 368 | +num_cores_arg = '-l ' + num_cores |
384 | 369 |
|
385 |
| - foreach arg : fast_non_parallel_test_names |
| 370 | +test_args = [num_cores_arg, '-n 4'] |
| 371 | +foreach arg : fast_parallel_test_names |
| 372 | + if host_machine.system() == 'linux' |
| 373 | + test(arg, dpdk_test, |
| 374 | + env : ['DPDK_TEST=' + arg], |
| 375 | + args : test_args + |
| 376 | + ['--file-prefix=@0@'.format(arg)], |
| 377 | + timeout : timeout_seconds_fast, |
| 378 | + suite : 'fast-tests') |
| 379 | + else |
386 | 380 | test(arg, dpdk_test,
|
387 | 381 | env : ['DPDK_TEST=' + arg],
|
388 | 382 | args : test_args,
|
389 |
| - timeout : timeout_seconds_fast, |
390 |
| - is_parallel : false, |
391 |
| - suite : 'fast-tests') |
392 |
| - endforeach |
| 383 | + timeout : timeout_seconds_fast, |
| 384 | + suite : 'fast-tests') |
| 385 | + endif |
| 386 | +endforeach |
393 | 387 |
|
394 |
| - foreach arg : perf_test_names |
395 |
| - test(arg, dpdk_test, |
| 388 | +foreach arg : fast_non_parallel_test_names |
| 389 | + test(arg, dpdk_test, |
| 390 | + env : ['DPDK_TEST=' + arg], |
| 391 | + args : test_args, |
| 392 | + timeout : timeout_seconds_fast, |
| 393 | + is_parallel : false, |
| 394 | + suite : 'fast-tests') |
| 395 | +endforeach |
| 396 | + |
| 397 | +foreach arg : perf_test_names |
| 398 | + test(arg, dpdk_test, |
| 399 | + env : ['DPDK_TEST=' + arg], |
| 400 | + args : test_args, |
| 401 | + timeout : timeout_seconds, |
| 402 | + is_parallel : false, |
| 403 | + suite : 'perf-tests') |
| 404 | +endforeach |
| 405 | + |
| 406 | +foreach arg : driver_test_names |
| 407 | + test(arg, dpdk_test, |
396 | 408 | env : ['DPDK_TEST=' + arg],
|
397 | 409 | args : test_args,
|
398 | 410 | timeout : timeout_seconds,
|
399 | 411 | is_parallel : false,
|
400 |
| - suite : 'perf-tests') |
401 |
| - endforeach |
| 412 | + suite : 'driver-tests') |
| 413 | +endforeach |
402 | 414 |
|
403 |
| - foreach arg : driver_test_names |
404 |
| - test(arg, dpdk_test, |
405 |
| - env : ['DPDK_TEST=' + arg], |
406 |
| - args : test_args, |
407 |
| - timeout : timeout_seconds, |
408 |
| - is_parallel : false, |
409 |
| - suite : 'driver-tests') |
410 |
| - endforeach |
| 415 | +foreach arg : dump_test_names |
| 416 | + test(arg, dpdk_test, |
| 417 | + env : ['DPDK_TEST=' + arg], |
| 418 | + args : test_args, |
| 419 | + timeout : timeout_seconds, |
| 420 | + is_parallel : false, |
| 421 | + suite : 'debug-tests') |
| 422 | +endforeach |
411 | 423 |
|
412 |
| - foreach arg : dump_test_names |
413 |
| - test(arg, dpdk_test, |
414 |
| - env : ['DPDK_TEST=' + arg], |
415 |
| - args : test_args, |
416 |
| - timeout : timeout_seconds, |
417 |
| - is_parallel : false, |
418 |
| - suite : 'debug-tests') |
419 |
| - endforeach |
420 |
| -endif |
|
0 commit comments