summaryrefslogtreecommitdiffstats
path: root/tests/meson.build
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2022-07-14 18:28:04 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2022-07-16 15:12:07 +0000
commit589986012c4b3ab68e299a2eadca18f90080113b (patch)
treef29a53b04a1950cdddae69344bccb3f0146fa728 /tests/meson.build
parentReleasing debian version 1.16-4. (diff)
downloadnvme-cli-589986012c4b3ab68e299a2eadca18f90080113b.tar.xz
nvme-cli-589986012c4b3ab68e299a2eadca18f90080113b.zip
Merging upstream version 2.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/meson.build')
-rw-r--r--tests/meson.build79
1 files changed, 79 insertions, 0 deletions
diff --git a/tests/meson.build b/tests/meson.build
new file mode 100644
index 0000000..feecb3d
--- /dev/null
+++ b/tests/meson.build
@@ -0,0 +1,79 @@
+tests = [
+ 'nvme_attach_detach_ns_test',
+ 'nvme_compare_test',
+ 'nvme_create_max_ns_test',
+ 'nvme_error_log_test',
+ 'nvme_flush_test',
+ 'nvme_format_test',
+ 'nvme_fw_log_test',
+ 'nvme_get_features_test',
+ 'nvme_id_ctrl_test',
+ 'nvme_id_ns_test',
+ 'nvme_read_write_test',
+ 'nvme_simple_template_test',
+ 'nvme_smart_log_test',
+ 'nvme_test_io',
+ 'nvme_test_logger',
+ 'nvme_test',
+ 'nvme_writeuncor_test',
+ 'nvme_writezeros_test',
+ 'nvme_copy_test',
+ 'nvme_dsm_test',
+ 'nvme_verify_test',
+ 'nvme_lba_status_log_test',
+ 'nvme_get_lba_status_test',
+]
+
+runtests = find_program('nose2', required : false)
+
+if runtests.found()
+ foreach t : tests
+ test(t, runtests,
+ args: ['--verbose', '--start-dir', meson.current_source_dir(), t],
+ workdir: meson.current_source_dir(),
+ env: ['PATH=' + meson.build_root() + ':/usr/bin:/usr/sbin'],
+ timeout: 500)
+ endforeach
+endif
+
+python_module = import('python')
+
+python = python_module.find_installation('python3')
+
+mypy = find_program(
+ 'mypy',
+ required : false,
+)
+flake8 = find_program(
+ 'flake8',
+ required : false,
+)
+linter_script = files('run_py_linters.py')
+
+if mypy.found() and flake8.found()
+ run_target(
+ 'lint-python',
+ command : [python, linter_script, 'lint'],
+ )
+else
+ message('Mypy or Flake8 not found. Python linting disabled')
+endif
+
+
+autopep8 = find_program(
+ 'autopep8',
+ required : false,
+)
+isort = find_program(
+ 'isort',
+ required : false,
+)
+
+if autopep8.found() and isort.found()
+ run_target(
+ 'format-python',
+ command : [python, linter_script, 'format'],
+ )
+else
+ message('autopep8 or isort not found. Python formating disabled')
+endif