[tor-dev] test_cmdline_args.py on Windows

Gisle Vanem gvanem at yahoo.no
Mon Jan 5 16:26:09 UTC 2015


Gisle Vanem wrote:

> I only get 2 errors in that script. The others like:
>    self.assertTrue(out_verif.endswith("Configuration was valid\n"))
>
> needs another patch which is beyond my Python knowledge.

I think it's fine now with this change:

@@ -57,14 +57,14 @@
          raise UnexpectedFailure()
      elif not result and failure:
          raise UnexpectedSuccess()
-    return b2s(output)
+    return b2s(output.replace('\r\n','\n'))

Won't hurt on non-Windows, no?

Another problem was checking the SHA1 digest on main.c:
   main_line = [ l for l in lines(out) if l.endswith("/main.c") ]

Since the makefiles for MSVC doesn't specify "src/or/main.c",
this won't work. From my 'tor.exe --digests':
   ...
   d17c7886ad4a021eb95caf56919e8a2fa84affe4  tor_main.c
   7004e3f521b284d95a5baee52c8ddca24901e85d  main.c

I suggest to patch that line like so:

@@ -151,7 +151,7 @@
          if os.stat(TOR).st_mtime < os.stat(main_c).st_mtime:
              self.skipTest(TOR+" not up to date")
          out = run_tor(["--digests"])
-        main_line = [ l for l in lines(out) if l.endswith("/main.c") ]
+        main_line = [ l for l in lines(out) if l.endswith("/main.c") or l.endswith(" main.c") ]
          digest, name = main_line[0].split()


-- 
--gv


More information about the tor-dev mailing list