-
Notifications
You must be signed in to change notification settings - Fork 34
Running Python's tests
Szczepan Zalega edited this page Mar 3, 2018
·
1 revision
# clone
git clone https://github.com/Nitrokey/libnitrokey.git --recursive
# or update, if cloned already; need to be run in repo's root directory
git checkout master
git pull
git submodule update --init --recursive
# build
cd build
cmake ..
# use ccmake instead of cmake if there is a need for parametrized build
make -j4
cd ..
# running test
cd unittest
# one time Python's depends installation
pip3 install -r requirements.txt --user
# test run (py.test or pytest)
py.test -v test_pro.py #for pro functions
py.test -v test_storage.py #for storage functions
# pytest switches:
# -s shows output from libnitrokey's log (otherwise it is shown on error
only)
# -x - stops on first failure
# -k expr - run's tests with name containing <expr>
# -m run/do - not run tests with tag xyz
# --count 10 - run filtered test suite 10 times
# Examples:
Run all tests except aes, factory_reset and locking device
py.test -m "not aes and not factory_reset and not lock_device" -v test_pro.py test_storage.py
# Run each test containing string 'OTP' 100 times
$ py.test --count 100 -k OTP