bug 1256614 - replace mozglue/linker/tests/Makefile.in with a PYTHON_UNIT_TEST. r?glandium draft
authorTed Mielczarek <ted@mielczarek.org>
Tue, 15 Mar 2016 09:02:36 -0400
changeset 340498 20191092ac7db667fbf2010bbd9adfb0744c2e04
parent 340497 a03f77804981532999e4d3d41795d8bc65797059
child 516198 a8f21203a5ef26ba2b4a9a7b7da9fc32a37aeb97
push id12980
push usertmielczarek@mozilla.com
push dateTue, 15 Mar 2016 13:03:24 +0000
reviewersglandium
bugs1256614
milestone48.0a1
bug 1256614 - replace mozglue/linker/tests/Makefile.in with a PYTHON_UNIT_TEST. r?glandium MozReview-Commit-ID: 4qCDAKEY8b5
mozglue/linker/tests/Makefile.in
mozglue/linker/tests/moz.build
mozglue/linker/tests/run_test_zip.py
deleted file mode 100644
--- a/mozglue/linker/tests/Makefile.in
+++ /dev/null
@@ -1,10 +0,0 @@
-# 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/.
-
-include $(topsrcdir)/config/rules.mk
-
-ifdef MOZ_LINKER
-check::
-	@$(EXIT_ON_ERROR) ./TestZip$(BIN_SUFFIX) $(srcdir)
-endif
--- a/mozglue/linker/tests/moz.build
+++ b/mozglue/linker/tests/moz.build
@@ -11,9 +11,10 @@ SimplePrograms([
 ])
 LOCAL_INCLUDES += ['..']
 USE_LIBS += [
     'linker',
 ]
 DISABLE_STL_WRAPPING = True
 
 if CONFIG['MOZ_LINKER']:
+    PYTHON_UNIT_TESTS += ['run_test_zip.py']
     OS_LIBS += CONFIG['MOZ_ZLIB_LIBS']
new file mode 100644
--- /dev/null
+++ b/mozglue/linker/tests/run_test_zip.py
@@ -0,0 +1,21 @@
+#!/usr/bin/env python
+#
+# Any copyright is dedicated to the Public Domain.
+# http://creativecommons.org/publicdomain/zero/1.0/
+
+import buildconfig
+import mozpack.path as mozpath
+import mozunit
+import subprocess
+import unittest
+
+class TestZip(unittest.TestCase):
+    def test_zip(self):
+        srcdir = mozpath.dirname(__file__)
+        relsrcdir = mozpath.relpath(srcdir, buildconfig.topsrcdir)
+        test_bin = mozpath.join(buildconfig.topobjdir, relsrcdir,
+                                'TestZip' + buildconfig.substs['BIN_SUFFIX'])
+        self.assertEqual(0, subprocess.call([test_bin, srcdir]))
+
+if __name__ == '__main__':
+    mozunit.main()