3
0
mirror of https://github.com/triqs/dft_tools synced 2024-11-18 20:12:53 +01:00
dft_tools/test/python/plovasp/run_suite.py
Alexander Hampel 11d394fd5b synchronize dfttools with app4triqs structure
* 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
2020-06-10 17:45:53 +02:00

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)