+2005-08-31 Paul D. Smith <psmith@gnu.org>
+
+ * run_make_tests.pl (get_this_pwd): Require the POSIX module (in
+ an eval to trap errors) and if it exists, use POSIX::getcwd to
+ find the working directory. If it doesn't exist, go back to the
+ previous methods. This tries to be more accurate on Windows
+ systems.
+
2005-08-29 Paul D. Smith <psmith@gnu.org>
* scripts/functions/abspath: Add some text to the error messages
require "test_driver.pl";
+# Some target systems might not have the POSIX module...
+$has_POSIX = eval { require "POSIX.pm" };
+
#$SIG{INT} = sub { print STDERR "Caught a signal!\n"; die @_; };
sub valid_option
}
sub get_this_pwd {
- if ($vos) {
+ $delete_command = "rm";
+ if ($has_POSIX) {
+ $__pwd = POSIX::getcwd();
+ } elsif ($vos) {
$delete_command = "delete_file";
$__pwd = `++(current_dir)`;
- }
- else {
- $delete_command = "rm";
+ } else {
+ # No idea... just try using pwd as a last resort.
chop ($__pwd = `pwd`);
}
# Set up for valgrind, if requested.
if ($valgrind) {
-# use POSIX qw(:fcntl_h);
-# require Fcntl;
open(VALGRIND, "> valgrind.out")
|| die "Cannot open valgrind.out: $!\n";
# -q --leak-check=yes