From 3b36049c75a0c67be830a6683cf57f17d0e348c2 Mon Sep 17 00:00:00 2001 From: Manuel Traut Date: Tue, 19 Sep 2017 09:47:12 +0200 Subject: rename into pyjutest Signed-off-by: Manuel Traut --- .gitignore | 6 +++--- debian/changelog | 2 +- debian/control | 6 +++--- debian/copyright | 34 ---------------------------------- pjutest | 35 ----------------------------------- pyjutest | 35 +++++++++++++++++++++++++++++++++++ setup.py | 4 ++-- 7 files changed, 44 insertions(+), 78 deletions(-) delete mode 100644 debian/copyright delete mode 100755 pjutest create mode 100755 pyjutest diff --git a/.gitignore b/.gitignore index 22afc5d..39ebabb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,7 @@ build .pybuild debian/files -debian/pjutest -debian/pjutest.debhelper.log -debian/pjutest.substvars +debian/pyjutest +debian/pyjutest.debhelper.log +debian/pyjutest.substvars debian/.debhelper diff --git a/debian/changelog b/debian/changelog index 0b43ee5..19088ab 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -pjutest (1.0) unstable; urgency=medium +pyjutest (1.0) unstable; urgency=medium * Initial Release. diff --git a/debian/control b/debian/control index 4213b0c..f388a2e 100644 --- a/debian/control +++ b/debian/control @@ -1,13 +1,13 @@ -Source: pjutest +Source: pyjutest Section: text Priority: optional Maintainer: Manuel Traut Build-Depends: debhelper (>= 9), python3 Standards-Version: 3.9.8 -Package: pjutest +Package: pyjutest Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, python3-junit.xml Description: commandline unit-test wrapper - use it with 'pjutest anycmd' it will capture stdout, stderr of anycmd and + use it with 'pyjutest anycmd' it will capture stdout, stderr of anycmd and log it into a junit xml file. multiple calls append to an existing xml. diff --git a/debian/copyright b/debian/copyright deleted file mode 100644 index b5e54d7..0000000 --- a/debian/copyright +++ /dev/null @@ -1,34 +0,0 @@ -Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ -Upstream-Name: pjutest -Source: - -Files: * -Copyright: - -License: GPL-3.0+ - -Files: debian/* -Copyright: 2017 Manuel Traut -License: GPL-3.0+ - -License: GPL-3.0+ - This program 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. - . - This package 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 this program. If not, see . - . - On Debian systems, the complete text of the GNU General - Public License version 3 can be found in "/usr/share/common-licenses/GPL-3". - -# Please also look if there are files or directories which have a -# different copyright/license attached and list them here. -# Please avoid picking licenses with terms that are more restrictive than the -# packaged work, as it may make Debian's contributions unacceptable upstream. diff --git a/pjutest b/pjutest deleted file mode 100755 index 8edc4f2..0000000 --- a/pjutest +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/bin/env python3 -# -# pjutest - junit xml generator - -from junit_xml import TestSuite, TestCase -from pickle import dump, load -from subprocess import Popen, PIPE, STDOUT - -import os -import sys - -if len (sys.argv) != 2: - print("%s 'mycmd param1' # to record a test" % sys.argv[0]) - sys.exit(-1) - -if os.path.exists('pjutest.dat'): - with open('pjutest.dat', 'r') as dat: - tss = load(dat) -else: - tss = [TestSuite("suite", None)] - -p = Popen(sys.argv[1], shell=True, stdout=PIPE, stderr=PIPE) -out,err = p.communicate() - -tc = TestCase(sys.argv[1], 'sh', 2, out[:-1], err[:-1]) -if p.returncode: - tc.add_failure_info(err, "return: %d" % p.returncode) - -tss[0].test_cases.append(tc) - -with open('pjutest.dat', 'w') as dat: - dump(tss, dat) - -with open('pjutest.xml', 'w') as xml: - TestSuite.to_file(xml, tss, prettyprint=True) diff --git a/pyjutest b/pyjutest new file mode 100755 index 0000000..49c71de --- /dev/null +++ b/pyjutest @@ -0,0 +1,35 @@ +#!/usr/bin/env python3 +# +# pyjutest - junit xml generator + +from junit_xml import TestSuite, TestCase +from pickle import dump, load +from subprocess import Popen, PIPE, STDOUT + +import os +import sys + +if len (sys.argv) != 2: + print("%s 'mycmd param1' # to record a test" % sys.argv[0]) + sys.exit(-1) + +if os.path.exists('pyjutest.dat'): + with open('pyjutest.dat', 'r') as dat: + tss = load(dat) +else: + tss = [TestSuite("suite", None)] + +p = Popen(sys.argv[1], shell=True, stdout=PIPE, stderr=PIPE) +out,err = p.communicate() + +tc = TestCase(sys.argv[1], 'sh', 2, out[:-1], err[:-1]) +if p.returncode: + tc.add_failure_info(err, "return: %d" % p.returncode) + +tss[0].test_cases.append(tc) + +with open('pyjutest.dat', 'w') as dat: + dump(tss, dat) + +with open('pyjutest.xml', 'w') as xml: + TestSuite.to_file(xml, tss, prettyprint=True) diff --git a/setup.py b/setup.py index bdf4c7c..3827e94 100644 --- a/setup.py +++ b/setup.py @@ -2,11 +2,11 @@ from distutils.core import setup -setup(name='pjutest', +setup(name='pyjutest', version='1.0', description='junit xml generator', author='Manuel Traut', author_email='manut@linutronix.de', url='http://mecka.net/', - scripts=['pjutest'], + scripts=['pyjutest'], ) -- cgit v1.2.3