summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorFrank Lichtenheld <djpig@debian.org>2007-07-08 22:04:06 +0000
committerFrank Lichtenheld <djpig@debian.org>2007-07-08 22:04:06 +0000
commitb4dac9dfb9bb632db6a29ca61c1772443f468bde (patch)
tree0969a9cb2237da702cb138865789825c19fce7e9 /scripts
parent0a276d596f9d7c32251b69ebc4edd41efcf2fd38 (diff)
downloaddpkg-b4dac9dfb9bb632db6a29ca61c1772443f468bde.tar.gz
Add first test cases for Dpkg::Shlibs
Currently only tests parse_ldso_conf since find_library is difficult to test.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/t/100_Dpkg_Version.t3
-rw-r--r--scripts/t/200_Dpkg_Shlibs.t18
-rw-r--r--scripts/t/200_Dpkg_Shlibs/ld.so.conf9
-rw-r--r--scripts/t/200_Dpkg_Shlibs/ld.so.conf.d/inf_recurse.conf1
-rw-r--r--scripts/t/200_Dpkg_Shlibs/ld.so.conf.d/normal.conf1
-rw-r--r--scripts/t/200_Dpkg_Shlibs/ld.so.conf.d/recursive.conf1
-rw-r--r--scripts/t/200_Dpkg_Shlibs/ld.so.conf_21
7 files changed, 31 insertions, 3 deletions
diff --git a/scripts/t/100_Dpkg_Version.t b/scripts/t/100_Dpkg_Version.t
index c5415500b..0e7e02f99 100644
--- a/scripts/t/100_Dpkg_Version.t
+++ b/scripts/t/100_Dpkg_Version.t
@@ -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
index 000000000..ec74b7eb3
--- /dev/null
+++ b/scripts/t/200_Dpkg_Shlibs.t
@@ -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
index 000000000..cbbf7bd98
--- /dev/null
+++ b/scripts/t/200_Dpkg_Shlibs/ld.so.conf
@@ -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
index 000000000..a8e88c0c2
--- /dev/null
+++ b/scripts/t/200_Dpkg_Shlibs/ld.so.conf.d/inf_recurse.conf
@@ -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
index 000000000..26e8b98c1
--- /dev/null
+++ b/scripts/t/200_Dpkg_Shlibs/ld.so.conf.d/normal.conf
@@ -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
index 000000000..8e6fe25f4
--- /dev/null
+++ b/scripts/t/200_Dpkg_Shlibs/ld.so.conf.d/recursive.conf
@@ -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
index 000000000..4a36fea14
--- /dev/null
+++ b/scripts/t/200_Dpkg_Shlibs/ld.so.conf_2
@@ -0,0 +1 @@
+/nonexistant/lib128