[diffoscope] 01/01: Move DOS/MBR check into the testsuite.

Chris Lamb chris at chris-lamb.co.uk
Sat Mar 3 22:49:09 CET 2018


This is an automated email from the git hooks/post-receive script.

lamby pushed a commit to branch master
in repository diffoscope.

commit e41abe00d170462081abdf9855aa181512f791da
Author: Chris Lamb <lamby at debian.org>
Date:   Sat Mar 3 21:48:47 2018 +0000

    Move DOS/MBR check into the testsuite.
---
 debian/rules         |  3 ---
 tests/test_source.py | 30 ++++++++++++++++++++++++++++++
 2 files changed, 30 insertions(+), 3 deletions(-)

diff --git a/debian/rules b/debian/rules
index dc1482d..f1e4f0a 100755
--- a/debian/rules
+++ b/debian/rules
@@ -41,9 +41,6 @@ debian/diffoscope.bash-completion:
 	register-python-argcomplete diffoscope > $@
 
 override_dh_auto_build: debian/diffoscope.bash-completion
-	@# Let's avoid plonking everything in the "DOS/MBR" category, this is really not
-	@# a sustainable filetype testing solution (e.g. c051ba9d and c1442405).
-	! grep 'DOS/MBR' -R diffoscope
 	dh_auto_build -O--buildsystem=pybuild
 	dh_auto_build -O--buildsystem=makefile -Ddoc
 
diff --git a/tests/test_source.py b/tests/test_source.py
new file mode 100644
index 0000000..998e850
--- /dev/null
+++ b/tests/test_source.py
@@ -0,0 +1,30 @@
+# -*- coding: utf-8 -*-
+#
+# diffoscope: in-depth comparison of files, archives, and directories
+#
+# Copyright © 2018 Chris Lamb <lamby at debian.org>
+#
+# diffoscope is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# diffoscope is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with diffoscope.  If not, see <https://www.gnu.org/licenses/>.
+
+import os
+import glob
+import pytest
+import diffoscope
+
+BASE_DIR = os.path.dirname(os.path.abspath(diffoscope.__file__))
+
+
+def test_dos_mbr():
+    for x in glob.iglob(os.path.join(BASE_DIR, '**', '*.py'), recursive=True):
+        assert 'DOS/MBR' not in open(x).read()

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/diffoscope.git


More information about the diffoscope mailing list