зеркало из https://github.com/mozilla/gecko-dev.git
Bug 818646 - Add mozbuild Python tests to |make check|; r=ted
This commit is contained in:
Родитель
1ea7cbf0a3
Коммит
28aed6452e
|
@ -31,6 +31,7 @@ tier_base_dirs = \
|
|||
build \
|
||||
probes \
|
||||
mfbt \
|
||||
python \
|
||||
$(NULL)
|
||||
|
||||
ifndef LIBXUL_SDK
|
||||
|
|
|
@ -38,6 +38,7 @@ config/doxygen.cfg
|
|||
config/expandlibs_config.py
|
||||
mfbt/Makefile
|
||||
probes/Makefile
|
||||
python/Makefile
|
||||
extensions/Makefile
|
||||
"
|
||||
|
||||
|
|
|
@ -12,6 +12,7 @@ mozprofile.pth:testing/mozbase/mozprofile
|
|||
mozrunner.pth:testing/mozbase/mozrunner
|
||||
marionette.pth:testing/marionette/client
|
||||
blessings.pth:python/blessings
|
||||
mach.pth:python/mach
|
||||
mozbuild.pth:python/mozbuild
|
||||
pymake.pth:build/pymake
|
||||
optional:setup.py:python/psutil:build_ext:--inplace
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
DEPTH := @DEPTH@
|
||||
topsrcdir := @top_srcdir@
|
||||
srcdir := @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
test_dirs := \
|
||||
mozbuild/mozbuild/test \
|
||||
mozbuild/mozbuild/test/compilation \
|
||||
$(NULL)
|
||||
|
||||
PYTHON_UNIT_TESTS := $(foreach dir,$(test_dirs),$(wildcard $(srcdir)/$(dir)/*.py))
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
|
|
@ -11,6 +11,7 @@ from mozbuild.compilation.warnings import CompilerWarning
|
|||
from mozbuild.compilation.warnings import WarningsCollector
|
||||
from mozbuild.compilation.warnings import WarningsDatabase
|
||||
|
||||
from mozunit import main
|
||||
|
||||
CLANG_TESTS = [
|
||||
('foobar.cpp:123:10: warning: you messed up [-Wfoo]',
|
||||
|
@ -138,7 +139,7 @@ class TestWarningsParsing(unittest.TestCase):
|
|||
|
||||
self.assertIsNotNone(warning)
|
||||
|
||||
self.assertEqual(warning['filename'], filename)
|
||||
self.assertEqual(warning['filename'], os.path.normpath(filename))
|
||||
self.assertEqual(warning['line'], line)
|
||||
self.assertEqual(warning['flag'], flag)
|
||||
self.assertEqual(warning['message'], message)
|
||||
|
@ -231,3 +232,6 @@ class TestWarningsDatabase(unittest.TestCase):
|
|||
db.prune()
|
||||
self.assertEqual(len(db), 19)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
|
|
@ -9,6 +9,8 @@ import unittest
|
|||
|
||||
from mozfile.mozfile import NamedTemporaryFile
|
||||
|
||||
from mozunit import main
|
||||
|
||||
from mach.logging import LoggingManager
|
||||
|
||||
from mozbuild.base import (
|
||||
|
@ -17,6 +19,7 @@ from mozbuild.base import (
|
|||
)
|
||||
|
||||
|
||||
|
||||
curdir = os.path.dirname(__file__)
|
||||
topsrcdir = os.path.normpath(os.path.join(curdir, '..', '..', '..', '..'))
|
||||
log_manager = LoggingManager()
|
||||
|
@ -47,3 +50,6 @@ class TestMozbuildObject(unittest.TestCase):
|
|||
self.assertIsNotNone(result)
|
||||
self.assertGreater(len(result), 0)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
|
|
@ -16,6 +16,8 @@ from tempfile import (
|
|||
|
||||
from mozfile.mozfile import NamedTemporaryFile
|
||||
|
||||
from mozunit import main
|
||||
|
||||
from mozbuild.mozconfig import (
|
||||
MozconfigFindException,
|
||||
MozconfigLoadException,
|
||||
|
@ -315,3 +317,6 @@ class TestMozconfigLoader(unittest.TestCase):
|
|||
mozconfig.name.replace(os.sep, '/'))
|
||||
self.assertEquals(e.exception.output, ['hello world'])
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
|
|
@ -8,6 +8,7 @@ import hashlib
|
|||
import unittest
|
||||
|
||||
from mozfile.mozfile import NamedTemporaryFile
|
||||
from mozunit import main
|
||||
|
||||
from mozbuild.util import hash_file
|
||||
|
||||
|
@ -42,3 +43,6 @@ class TestHashing(unittest.TestCase):
|
|||
|
||||
self.assertEqual(actual, expected)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
|
Загрузка…
Ссылка в новой задаче