Skip to contentSkip to conversation

suppport/testing: more Perl/CPAN modules

PATCH New Francois Perrad 2 participants 9 messages Dec 4, 2018 – Dec 6, 2018

lore
Share & tools
lore
#0 lore raw

cover suppport/testing: more Perl/CPAN modules

Testing pure Perl modules has few added value.
So, it is important that XS modules are marked.

Francois Perrad (7):
scancpan: mark XS modules in docstring of test support/testing/tests/packages/test_perl_*: regeneration
scancpan: allow the generation of more tests support/testing: add perl-dbd-mysql test support/testing: add perl-encode-decode test support/testing: add perl-io-socket-multicast test support/testing: add perl-io-socket-ssl test

 .../tests/package/test_perl_class_load.py     |  4 ++--
 .../tests/package/test_perl_dbd_mysql.py      | 21 +++++++++++++++++++
 .../tests/package/test_perl_encode_detect.py  | 20 ++++++++++++++++++
 .../tests/package/test_perl_gdgraph.py        |  2 +-
 .../package/test_perl_io_socket_multicast.py  | 21 +++++++++++++++++++
 .../tests/package/test_perl_io_socket_ssl.py  | 21 +++++++++++++++++++
 .../tests/package/test_perl_libwww_perl.py    |  2 +-
 .../tests/package/test_perl_mail_dkim.py      |  6 +++---
 .../testing/tests/package/test_perl_x10.py    |  2 +-
 .../tests/package/test_perl_xml_libxml.py     |  2 +-
 utils/scancpan                                | 12 ++++++-----
 11 files changed, 99 insertions(+), 14 deletions(-)
 create mode 100644 support/testing/tests/package/test_perl_dbd_mysql.py
 create mode 100644 support/testing/tests/package/test_perl_encode_detect.py
 create mode 100644 support/testing/tests/package/test_perl_io_socket_multicast.py
 create mode 100644 support/testing/tests/package/test_perl_io_socket_ssl.py
Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/7 scancpan: mark XS modules in docstring of test

---
 utils/scancpan | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
utils/scancpan +6 -4
index 2a58591e5..45709e166 100755
@@ -519,6 +519,7 @@ my %dist;               # name -> metacpan data
 my %need_target;        # name -> 1 if target package is needed
 my %need_host;          # name -> 1 if host package is needed
 my %need_dlopen;        # name -> 1 if requires dynamic library
+my %is_xs;              # name -> 1 if XS module
 my %deps_build;         # name -> list of host dependencies
 my %deps_runtime;       # name -> list of target dependencies
 my %license_files;      # name -> hash of license files
@@ -614,7 +615,7 @@ sub fetch {
             my $author = $result->{author};
             my $release = $name . q{-} . $result->{version};
             my $manifest = $mcpan->source( author => $author, release => $release, path => 'MANIFEST' );
-            $need_dlopen{$name} = is_xs( $manifest );
+            $need_dlopen{$name} = $is_xs{$name} = is_xs( $manifest );
             foreach my $fname (find_license_files( $manifest )) {
                 my $license = $mcpan->source( author => $author, release => $release, path => $fname );
                 $license_files{$name}->{$fname} = sha256_hex( $license );
@@ -811,6 +812,7 @@ while (my ($distname, $dist) = each %dist) {
         $classname =~ s|-||g;
         my $modname = $distname;
         $modname =~ s|-|::|g;
+        my $mark = $is_xs{$distname} ? q{   XS} : q{};
         my @indirect = (get_indirect_dependencies( $distname ));
         say qq{write ${testname}} unless $quiet;
         open my $fh, q{>}, $testname;
@@ -820,16 +822,16 @@ while (my ($distname, $dist) = each %dist) {
         say {$fh} qq{class TestPerl${classname}(TestPerlBase):};
         say {$fh} qq{    """};
         say {$fh} qq{    package:};
-        say {$fh} qq{        ${distname}};
+        say {$fh} qq{        ${distname}${mark}};
         say {$fh} qq{    direct dependencies:};
         foreach my $dep (sort @{$deps_runtime{$distname}}) {
-            my $mark = want_test( $dep ) ? q{ *} : q{};
+            $mark = $is_xs{$dep} ? q{   XS} : q{};
             say {$fh} qq{        ${dep}${mark}};
         }
         if (scalar @indirect > 0) {
             say {$fh} qq{    indirect dependencies:};
             foreach my $dep (sort @indirect) {
-                my $mark = want_test( $dep ) ? q{ *} : q{};
+                $mark = $is_xs{$dep} ? q{   XS} : q{};
                 say {$fh} qq{        ${dep}${mark}};
             }
         }
Signature · 1 line
2.17.1
#2 lore raw

PATCH 2/7 support/testing/tests/packages/test_perl_*: regeneration

In reply to Francois Perrad
---
 support/testing/tests/package/test_perl_class_load.py  | 4 ++--
 support/testing/tests/package/test_perl_gdgraph.py     | 2 +-
 support/testing/tests/package/test_perl_libwww_perl.py | 2 +-
 support/testing/tests/package/test_perl_mail_dkim.py   | 6 +++---
 support/testing/tests/package/test_perl_x10.py         | 2 +-
 support/testing/tests/package/test_perl_xml_libxml.py  | 2 +-
 6 files changed, 9 insertions(+), 9 deletions(-)
support/testing/tests/package/test_perl_class_load.py +2 -2
index 1e86c0374..fbcd904aa 100644
@@ -6,14 +6,14 @@ class TestPerlClassLoad(TestPerlBase):
     package:
         Class-Load
     direct dependencies:
-        Data-OptList *
+        Data-OptList
         Module-Implementation
         Module-Runtime
         Package-Stash
         Try-Tiny
     indirect dependencies:
         Dist-CheckConflicts
-        Params-Util
+        Params-Util   XS
         Sub-Install
     """
 
support/testing/tests/package/test_perl_gdgraph.py +1 -1
index 16cd8cb8e..23ddbca4a 100644
@@ -6,7 +6,7 @@ class TestPerlGDGraph(TestPerlBase):
     package:
         GDGraph
     direct dependencies:
-        GD
+        GD   XS
         GDTextUtil
     """
 
support/testing/tests/package/test_perl_libwww_perl.py +1 -1
index e777071bb..af9f7c7ed 100644
@@ -8,7 +8,7 @@ class TestPerllibwwwperl(TestPerlBase):
     direct dependencies:
         Encode-Locale
         File-Listing
-        HTML-Parser
+        HTML-Parser   XS
         HTTP-Cookies
         HTTP-Daemon
         HTTP-Date
support/testing/tests/package/test_perl_mail_dkim.py +3 -3
index dc4d4bb3a..7affce82b 100644
@@ -6,13 +6,13 @@ class TestPerlMailDKIM(TestPerlBase):
     package:
         Mail-DKIM
     direct dependencies:
-        Crypt-OpenSSL-RSA
+        Crypt-OpenSSL-RSA   XS
         MailTools
         Net-DNS
         Net-DNS-Resolver-Mock
-        YAML-LibYAML
+        YAML-LibYAML   XS
     indirect dependencies:
-        Crypt-OpenSSL-Random
+        Crypt-OpenSSL-Random   XS
         Digest-HMAC
         TimeDate
     """
support/testing/tests/package/test_perl_x10.py +1 -1
index 46f247f2d..84feb74e6 100644
@@ -7,7 +7,7 @@ class TestPerlX10(TestPerlBase):
         X10
     direct dependencies:
         Astro-SunTime
-        Device-SerialPort
+        Device-SerialPort   XS
         Time-ParseDate
     """
 
support/testing/tests/package/test_perl_xml_libxml.py +1 -1
index 76eacfaea..faace5dd0 100644
@@ -4,7 +4,7 @@ from tests.package.test_perl import TestPerlBase
 class TestPerlXMLLibXML(TestPerlBase):
     """
     package:
-        XML-LibXML
+        XML-LibXML   XS
     direct dependencies:
         XML-NamespaceSupport
         XML-SAX
Signature · 1 line
2.17.1
#3 lore raw

PATCH 3/7 scancpan: allow the generation of more tests

In reply to Francois Perrad
---
 utils/scancpan | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
utils/scancpan +1 -1
index 45709e166..229ca1056 100755
@@ -578,7 +578,7 @@ sub find_license_files {
 
 sub want_test {
     my ($distname) = @_;
-    return 1 if $need_dlopen{$distname} && scalar @{$deps_runtime{$distname}} > 1;
+    return 1 if $need_dlopen{$distname} && scalar @{$deps_runtime{$distname}} > 0;
 }
 
 sub get_dependencies {
Signature · 1 line
2.17.1
#4 lore raw

PATCH 4/7 support/testing: add perl-dbd-mysql test

In reply to Francois Perrad
---
 .../tests/package/test_perl_dbd_mysql.py      | 21 +++++++++++++++++++
 1 file changed, 21 insertions(+)
 create mode 100644 support/testing/tests/package/test_perl_dbd_mysql.py
support/testing/tests/package/test_perl_dbd_mysql.py new file +21 -0
new file mode 100644
index 000000000..f8fe832b4
@@ -0,0 +1,21 @@
+from tests.package.test_perl import TestPerlBase
+
+
+class TestPerlDBDmysql(TestPerlBase):
+    """
+    package:
+        DBD-mysql   XS
+    direct dependencies:
+        DBI   XS
+    """
+
+    config = TestPerlBase.config + \
+        """
+        BR2_PACKAGE_PERL=y
+        BR2_PACKAGE_PERL_DBD_MYSQL=y
+        """
+
+    def test_run(self):
+        self.login()
+        self.module_test("DBI")
+        self.module_test("DBD::mysql")
Signature · 1 line
2.17.1
#5 lore raw

PATCH 5/7 support/testing: add perl-encode-decode test

In reply to Francois Perrad
---
 .../tests/package/test_perl_encode_detect.py  | 20 +++++++++++++++++++
 1 file changed, 20 insertions(+)
 create mode 100644 support/testing/tests/package/test_perl_encode_detect.py
support/testing/tests/package/test_perl_encode_detect.py new file +20 -0
new file mode 100644
index 000000000..4b33fee01
@@ -0,0 +1,20 @@
+from tests.package.test_perl import TestPerlBase
+
+
+class TestPerlEncodeDetect(TestPerlBase):
+    """
+    package:
+        Encode-Detect   XS
+    direct dependencies:
+        Module-Build
+    """
+
+    config = TestPerlBase.config + \
+        """
+        BR2_PACKAGE_PERL=y
+        BR2_PACKAGE_PERL_ENCODE_DETECT=y
+        """
+
+    def test_run(self):
+        self.login()
+        self.module_test("Encode::Detect")
Signature · 1 line
2.17.1
#6 lore raw

PATCH 6/7 support/testing: add perl-io-socket-multicast test

In reply to Francois Perrad
---
 .../package/test_perl_io_socket_multicast.py  | 21 +++++++++++++++++++
 1 file changed, 21 insertions(+)
 create mode 100644 support/testing/tests/package/test_perl_io_socket_multicast.py
support/testing/tests/package/test_perl_io_socket_multicast.py new file +21 -0
new file mode 100644
index 000000000..48a086a6f
@@ -0,0 +1,21 @@
+from tests.package.test_perl import TestPerlBase
+
+
+class TestPerlIOSocketMulticast(TestPerlBase):
+    """
+    package:
+        IO-Socket-Multicast   XS
+    direct dependencies:
+        IO-Interface   XS
+    """
+
+    config = TestPerlBase.config + \
+        """
+        BR2_PACKAGE_PERL=y
+        BR2_PACKAGE_PERL_IO_SOCKET_MULTICAST=y
+        """
+
+    def test_run(self):
+        self.login()
+        self.module_test("IO::Interface")
+        self.module_test("IO::Socket::Multicast")
Signature · 1 line
2.17.1
#7 lore raw

PATCH 7/7 support/testing: add perl-io-socket-ssl test

In reply to Francois Perrad
---
 .../tests/package/test_perl_io_socket_ssl.py  | 21 +++++++++++++++++++
 1 file changed, 21 insertions(+)
 create mode 100644 support/testing/tests/package/test_perl_io_socket_ssl.py
support/testing/tests/package/test_perl_io_socket_ssl.py new file +21 -0
new file mode 100644
index 000000000..51663e837
@@ -0,0 +1,21 @@
+from tests.package.test_perl import TestPerlBase
+
+
+class TestPerlIOSocketSSL(TestPerlBase):
+    """
+    package:
+        IO-Socket-SSL
+    direct dependencies:
+        Net-SSLeay   XS
+    """
+
+    config = TestPerlBase.config + \
+        """
+        BR2_PACKAGE_PERL=y
+        BR2_PACKAGE_PERL_IO_SOCKET_SSL=y
+        """
+
+    def test_run(self):
+        self.login()
+        self.module_test("Net::SSLeay")
+        self.module_test("IO::Socket::SSL")
Signature · 1 line
2.17.1
#8 lore raw

cover suppport/testing: more Perl/CPAN modules

In reply to Francois Perrad

Hello,

Quoted 8 lines · Francois Perrad

Francois Perrad (7):
scancpan: mark XS modules in docstring of test support/testing/tests/packages/test_perl_*: regeneration
scancpan: allow the generation of more tests support/testing: add perl-dbd-mysql test support/testing: add perl-encode-decode test support/testing: add perl-io-socket-multicast test support/testing: add perl-io-socket-ssl test

Thanks, series applied. I added a patch that regenerates the .gitlab-ci.yml file so that the new tests are really used.

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com