]> sjero.net Git - wget/commitdiff
Skip running rc files while executing tests.
authorSteven Schubiger <stsc@member.fsf.org>
Sat, 11 Apr 2009 19:59:55 +0000 (21:59 +0200)
committerSteven Schubiger <stsc@member.fsf.org>
Sat, 11 Apr 2009 19:59:55 +0000 (21:59 +0200)
src/ChangeLog
src/init.c
tests/ChangeLog
tests/run-px

index 82531a83d17e981266a164d1ab71e0a93652bb8e..ca2450885d97bad112ffce0c75d6f2a3720588be 100644 (file)
@@ -1,3 +1,8 @@
+2009-04-11  Steven Schubiger  <stsc@member.fsf.org>
+
+       * init.c (initialize): Run a custom SYSTEM_WGETRC when 
+       provided as an environment variable.
+
 2009-02-27  Gisle Vanem  <gvanem@broadpark.no>
 
        * main.c (main): "freopen (NULL,.." causes an assertion in MSVC
index 06a4d3c8d08658fd2e2b7205ef1bd34a7b3f40f1..5bed28f6804adb6b136cca7ef30f60e5a1c1976c 100644 (file)
@@ -1,6 +1,6 @@
 /* Reading/parsing the initialization file.
    Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
-   2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+   2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
 
 This file is part of GNU Wget.
 
@@ -542,15 +542,20 @@ run_wgetrc (const char *file)
 void
 initialize (void)
 {
-  char *file;
+  char *file, *env_sysrc;
   int ok = true;
 
   /* Load the hard-coded defaults.  */
   defaults ();
-
-  /* If SYSTEM_WGETRC is defined, use it.  */
+  
+  /* Run a non-standard system rc file when the according environment 
+     variable has been set. For internal testing purposes only!  */
+  env_sysrc = getenv ("SYSTEM_WGETRC");
+  if (env_sysrc && file_exists_p (env_sysrc))
+    ok &= run_wgetrc (env_sysrc);
+  /* Otherwise, if SYSTEM_WGETRC is defined, use it.  */
 #ifdef SYSTEM_WGETRC
-  if (file_exists_p (SYSTEM_WGETRC))
+  else if (file_exists_p (SYSTEM_WGETRC))
     ok &= run_wgetrc (SYSTEM_WGETRC);
 #endif
   /* Override it with your own, if one exists.  */
index 48d0f971a083b63bd11e6ef9bd589060b891c547..10fd1550d7b57db57ced4912300c388fda868474 100644 (file)
@@ -1,3 +1,8 @@
+2009-04-11  Steven Schubiger  <stsc@member.fsf.org>
+
+       * run-px: Skip testing with real rc files by setting 
+       SYSTEM_WGETRC and WGETRC to /dev/null.
+
 2009-02-25  Benjamin Wolsey  <bwy@benjaminwolsey.de>
 
        * Makefile.am (run-px-tests): Ensure run-px is run from srcdir.
index 6fe0d9fbb7532dbb06c1854788c50e9691b950ff..0753c8ed319ed20580fb98c5880aaf621c601abd 100755 (executable)
@@ -55,6 +55,10 @@ my @tests = (
     'Test--spider-r.px',
 );
 
+foreach my $var (qw(SYSTEM_WGETRC WGETRC)) {
+    $ENV{$var} = '/dev/null';
+}
+
 my @tested;
 
 foreach my $test (@tests) {
@@ -63,6 +67,10 @@ foreach my $test (@tests) {
     push @tested, { name => $test, result => $? };
 }
 
+foreach my $var (qw(SYSTEM_WGETRC WGETRC)) {
+    delete $ENV{$var};
+}
+
 print "\n";
 foreach my $test (@tested) {
     ($test->{result} == 0)