[perl-Glib-Object-Introspection] Fix tests for gobject-introspection 0.10.x
- From: Torsten SchÃnfeld <tsch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [perl-Glib-Object-Introspection] Fix tests for gobject-introspection 0.10.x
- Date: Fri, 14 Oct 2011 17:50:43 +0000 (UTC)
commit 864be5e6aa315847b33e03929c1f97c1b57a4951
Author: Torsten SchÃnfeld <kaffeetisch gmx de>
Date: Fri Oct 14 19:49:23 2011 +0200
Fix tests for gobject-introspection 0.10.x
t/boxed.t | 16 ++++++++++++----
t/inc/setup.pl | 5 +++++
t/objects.t | 8 ++++++--
t/structs.t | 8 ++++++--
4 files changed, 29 insertions(+), 8 deletions(-)
---
diff --git a/t/boxed.t b/t/boxed.t
index ba9d644..11b66d2 100644
--- a/t/boxed.t
+++ b/t/boxed.t
@@ -19,7 +19,9 @@ plan tests => 41;
is ($boxed, undef);
}
-{
+SKIP: {
+ skip 'new stuff', 6
+ unless check_gi_version (0, 12, 0);
my $boxed = GI::BoxedStruct::returnv ();
isa_ok ($boxed, 'GI::BoxedStruct');
is ($boxed->long_, 42);
@@ -32,7 +34,9 @@ plan tests => 41;
isa_ok (GI::BoxedStruct::returnv ()->copy, 'GI::BoxedStruct');
}
-{
+SKIP: {
+ skip 'new stuff', 5
+ unless check_gi_version (0, 12, 0);
my $boxed = GI::BoxedStruct::out ();
isa_ok ($boxed, 'GI::BoxedStruct');
is ($boxed->long_, 42);
@@ -44,7 +48,9 @@ plan tests => 41;
isa_ok (GI::BoxedStruct::out ()->copy, 'GI::BoxedStruct');
}
-{
+SKIP: {
+ skip 'new stuff', 4
+ unless check_gi_version (0, 12, 0);
my $boxed_out = GI::BoxedStruct::out ();
my $boxed = GI::BoxedStruct::inout ($boxed_out);
isa_ok ($boxed, 'GI::BoxedStruct');
@@ -57,7 +63,9 @@ plan tests => 41;
# --------------------------------------------------------------------------- #
-{
+SKIP: {
+ skip 'new stuff', 5
+ unless check_gi_version (0, 12, 0);
my $boxed = Regress::TestSimpleBoxedA::const_return ();
isa_ok ($boxed, 'Regress::TestSimpleBoxedA');
isa_ok ($boxed, 'Glib::Boxed');
diff --git a/t/inc/setup.pl b/t/inc/setup.pl
index 583666e..012341b 100644
--- a/t/inc/setup.pl
+++ b/t/inc/setup.pl
@@ -29,4 +29,9 @@ sub delta_ok ($$;$) {
ok (abs ($a - $b) < 1e-6, $msg);
}
+sub check_gi_version {
+ my ($x, $y, $z) = @_;
+ return !system ('pkg-config', "atleast-version=$x.$y.$z");
+}
+
1;
diff --git a/t/objects.t b/t/objects.t
index 0c979fc..d234bf1 100644
--- a/t/objects.t
+++ b/t/objects.t
@@ -37,7 +37,9 @@ is (eval { $obj->torture_signature_1 (23, 'perl', 41); 1 }, undef);
like ($@, qr/odd/);
# skipping return values
-{
+SKIP: {
+ skip 'new stuff', 3
+ unless check_gi_version (0, 12, 0);
my ($b, $d, $sum) = $obj->skip_return_val (23, 42, 57, 13, 17);
is ($b, 24);
is ($d, 58);
@@ -45,7 +47,9 @@ like ($@, qr/odd/);
}
# skipping parameters
-{
+SKIP: {
+ skip 'new stuff', 10
+ unless check_gi_version (0, 12, 0);
my ($success, $b, $d, $sum);
($success, $b, $d, $sum) = $obj->skip_param (23, 57, 13, 17);
diff --git a/t/structs.t b/t/structs.t
index 1845af7..afe8b0c 100644
--- a/t/structs.t
+++ b/t/structs.t
@@ -7,7 +7,9 @@ use warnings;
plan tests => 6;
-{
+SKIP: {
+ skip 'new stuff', 2
+ unless check_gi_version (0, 12, 0);
my $expected_struct = {long_ => 6, int8 => 7};
my $struct = GI::SimpleStruct::returnv ();
is_deeply ($struct, $expected_struct);
@@ -17,7 +19,9 @@ plan tests => 6;
is_deeply (GI::SimpleStruct::returnv (), $expected_struct);
}
-{
+SKIP: {
+ skip 'new stuff', 2
+ unless check_gi_version (0, 12, 0);
my $expected_struct = {long_ => 42};
my $struct = GI::PointerStruct::returnv ();
is_deeply ($struct, $expected_struct);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]