mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-20 22:21:41 +00:00
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>
This commit is contained in:
parent
e1ae563294
commit
84067a5890
1 changed files with 9 additions and 0 deletions
|
@ -14,6 +14,7 @@ import asteval
|
||||||
import collections
|
import collections
|
||||||
import copy
|
import copy
|
||||||
import difflib
|
import difflib
|
||||||
|
import doctest
|
||||||
import filecmp
|
import filecmp
|
||||||
import fnmatch
|
import fnmatch
|
||||||
import glob
|
import glob
|
||||||
|
@ -28,6 +29,7 @@ import sys
|
||||||
import tempfile
|
import tempfile
|
||||||
import threading
|
import threading
|
||||||
import time
|
import time
|
||||||
|
import unittest
|
||||||
|
|
||||||
from buildman import bsettings
|
from buildman import bsettings
|
||||||
from buildman import kconfiglib
|
from buildman import kconfiglib
|
||||||
|
@ -1621,6 +1623,13 @@ def main():
|
||||||
|
|
||||||
(options, configs) = parser.parse_args()
|
(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,
|
if len(configs) == 0 and not any((options.force_sync, options.build_db,
|
||||||
options.imply)):
|
options.imply)):
|
||||||
parser.print_usage()
|
parser.print_usage()
|
||||||
|
|
Loading…
Add table
Reference in a new issue