mirror of
https://github.com/triqs/dft_tools
synced 2024-12-23 12:55:17 +01:00
11d394fd5b
* moved the plovasp C++ code to c++/triqs_dft_tools/converters/vasp * added global header triqs_dft_tools/triqs_dft_tools.hpp * python dir based on single cmakelist file * registered C++ tests for plovasp * corrected imports for py3 tests for plovasp * corrected block order in sigma_from_file and srvo3_Gloc * exchanged ref files for sigma_from_file, srvo3_Gloc, SrVO3.ref.h5 * moved vasp converter bash scripts from dir shells to bin dir
35 lines
1.1 KiB
Python
Executable File
35 lines
1.1 KiB
Python
Executable File
r"""
|
|
Searches and runs all available test suites.
|
|
"""
|
|
import unittest
|
|
import sys
|
|
|
|
if __name__ == '__main__':
|
|
if len(sys.argv) == 1:
|
|
suite = unittest.TestLoader().discover('./')
|
|
else:
|
|
suite = unittest.TestLoader().discover(sys.argv[1] + '/')
|
|
|
|
# def list_tests(suite):
|
|
# for test in suite:
|
|
# if isinstance(test, unittest.TestSuite):
|
|
# list_tests(test)
|
|
# elif isinstance(test, unittest.TestCase):
|
|
## print test.__class__.__bases__
|
|
# tmp = test.__str__().split()
|
|
# test_method, test_class = tmp[0], tmp[1]
|
|
# test_class = test_class.strip('()')
|
|
# print test_class + '.' + test_method
|
|
|
|
# list_tests(suite)
|
|
results = unittest.TextTestRunner(verbosity=2, buffer=True).run(suite)
|
|
# unittest.TextTestRunner(verbosity=2, buffer=False).run(suite)
|
|
if results.wasSuccessful():
|
|
raise SystemExit(0)
|
|
else:
|
|
print("Failed tests:")
|
|
for failure in results.failures:
|
|
print(failure[0].__str__())
|
|
raise SystemExit(1)
|
|
|