aboutsummaryrefslogtreecommitdiff
path: root/test/meson.build
diff options
context:
space:
mode:
authorGravatar Nikolaus Rath <Nikolaus@rath.org>2017-01-05 09:37:00 -0800
committerGravatar Nikolaus Rath <Nikolaus@rath.org>2017-01-12 15:19:04 -0800
commit9f96db71252fc66b72c433e2ca0d49e031c6a5fd (patch)
tree494132dae14dba3de18a9013f2299cfc37cceda5 /test/meson.build
parent3006686b536942f6f96675e3d12b793087e78e6a (diff)
Added experimental support for building with Meson+Ninja
Diffstat (limited to 'test/meson.build')
-rw-r--r--test/meson.build35
1 files changed, 35 insertions, 0 deletions
diff --git a/test/meson.build b/test/meson.build
new file mode 100644
index 0000000..971c64a
--- /dev/null
+++ b/test/meson.build
@@ -0,0 +1,35 @@
+# Attention, emacs, please use -*- mode: python -*-
+# (even though this isn't actually Python code)
+
+# Compile helper programs
+td = []
+foreach prog: [ 'test_write_cache', 'test_setattr' ]
+ td += executable(prog, prog + '.c',
+ include_directories: include_dirs,
+ link_with: [ libfuse ],
+ dependencies: thread_dep,
+ install: false)
+endforeach
+td += executable('test_syscalls', 'test_syscalls.c',
+ include_directories: include_dirs,
+ install: false)
+
+# Actual tests are written in Python and can simply be copied.
+foreach fname : [ 'conftest.py', 'pytest.ini', 'test_examples.py',
+ 'util.py' ]
+ td += custom_target(fname, input: fname, output: fname,
+ command: ['cp', '-fP', '--preserve=mode',
+ '@INPUT@', '@OUTPUT@'])
+endforeach
+
+# Create a new 'tests' target that we can run with Ninja
+run_target('tests', depends: td,
+ command: [ 'python3', '-m', 'pytest',
+ meson.current_build_dir() ])
+
+
+# Provide something helpful when running 'ninja test'
+wrong_cmd = executable('wrong_command', 'wrong_command.c',
+ install: false)
+test('wrong_cmd', wrong_cmd)
+