perl-Object-Pad/Object-Pad-0.50-t-99exporte...

51 lines
1.8 KiB
Diff

From 8336fc91d5d4d10ab7b3345724f0f3a1a190292a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
Date: Mon, 9 Aug 2021 16:43:26 +0200
Subject: [PATCH] t/99exported-symbols.t: Obtain header file content from
Object::Pad::ExtensionBuilder_data
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The test did not work on installed files because there is no
object_pad.h file:
$ perl t/99exported-symbols.t
ok 1 - No unexpected symbols found in /usr/lib64/perl5/vendor_perl/auto/Object/Pad/Pad.so
Cannot read include/object_pad.h - No such file or directory at t/99exported-symbols.t line 59.
# Tests were run but no plan was declared and done_testing() was not seen.
# Looks like your test exited with 2 just after 1.
But content of that file is wrapped into
Object::Pad::ExtensionBuilder_data module. This patch changed the test
to inspect Object::Pad::ExtensionBuilder_data.
Signed-off-by: Petr Písař <ppisar@redhat.com>
---
t/99exported-symbols.t | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/t/99exported-symbols.t b/t/99exported-symbols.t
index 8f0e7fb..c8987bc 100644
--- a/t/99exported-symbols.t
+++ b/t/99exported-symbols.t
@@ -54,13 +54,10 @@ ok( !@unexpected_symbols, "No unexpected symbols found in $sofile" ) or
diag( "Symbols found:\n " . join( "\n ", @unexpected_symbols ) );
# Now compare to the #define'd macros in object_pad.h
+require Object::Pad::ExtensionBuilder_data;
my %macros;
{
- open my $fh, "include/object_pad.h" or
- die "Cannot read include/object_pad.h - $!";
-
- while( <$fh> ) {
- chomp;
+ for( split(/\R/, Object::Pad::ExtensionBuilder_data::OBJECT_PAD_H()) ) {
next unless m/^#define (.*?)\(/;
$macros{$1}++;
--
2.31.1