Browse code

Fix run-test script to take into account the config file that is specified on the command line.

Florent Viard authored on 2015/03/11 02:11:04
Showing 1 changed files
... ...
@@ -27,7 +27,6 @@ run_tests = []
27 27
 exclude_tests = []
28 28
 
29 29
 verbose = False
30
-configfile = None
31 30
 
32 31
 if os.name == "posix":
33 32
     have_wget = True
... ...
@@ -43,7 +42,6 @@ if os.getenv("HOME"):
43 43
 elif os.name == "nt" and os.getenv("USERPROFILE"):
44 44
     config_file = os.path.join(os.getenv("USERPROFILE").decode('mbcs'), os.getenv("APPDATA").decode('mbcs') or 'Application Data', "s3cmd.ini")
45 45
 
46
-cfg = S3.Config.Config(config_file)
47 46
 
48 47
 ## Unpack testsuite/ directory
49 48
 if not os.path.isdir('testsuite') and os.path.isfile('testsuite.tar.gz'):
... ...
@@ -179,9 +177,9 @@ def test_s3cmd(label, cmd_args = [], **kwargs):
179 179
     if not cmd_args[0].endswith("s3cmd"):
180 180
         cmd_args.insert(0, "python2")
181 181
         cmd_args.insert(1, "s3cmd")
182
-        if configfile:
182
+        if config_file:
183 183
             cmd_args.insert(2, "-c")
184
-            cmd_args.insert(3, configfile)
184
+            cmd_args.insert(3, config_file)
185 185
 
186 186
     return test(label, cmd_args, **kwargs)
187 187
 
... ...
@@ -244,7 +242,7 @@ while argv:
244 244
         sys.exit(0)
245 245
 
246 246
     if arg in ("-c", "--config"):
247
-        configfile = argv.pop(0)
247
+        config_file = argv.pop(0)
248 248
         continue
249 249
     if arg in ("-l", "--list"):
250 250
         exclude_tests = range(0, 999)
... ...
@@ -269,6 +267,8 @@ while argv:
269 269
     else:
270 270
         run_tests.append(int(arg))
271 271
 
272
+cfg = S3.Config.Config(config_file)
273
+
272 274
 if not run_tests:
273 275
     run_tests = range(0, 999)
274 276