2013-08-08 16:52:19 +00:00
|
|
|
#!/usr/bin/env python
|
|
|
|
|
|
2017-11-30 18:26:44 +00:00
|
|
|
# Copyright 2013 - 2017, New York University and the TUF contributors
|
|
|
|
|
# SPDX-License-Identifier: MIT OR Apache-2.0
|
|
|
|
|
|
2013-03-05 04:11:34 +00:00
|
|
|
"""
|
|
|
|
|
<Program Name>
|
|
|
|
|
aggregate_tests.py
|
|
|
|
|
|
|
|
|
|
<Author>
|
2014-04-20 20:19:56 +00:00
|
|
|
Konstantin Andrianov.
|
|
|
|
|
Zane Fisher.
|
2013-03-05 04:11:34 +00:00
|
|
|
|
|
|
|
|
<Started>
|
2014-04-20 20:19:56 +00:00
|
|
|
January 26, 2013.
|
2013-08-06 17:42:44 +00:00
|
|
|
|
2013-08-30 18:58:41 +00:00
|
|
|
August 2013.
|
|
|
|
|
Modified previous behavior that explicitly imported individual
|
2013-08-06 17:42:44 +00:00
|
|
|
unit tests. -Zane Fisher
|
2017-01-12 20:20:03 +00:00
|
|
|
|
2013-03-05 04:11:34 +00:00
|
|
|
<Copyright>
|
2018-02-05 16:31:19 +00:00
|
|
|
See LICENSE-MIT OR LICENSE for licensing information.
|
2013-03-05 04:11:34 +00:00
|
|
|
|
|
|
|
|
<Purpose>
|
2013-08-30 18:58:41 +00:00
|
|
|
Run all the unit tests from every .py file beginning with "test_" in
|
|
|
|
|
'tuf/tests'. Use --random to run the tests in random order.
|
2013-03-05 04:11:34 +00:00
|
|
|
"""
|
|
|
|
|
|
2013-08-26 19:35:28 +00:00
|
|
|
import sys
|
2013-07-31 23:01:19 +00:00
|
|
|
import unittest
|
2013-08-13 22:41:38 +00:00
|
|
|
|
2021-12-06 14:24:31 +00:00
|
|
|
if __name__ == "__main__":
|
|
|
|
|
suite = unittest.TestLoader().discover(".")
|
|
|
|
|
all_tests_passed = (
|
|
|
|
|
unittest.TextTestRunner(verbosity=1, buffer=True)
|
|
|
|
|
.run(suite)
|
|
|
|
|
.wasSuccessful()
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
if not all_tests_passed:
|
|
|
|
|
sys.exit(1)
|
|
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
sys.exit(0)
|