]> err.no Git - dpkg/commitdiff
Add first test cases for Dpkg::Shlibs
authorFrank Lichtenheld <djpig@debian.org>
Sun, 8 Jul 2007 22:04:06 +0000 (22:04 +0000)
committerFrank Lichtenheld <djpig@debian.org>
Sun, 8 Jul 2007 22:04:06 +0000 (22:04 +0000)
Currently only tests parse_ldso_conf since find_library is
difficult to test.

scripts/t/100_Dpkg_Version.t
scripts/t/200_Dpkg_Shlibs.t [new file with mode: 0644]
scripts/t/200_Dpkg_Shlibs/ld.so.conf [new file with mode: 0644]
scripts/t/200_Dpkg_Shlibs/ld.so.conf.d/inf_recurse.conf [new file with mode: 0644]
scripts/t/200_Dpkg_Shlibs/ld.so.conf.d/normal.conf [new file with mode: 0644]
scripts/t/200_Dpkg_Shlibs/ld.so.conf.d/recursive.conf [new file with mode: 0644]
scripts/t/200_Dpkg_Shlibs/ld.so.conf_2 [new file with mode: 0644]

index c5415500ba086ff5a660151b3e5419d4abdb8f44..0e7e02f99cc00d3df4cf0a2c2125980e290e9675 100644 (file)
@@ -5,9 +5,6 @@ use Test::More;
 use warnings;
 use strict;
 
-use utf8;
-use Encode;
-
 # Default cmp '>'
 my @versions = ({a      => '1.0-1',
                 b      => '2.0-2',
diff --git a/scripts/t/200_Dpkg_Shlibs.t b/scripts/t/200_Dpkg_Shlibs.t
new file mode 100644 (file)
index 0000000..ec74b7e
--- /dev/null
@@ -0,0 +1,18 @@
+# -*- mode: cperl;-*-
+
+use Test::More tests => 2;
+
+use warnings;
+use strict;
+
+use_ok('Dpkg::Shlibs');
+
+my @save_paths = @Dpkg::Shlibs::librarypaths;
+@Dpkg::Shlibs::librarypaths = ();
+
+Dpkg::Shlibs::parse_ldso_conf("t/200_Dpkg_Shlibs/ld.so.conf");
+
+use Data::Dumper;
+is_deeply([qw(/nonexistant32 /nonexistant/lib64
+            /usr/local/lib /nonexistant/lib128 )],
+         \@Dpkg::Shlibs::librarypaths, "parsed library paths");
diff --git a/scripts/t/200_Dpkg_Shlibs/ld.so.conf b/scripts/t/200_Dpkg_Shlibs/ld.so.conf
new file mode 100644 (file)
index 0000000..cbbf7bd
--- /dev/null
@@ -0,0 +1,9 @@
+# Comment and empty line
+
+# Paths
+/nonexistant32
+/nonexistant/lib64
+
+include /nonexistant/*.conf
+include t/200_Dpkg_Shlibs/ld.so.conf.d/*.conf
+
diff --git a/scripts/t/200_Dpkg_Shlibs/ld.so.conf.d/inf_recurse.conf b/scripts/t/200_Dpkg_Shlibs/ld.so.conf.d/inf_recurse.conf
new file mode 100644 (file)
index 0000000..a8e88c0
--- /dev/null
@@ -0,0 +1 @@
+include t/200_Dpkg_Shlibs/ld.so.conf
diff --git a/scripts/t/200_Dpkg_Shlibs/ld.so.conf.d/normal.conf b/scripts/t/200_Dpkg_Shlibs/ld.so.conf.d/normal.conf
new file mode 100644 (file)
index 0000000..26e8b98
--- /dev/null
@@ -0,0 +1 @@
+/usr/local/lib/
diff --git a/scripts/t/200_Dpkg_Shlibs/ld.so.conf.d/recursive.conf b/scripts/t/200_Dpkg_Shlibs/ld.so.conf.d/recursive.conf
new file mode 100644 (file)
index 0000000..8e6fe25
--- /dev/null
@@ -0,0 +1 @@
+include t/200_Dpkg_Shlibs/ld.so.conf_2
diff --git a/scripts/t/200_Dpkg_Shlibs/ld.so.conf_2 b/scripts/t/200_Dpkg_Shlibs/ld.so.conf_2
new file mode 100644 (file)
index 0000000..4a36fea
--- /dev/null
@@ -0,0 +1 @@
+/nonexistant/lib128