Skip to content

Commit f64677a

Browse files
committed
Add the ability to run tests directly
This will be useful to implement a self-test system that executes a particular set of tests on the target device. https://phabricator.endlessm.com/T34155
1 parent 5c767e8 commit f64677a

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import unittest
2+
from pathlib import Path
3+
4+
5+
def main():
6+
this_dir = Path(__file__).parent
7+
8+
selftest_loader = unittest.TestLoader()
9+
selftests = selftest_loader.discover(this_dir)
10+
11+
selftest_runner = unittest.runner.TextTestRunner()
12+
selftest_runner.run(selftests)
13+
14+
selftest_suite = unittest.TestSuite()
15+
16+
17+
if __name__ == "__main__":
18+
main()

0 commit comments

Comments
 (0)