From b4dac9dfb9bb632db6a29ca61c1772443f468bde Mon Sep 17 00:00:00 2001 From: Frank Lichtenheld Date: Sun, 8 Jul 2007 22:04:06 +0000 Subject: [PATCH] Add first test cases for Dpkg::Shlibs Currently only tests parse_ldso_conf since find_library is difficult to test. --- scripts/t/100_Dpkg_Version.t | 3 --- scripts/t/200_Dpkg_Shlibs.t | 18 ++++++++++++++++++ scripts/t/200_Dpkg_Shlibs/ld.so.conf | 9 +++++++++ .../ld.so.conf.d/inf_recurse.conf | 1 + .../t/200_Dpkg_Shlibs/ld.so.conf.d/normal.conf | 1 + .../ld.so.conf.d/recursive.conf | 1 + scripts/t/200_Dpkg_Shlibs/ld.so.conf_2 | 1 + 7 files changed, 31 insertions(+), 3 deletions(-) create mode 100644 scripts/t/200_Dpkg_Shlibs.t create mode 100644 scripts/t/200_Dpkg_Shlibs/ld.so.conf create mode 100644 scripts/t/200_Dpkg_Shlibs/ld.so.conf.d/inf_recurse.conf create mode 100644 scripts/t/200_Dpkg_Shlibs/ld.so.conf.d/normal.conf create mode 100644 scripts/t/200_Dpkg_Shlibs/ld.so.conf.d/recursive.conf create mode 100644 scripts/t/200_Dpkg_Shlibs/ld.so.conf_2 diff --git a/scripts/t/100_Dpkg_Version.t b/scripts/t/100_Dpkg_Version.t index c5415500..0e7e02f9 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 00000000..ec74b7eb --- /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 00000000..cbbf7bd9 --- /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 00000000..a8e88c0c --- /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 00000000..26e8b98c --- /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 00000000..8e6fe25f --- /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 00000000..4a36fea1 --- /dev/null +++ b/scripts/t/200_Dpkg_Shlibs/ld.so.conf_2 @@ -0,0 +1 @@ +/nonexistant/lib128 -- 2.39.5