]> git.donarmstrong.com Git - debhelper.git/blob - t/dh_link
cmake: Pass CPPFLAGS in CFLAGS. Closes: #668813 Thanks, Simon Ruderich for the patch...
[debhelper.git] / t / dh_link
1 #!/usr/bin/perl
2 use Test;
3 plan(tests => 13);
4
5 # It used to not make absolute links in this situation, and it should.
6 # #37774
7 system("./dh_link","etc/foo","usr/lib/bar");
8 ok(readlink("debian/debhelper/usr/lib/bar"), "/etc/foo");
9
10 # let's make sure it makes simple relative links ok.
11 system("./dh_link","usr/bin/foo","usr/bin/bar");
12 ok(readlink("debian/debhelper/usr/bin/bar"), "foo");
13 system("./dh_link","sbin/foo","sbin/bar");
14 ok(readlink("debian/debhelper/sbin/bar"), "foo");
15
16 # ok, more complex relative links.
17 system("./dh_link","usr/lib/1","usr/bin/2");
18 ok(readlink("debian/debhelper/usr/bin/2"),"../lib/1");
19
20 # Check conversion of relative symlink to different top-level directory
21 # into absolute symlink. (#244157)
22 system("mkdir -p debian/debhelper/usr/lib; mkdir -p debian/debhelper/lib; touch debian/debhelper/lib/libm.so; cd debian/debhelper/usr/lib; ln -sf ../../lib/libm.so");
23 system("./dh_link");
24 ok(readlink("debian/debhelper/usr/lib/libm.so"), "/lib/libm.so");
25
26 # Check links to the current directory and below, they used to be
27 # unnecessarily long (#346405).
28 system("./dh_link","usr/lib/geant4","usr/lib/geant4/a");
29 ok(readlink("debian/debhelper/usr/lib/geant4/a"), ".");
30 system("./dh_link","usr/lib","usr/lib/geant4/b");
31 ok(readlink("debian/debhelper/usr/lib/geant4/b"), "..");
32 system("./dh_link","usr","usr/lib/geant4/c");
33 ok(readlink("debian/debhelper/usr/lib/geant4/c"), "../..");
34 system("./dh_link","/","usr/lib/geant4/d");
35 ok(readlink("debian/debhelper/usr/lib/geant4/d"), "/");
36
37 # Link to self.
38 system("./dh_link usr/lib/foo usr/lib/foo 2>/dev/null");
39 ok(! -l "debian/debhelper/usr/lib/foo");
40
41 # Make sure the link conversion didn't change any of the previously made
42 # links.
43 ok(readlink("debian/debhelper/usr/lib/bar"), "/etc/foo");
44 ok(readlink("debian/debhelper/usr/bin/bar"), "foo");
45 ok(readlink("debian/debhelper/usr/bin/2"),"../lib/1");