summaryrefslogtreecommitdiffstats
path: root/tests/meson.build
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2022-07-14 18:27:59 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2022-07-16 15:11:56 +0000
commit6197903bd42478987516bc4cc3f0769488a37065 (patch)
tree508d399340039960289dd1d96696db7c56c22321 /tests/meson.build
parentAdding upstream version 1.16. (diff)
downloadnvme-cli-6197903bd42478987516bc4cc3f0769488a37065.tar.xz
nvme-cli-6197903bd42478987516bc4cc3f0769488a37065.zip
Adding 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