[Reproducible-commits] [reprotest] 03/04: Rework tests to hopefully conform to Debian standards
Ceridwen
ceridwen-guest at moszumanska.debian.org
Fri Jun 17 22:25:58 UTC 2016
This is an automated email from the git hooks/post-receive script.
ceridwen-guest pushed a commit to branch master
in repository reprotest.
commit 234b31c6698724465f78561de25b3e68427f79e8
Author: Ceridwen <ceridwenv at gmail.com>
Date: Fri Jun 17 14:31:59 2016 -0400
Rework tests to hopefully conform to Debian standards
---
debian/tests/control | 2 +-
reprotest/__init__.py | 2 +-
tests/tests.py | 11 +++++++++--
tox.ini | 6 +++++-
4 files changed, 16 insertions(+), 5 deletions(-)
diff --git a/debian/tests/control b/debian/tests/control
index d7c3370..c000737 100644
--- a/debian/tests/control
+++ b/debian/tests/control
@@ -1,2 +1,2 @@
-Tests: reprotest
+Tests: tests.py
Tests-Directory: tests
diff --git a/reprotest/__init__.py b/reprotest/__init__.py
index eebbb62..e6acbe8 100644
--- a/reprotest/__init__.py
+++ b/reprotest/__init__.py
@@ -174,7 +174,7 @@ def check(build_command, artifact_name, source_root, variations=VARIATIONS):
open(os.path.normpath(temp + '/artifact2'), 'wb'),
env=env2, shell=True)
except Exception:
- traceback.print_exc()
+ # traceback.print_exc()
sys.exit(2)
sys.exit(subprocess.call(['diffoscope', temp + '/artifact1', temp + '/artifact2']))
diff --git a/tests/tests.py b/tests/tests.py
old mode 100644
new mode 100755
index 638b946..28bd310
--- a/tests/tests.py
+++ b/tests/tests.py
@@ -1,6 +1,7 @@
# Licensed under the GPL: https://www.gnu.org/licenses/gpl-3.0.en.html
# For details: reprotest/debian/copyright
+import argparse
import subprocess
import reprotest
@@ -12,6 +13,11 @@ def test_return_code(command, code):
assert(system_exit.args[0] == code)
if __name__ == '__main__':
+ arg_parser = argparse.ArgumentParser()
+ arg_parser.add_argument('--test-build', dest='test_build',
+ action='store_true',
+ help='Test setuptools and debuild.')
+ args = arg_parser.parse_args()
test_return_code(['python', 'mock_build.py'], 0)
test_return_code(['python', 'mock_failure.py'], 2)
test_return_code(['python', 'mock_build.py', 'irreproducible'], 1)
@@ -23,5 +29,6 @@ if __name__ == '__main__':
test_return_code(['python', 'mock_build.py', 'timezone'], 1)
test_return_code(['python', 'mock_build.py', 'umask'], 1)
- assert(subprocess.call(['reprotest', 'python setup.py bdist', 'dist/reprotest-0.1.linux-x86_64.tar.gz']) == 1)
- assert(subprocess.call(['reprotest', 'debuild -b -uc -us', '../reprotest_0.1_all.deb']) == 1)
+ if args.test_build:
+ assert(subprocess.call(['reprotest', 'python setup.py bdist', 'dist/reprotest-0.1.linux-x86_64.tar.gz']) == 1)
+ assert(subprocess.call(['reprotest', 'debuild -b -uc -us', '../reprotest_0.1_all.deb']) == 1)
diff --git a/tox.ini b/tox.ini
index 339f0fb..7269f37 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,5 +1,6 @@
[tox]
envlist = coverage-clean, py34, py35, coverage-stats
+# envlist = py34, py35
skip_missing_interpreters = true
[testenv:coverage-clean]
@@ -16,5 +17,8 @@ commands =
[testenv]
deps =
coverage
+ coverage_pth
diffoscope
-commands = coverage run --parallel tests/tests.py
+# pytest-cov
+# commands = py.test --cov-report html --cov=reprotest tests/tests.py
+commands = coverage run --parallel tests/tests.py --test-build
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/reprotest.git
More information about the Reproducible-commits
mailing list