From e372d610badaf9ca017a749765faa07312a92c55 Mon Sep 17 00:00:00 2001 From: Nikolaus Rath Date: Mon, 10 Apr 2017 17:08:58 -0700 Subject: [PATCH] Remove 'tests' target in favor of calling py.test directly. Together with the previous commit, this fixes #156. --- README.md | 8 ++++---- test/meson.build | 7 ------- test/wrong_command.c | 5 ++--- 3 files changed, 6 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index c1f0509..c7aec6a 100644 --- a/README.md +++ b/README.md @@ -46,17 +46,17 @@ command: To build, test and install libfuse, you then use Ninja: $ ninja - $ sudo ninja tests # requires pytest, see below + $ sudo python3 -m pytest test/ $ sudo ninja install Running the tests requires the [py.test](http://www.pytest.org/) Python module. Instead of running the tests as root, the majority of -tests can also be run as a regular user if *util/fusermount3* is -made setuid root first: +tests can also be run as a regular user if *util/fusermount3* is made +setuid root first: $ sudo chown root:root util/fusermount3 $ sudo chmod 4755 util/fusermount3 - $ ninja tests + $ python3 -m pytest test/ Alternate Installation diff --git a/test/meson.build b/test/meson.build index 44c0eb4..c5b940f 100644 --- a/test/meson.build +++ b/test/meson.build @@ -21,14 +21,7 @@ td += custom_target('test_scripts', input: test_scripts, command: ['cp', '-fPu', '--preserve=mode', '@INPUT@', meson.current_build_dir() ]) -# 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) - diff --git a/test/wrong_command.c b/test/wrong_command.c index ef835b3..8366a98 100644 --- a/test/wrong_command.c +++ b/test/wrong_command.c @@ -3,8 +3,7 @@ int main(void) { fprintf(stderr, "\x1B[31m\e[1m" "This is not the command you are looking for.\n" - "You probably want to run 'ninja tests' instead " - "(note the 's' at the end).\n" - "\e[0m"); + "You probably want to run 'python3 -m pytest test/' instead" + "\e[0m\n"); return 1; } -- 2.30.2