Преглед изворни кода

Do not assume existence of paths on the build system in the test suite

Instead of using /etc use a known to exist directory in the build tree,
and instead of hardcoding /bin/true, let the command module find it
in the PATH.
Guillem Jover пре 15 година
родитељ
комит
9817bf199f
3 измењених фајлова са 3 додато и 2 уклоњено
  1. 1 0
      debian/changelog
  2. 1 1
      lib/dpkg/test/t-command.c
  3. 1 1
      src/t/100_dpkg_divert.t

+ 1 - 0
debian/changelog

@@ -9,6 +9,7 @@ dpkg (1.16.2) UNRELEASED; urgency=low
     needing them will compile correctly.
   * Check for the presence of the strnlen declaration and correctly provide
     the compat one in case the systems lacks it.
+  * Do not assume existence of paths on the build system in the test suite.
 
   [ Updated man page translations ]
   * German (Helge Kreutzmann).

+ 1 - 1
lib/dpkg/test/t-command.c

@@ -139,7 +139,7 @@ test_command_exec(void)
 	struct command cmd;
 	pid_t pid;
 
-	command_init(&cmd, "/bin/true", "exec test");
+	command_init(&cmd, "true", "exec test");
 
 	command_add_arg(&cmd, "arg 0");
 	command_add_arg(&cmd, "arg 1");

+ 1 - 1
src/t/100_dpkg_divert.t

@@ -146,7 +146,7 @@ install_diversions('');
 call_divert_badusage(['--add',], qr/needs a single argument/);
 call_divert_badusage(['--add', 'foo'], qr/absolute/);
 call_divert_badusage(['--add', "/foo\nbar"], qr/newline/);
-call_divert_badusage(['--add', "/etc"], qr/director(y|ies)/);
+call_divert_badusage(['--add', "$testdir"], qr/director(y|ies)/);
 call_divert_badusage(['--add', "--divert", "bar", "/foo/bar"], qr/absolute/);
 call_divert_badusage(['--remove'], qr/needs a single argument/);
 call([@dd, '--admindir'], [],