utils/scancpan: add a check of XS dependencies in generated test
authorFrancois Perrad <fperrad@gmail.com>
Fri, 29 Mar 2019 18:05:24 +0000 (19:05 +0100)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Sun, 31 Mar 2019 12:01:36 +0000 (14:01 +0200)
The XS modules have a high propability to fail (compared to Pure Perl modules),
so it is valuable to check XS dependencies before the check of the main module.

Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
utils/scancpan

index 8073ad1978f1be48b279e07f3fb356488948e085..0e7585e312c65cd3ed7480e8576a2a7efd42f807 100755 (executable)
@@ -845,6 +845,14 @@ while (my ($distname, $dist) = each %dist) {
         say {$fh} qq{};
         say {$fh} qq{    def test_run(self):};
         say {$fh} qq{        self.login()};
+        foreach my $dep (sort grep { $is_xs{$_} } @indirect) {
+            $dep =~ s|-|::|g;
+            say {$fh} qq{        self.module_test("${dep}")};
+        }
+        foreach my $dep (sort grep { $is_xs{$_} } @{$deps_runtime{$distname}}) {
+            $dep =~ s|-|::|g;
+            say {$fh} qq{        self.module_test("${dep}")};
+        }
         say {$fh} qq{        self.module_test("${modname}")};
         close $fh;
     }