diff options
author | Simon Glass <sjg@chromium.org> | 2021-12-18 08:09:45 -0700 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2022-01-24 17:36:29 -0500 |
commit | 84067a5890f186a925dcf89f8402abaf12f09b45 (patch) | |
tree | 28e176a5fc93caccc9497ce015673c58c73a6669 /tools/moveconfig.py | |
parent | e1ae563294eb97f857113fdccb9122fdf77fffd0 (diff) |
moveconfig: Allow adding unit tests
Add a -t option to run unit tests in this program. So far, there is none.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/moveconfig.py')
-rwxr-xr-x | tools/moveconfig.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tools/moveconfig.py b/tools/moveconfig.py index 369589727c..71a7736ca6 100755 --- a/tools/moveconfig.py +++ b/tools/moveconfig.py @@ -14,6 +14,7 @@ import asteval import collections import copy import difflib +import doctest import filecmp import fnmatch import glob @@ -28,6 +29,7 @@ import sys import tempfile import threading import time +import unittest from buildman import bsettings from buildman import kconfiglib @@ -1621,6 +1623,13 @@ def main(): (options, configs) = parser.parse_args() + if options.test: + sys.argv = [sys.argv[0]] + fail, count = doctest.testmod() + if fail: + return 1 + unittest.main() + if len(configs) == 0 and not any((options.force_sync, options.build_db, options.imply)): parser.print_usage() |