Skip to content

Commit a5efa4e

Browse files
author
Daniel Zagaynov
committed
Add tests/run_tests.sh for test running
1 parent 81d7814 commit a5efa4e

2 files changed

Lines changed: 15 additions & 2 deletions

File tree

meson.build

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,19 @@ install: true,
1010
subdir: 'pyxcrypt'
1111
)
1212

13-
install_data(
13+
py.install_sources(
1414
'src/pyxcrypt/__init__.py',
15-
install_dir: py.get_install_dir() / 'pyxcrypt'
15+
subdir: 'pyxcrypt'
1616
)
1717

1818
install_data(
1919
'README.md',
2020
install_dir: py.get_install_dir() / 'pyxcrypt'
2121
)
22+
23+
python_paths = [join_paths(meson.current_build_dir(), '../src/')]
24+
run_tests = find_program('tests/run_tests.sh')
25+
test('unit-tests',
26+
run_tests,
27+
args: ['../tests'],
28+
)

tests/run_tests.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/sh
2+
3+
mkdir -p /tmp/test_env
4+
meson compile
5+
DESTDIR=/tmp/test_env meson install
6+
PYTHONPATH=/tmp/test_env/usr/local/lib/python3/site-packages:/tmp/test_env/usr/local/lib64/python3/site-packages python3 -P -m unittest discover -s "$1" -v

0 commit comments

Comments
 (0)