package/python-unitest-xml-reporting: new package
Based on initial work from Nicolas Carrier <nicolas.carrier@orolia.com>, with the following additions: - Updated to a newer version - Added proper license file handling - Added runtime test case - Restricted to Python 3.x Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
This commit is contained in:
parent
79e3cd1c78
commit
9d3428beca
@ -2005,16 +2005,19 @@ F: package/php-xdebug/
|
||||
F: package/python-augeas/
|
||||
F: package/python-flask-expects-json/
|
||||
F: package/python-git/
|
||||
F: package/python-unittest-xml-reporting/
|
||||
F: support/testing/tests/package/test_lua_augeas.py
|
||||
F: support/testing/tests/package/sample_bmap_tools.sh
|
||||
F: support/testing/tests/package/sample_python_augeas.py
|
||||
F: support/testing/tests/package/sample_python_flask_expects_json.py
|
||||
F: support/testing/tests/package/sample_python_git.py
|
||||
F: support/testing/tests/package/sample_python_unittest_xml_reporting.py
|
||||
F: support/testing/tests/package/test_bmap_tools.py
|
||||
F: support/testing/tests/package/test_php_pecl_dbus.py
|
||||
F: support/testing/tests/package/test_python_augeas.py
|
||||
F: support/testing/tests/package/test_python_flask_expects_json.py
|
||||
F: support/testing/tests/package/test_python_git.py
|
||||
F: support/testing/tests/package/test_python_unittest_xml_reporting.py
|
||||
|
||||
N: Nicolas Cavallari <nicolas.cavallari@green-communications.fr>
|
||||
F: package/libgit2/
|
||||
@ -2718,6 +2721,7 @@ F: package/python-flask-expects-json/
|
||||
F: package/python-git/
|
||||
F: package/python-mad/
|
||||
F: package/python-serial/
|
||||
F: package/python-unittest-xml-reporting/
|
||||
F: package/qextserialport/
|
||||
F: package/riscv64-elf-toolchain/
|
||||
F: package/rpcbind/
|
||||
@ -2733,10 +2737,12 @@ F: support/testing/tests/package/sample_python_augeas.py
|
||||
F: support/testing/tests/package/sample_python_flask.py
|
||||
F: support/testing/tests/package/sample_python_flask_expects_json.py
|
||||
F: support/testing/tests/package/sample_python_git.py
|
||||
F: support/testing/tests/package/sample_python_unittest_xml_reporting.py
|
||||
F: support/testing/tests/package/test_python_augeas.py
|
||||
F: support/testing/tests/package/test_python_flask.py
|
||||
F: support/testing/tests/package/test_python_flask_expects_json.py
|
||||
F: support/testing/tests/package/test_python_git.py
|
||||
F: support/testing/tests/package/test_python_unittest_xml_reporting.py
|
||||
F: toolchain/
|
||||
|
||||
N: Timo Ketola <timo.ketola@exertus.fi>
|
||||
|
@ -1257,6 +1257,7 @@ menu "External python modules"
|
||||
source "package/python-u-msgpack/Config.in"
|
||||
source "package/python-ubjson/Config.in"
|
||||
source "package/python-ujson/Config.in"
|
||||
source "package/python-unittest-xml-reporting/Config.in"
|
||||
source "package/python-urllib3/Config.in"
|
||||
source "package/python-urwid/Config.in"
|
||||
source "package/python-uvloop/Config.in"
|
||||
|
9
package/python-unittest-xml-reporting/Config.in
Normal file
9
package/python-unittest-xml-reporting/Config.in
Normal file
@ -0,0 +1,9 @@
|
||||
config BR2_PACKAGE_PYTHON_UNITTEST_XML_REPORTING
|
||||
bool "python-unittest-xml-reporting"
|
||||
depends on BR2_PACKAGE_PYTHON3
|
||||
select BR2_PACKAGE_PYTHON3_PYEXPAT
|
||||
help
|
||||
unittest-based test runner with Ant/JUnit like XML
|
||||
reporting.
|
||||
|
||||
http://github.com/xmlrunner/unittest-xml-reporting/
|
@ -0,0 +1,5 @@
|
||||
# md5, sha256 from https://pypi.org/pypi/unittest-xml-reporting/json
|
||||
md5 474cd89f9609828ef6039a0f00afd9db unittest-xml-reporting-3.0.4.tar.gz
|
||||
sha256 984cebba69e889401bfe3adb9088ca376b3a1f923f0590d005126c1bffd1a695 unittest-xml-reporting-3.0.4.tar.gz
|
||||
# Locally calculated
|
||||
sha256 0596648105bee470f9cafd62753b931efe52392096439d88e2564cf7d7cf0e68 LICENSE
|
@ -0,0 +1,23 @@
|
||||
################################################################################
|
||||
#
|
||||
# python-unittest-xml-reporting
|
||||
#
|
||||
################################################################################
|
||||
|
||||
PYTHON_UNITTEST_XML_REPORTING_VERSION = 3.0.4
|
||||
PYTHON_UNITTEST_XML_REPORTING_SOURCE = unittest-xml-reporting-$(PYTHON_UNITTEST_XML_REPORTING_VERSION).tar.gz
|
||||
PYTHON_UNITTEST_XML_REPORTING_SITE = https://files.pythonhosted.org/packages/bc/09/677086169c8e302b614de7d4a97c45c4446a382f31cc010fb31177258508
|
||||
# License file missing in Pypi tarball, download separately. Issue
|
||||
# reported at
|
||||
# https://github.com/xmlrunner/unittest-xml-reporting/issues/259
|
||||
PYTHON_UNITTEST_XML_REPORTING_EXTRA_DOWNLOADS = https://raw.githubusercontent.com/xmlrunner/unittest-xml-reporting/$(PYTHON_UNITTEST_XML_REPORTING_VERSION)/LICENSE
|
||||
PYTHON_UNITTEST_XML_REPORTING_SETUP_TYPE = setuptools
|
||||
PYTHON_UNITTEST_XML_REPORTING_LICENSE = BSD-2-Clause
|
||||
PYTHON_UNITTEST_XML_REPORTING_LICENSE_FILES = LICENSE
|
||||
|
||||
define PYTHON_UNITTEST_XML_REPORTING_ADD_LICENSE_FILE
|
||||
$(INSTALL) -D -m 0644 $(PYTHON_UNITTEST_XML_REPORTING_DL_DIR)/LICENSE $(@D)/LICENSE
|
||||
endef
|
||||
PYTHON_UNITTEST_XML_REPORTING_POST_EXTRACT_HOOKS += PYTHON_UNITTEST_XML_REPORTING_ADD_LICENSE_FILE
|
||||
|
||||
$(eval $(python-package))
|
@ -0,0 +1,9 @@
|
||||
import unittest
|
||||
import xmlrunner
|
||||
|
||||
class Test1(unittest.TestCase):
|
||||
def test_something(self):
|
||||
self.assertTrue(True)
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main(testRunner=xmlrunner.XMLTestRunner(output='test-reports'))
|
@ -0,0 +1,23 @@
|
||||
from tests.package.test_python import TestPythonPackageBase
|
||||
import os
|
||||
import time
|
||||
|
||||
|
||||
class TestPythonPy3UnitTestXmlReporting(TestPythonPackageBase):
|
||||
__test__ = True
|
||||
config = TestPythonPackageBase.config + \
|
||||
"""
|
||||
BR2_PACKAGE_PYTHON3=y
|
||||
BR2_PACKAGE_PYTHON_UNITTEST_XML_REPORTING=y
|
||||
"""
|
||||
sample_scripts = ["tests/package/sample_python_unittest_xml_reporting.py"]
|
||||
timeout = 60
|
||||
|
||||
def test_run(self):
|
||||
self.login()
|
||||
self.check_sample_scripts_exist()
|
||||
cmd = "%s %s" % (self.interpreter, os.path.basename(self.sample_scripts[0]))
|
||||
self.assertRunOk(cmd)
|
||||
# check if some tests results in XML were generated
|
||||
cmd = "ls -1 test-reports/TEST-Test1-*.xml"
|
||||
self.assertRunOk(cmd)
|
Loading…
Reference in New Issue
Block a user