diff --git a/README.md b/README.md index 09c0196a..1d30fc1d 100644 --- a/README.md +++ b/README.md @@ -34,8 +34,8 @@ _The checking of items on this list is still being developed. Checked items shou * [x] API functions do not write outside provided buffers * [x] Compiles with `-Wall -Wextra -Wpedantic -Werror` with `gcc` and `clang` * [x] Consistent test vectors across runs -* [ ] Consistent test vectors on big-endian and little-endian machines -* [ ] Consistent test vectors on 32-bit and 64-bit machines +* [x] Consistent test vectors on big-endian and little-endian machines +* [x] Consistent test vectors on 32-bit and 64-bit machines * [x] No errors/warnings reported by valgrind * [x] No errors/warnings reported by address sanitizer * [ ] Only dependencies: @@ -131,3 +131,19 @@ Regarding #2, adding the files to your project's build system, each implementati Each subdirectory containing implementations contains a LICENSE file stating under what license that specific implementation is released. All other code for testing etc. in this repository is released under the conditions of [CC0](http://creativecommons.org/publicdomain/zero/1.0/). + +## Running tests locally + +While we run extensive automatic testing on [Travis CI][travis-pqc] and [Appveyor][appveyor-pqc], most tests can also be run locally. +To do this, make sure the following is installed: + +* Python 3.5+ +* `nosetests` or `nose2` (either for Python 3) + +Run the Python-based tests by going into the `test` directory and running `nosetests -v` or `nose2 -B -v`, depending on what you installed. +If you have the `rednose` plugin for `nosetests` installed, run `nosetests --rednose` to get colored output. + +You may also run `python ` where `` is any of the files starting with `test_` in the `test/` folder. + +[travis-pqc]: https://travis-ci.com/PQClean/PQClean/ +[appveyor-pqc]: https://ci.appveyor.com/project/PQClean/pqclean diff --git a/test/test_compile_lib.py b/test/test_compile_lib.py index 98ea8596..a83847c8 100644 --- a/test/test_compile_lib.py +++ b/test/test_compile_lib.py @@ -24,3 +24,12 @@ def check_compile_lib(scheme_name, implementation_name): ['make'], implementation.path() ) + + +if __name__ == '__main__': + try: + import nose2 + nose2.main() + except ImportError: + import nose + nose.runmodule() diff --git a/test/test_functest.py b/test/test_functest.py index b26651ff..c4d0fbbe 100644 --- a/test/test_functest.py +++ b/test/test_functest.py @@ -28,3 +28,12 @@ def check_functest(scheme_name, implementation_name): ['./functest_{}_{}'.format(scheme_name, implementation_name)], os.path.join('..', 'bin'), ) + + +if __name__ == '__main__': + try: + import nose2 + nose2.main() + except ImportError: + import nose + nose.runmodule() diff --git a/test/test_license.py b/test/test_license.py index e6c6069a..f438f2f1 100644 --- a/test/test_license.py +++ b/test/test_license.py @@ -19,3 +19,12 @@ def check_license(scheme_name, implementation_name): p1 = os.path.join(implementation.path(), 'LICENSE') p2 = os.path.join(implementation.path(), 'LICENSE.txt') assert(os.path.isfile(p1) or os.path.isfile(p2)) + + +if __name__ == '__main__': + try: + import nose2 + nose2.main() + except ImportError: + import nose + nose.runmodule() diff --git a/test/test_metadata.py b/test/test_metadata.py index 308e2af8..2327466e 100644 --- a/test/test_metadata.py +++ b/test/test_metadata.py @@ -123,3 +123,12 @@ def check_element(field, element, props): if type_ == dict: check_spec(element, props['spec'].items()) + + +if __name__ == '__main__': + try: + import nose2 + nose2.main() + except ImportError: + import nose + nose.runmodule() diff --git a/test/test_symbol_namespace.py b/test/test_symbol_namespace.py index 1e83231f..44a3e69f 100644 --- a/test/test_symbol_namespace.py +++ b/test/test_symbol_namespace.py @@ -49,3 +49,12 @@ def check_symbol_namespace(scheme_name, implementation_name): for symbol in non_namespaced: print("\ttype: {}, symbol: {}".format(symtype, symbol)) assert(False) + + +if __name__ == '__main__': + try: + import nose2 + nose2.main() + except ImportError: + import nose + nose.runmodule()