You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Szczepan Zalega edited this page Mar 3, 2018
·
1 revision
Running Python's tests
# 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