Permalink
Browse files

Bug 818646 - Add mozbuild Python tests to |make check|; r=ted

  • Loading branch information...
1 parent 8954e49 commit 1bcb0e2a1d7686ca4c58c6e2462aaaac4b4e4af3 @indygreg indygreg committed Dec 21, 2012
View
@@ -31,6 +31,7 @@ tier_base_dirs = \
build \
probes \
mfbt \
+ python \
$(NULL)
ifndef LIBXUL_SDK
View
@@ -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
View
@@ -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 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 @@ def test_msvc_parsing(self):
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 @@ def test_pruning(self):
db.prune()
self.assertEqual(len(db), 19)
+
+if __name__ == '__main__':
+ main()
@@ -9,6 +9,8 @@
from mozfile.mozfile import NamedTemporaryFile
+from mozunit import main
+
from mach.logging import LoggingManager
from mozbuild.base import (
@@ -17,6 +19,7 @@
)
+
curdir = os.path.dirname(__file__)
topsrcdir = os.path.normpath(os.path.join(curdir, '..', '..', '..', '..'))
log_manager = LoggingManager()
@@ -47,3 +50,6 @@ def test_config_guess(self):
self.assertIsNotNone(result)
self.assertGreater(len(result), 0)
+
+if __name__ == '__main__':
+ main()
@@ -16,6 +16,8 @@
from mozfile.mozfile import NamedTemporaryFile
+from mozunit import main
+
from mozbuild.mozconfig import (
MozconfigFindException,
MozconfigLoadException,
@@ -315,3 +317,6 @@ def test_read_load_exception(self):
mozconfig.name.replace(os.sep, '/'))
self.assertEquals(e.exception.output, ['hello world'])
+
+if __name__ == '__main__':
+ main()
@@ -8,6 +8,7 @@
import unittest
from mozfile.mozfile import NamedTemporaryFile
+from mozunit import main
from mozbuild.util import hash_file
@@ -42,3 +43,6 @@ def test_hash_file_large(self):
self.assertEqual(actual, expected)
+
+if __name__ == '__main__':
+ main()

0 comments on commit 1bcb0e2

Please sign in to comment.