# # # patch "tests/common/cvs.lua" # from [df8dd4548b02e5ce850067226861b4dbe6891932] # to [0c2cf3c2efb0df62a1685923ddbc43fef17feb7b] # # patch "tests/empty_environment/__driver__.lua" # from [db8cb7bde7a670621710d0149a6167d84e7a12d0] # to [0bc59bbb2475e7185ce3f0f7eee7c6351b7871d3] # # patch "testsuite.lua" # from [7cf86a0135ed5ac1219668f597b01192bce857a4] # to [1b2b288fe7a790acc82b8f3bf51b4318ac6619c5] # ============================================================ --- tests/common/cvs.lua df8dd4548b02e5ce850067226861b4dbe6891932 +++ tests/common/cvs.lua 0c2cf3c2efb0df62a1685923ddbc43fef17feb7b @@ -1,11 +1,21 @@ skip_if(not existsonpath("cvs")) function cvs(...) - return {"cvs", "-d", cvsroot, unpack(arg)} + if os.getenv("OSTYPE") == "msys" then + return {"cvs", "-d", cvsroot_nix, unpack(arg)} + else + return {"cvs", "-d", cvsroot, unpack(arg)} + end end function cvs_setup() cvsroot = test.root .. "/cvs-repository" + -- if we're mingw/msys, we need to replace the Windows drive + -- : with / , or CVS will think it's a remote + -- repository + if os.getenv("OSTYPE") == "msys" then + cvsroot_nix = string.gsub(cvsroot, "^(%a):", "/%1") + end check(cvs("-q", "init"), 0, false, false) check(exists(cvsroot)) check(exists(cvsroot .. "/CVSROOT")) ============================================================ --- tests/empty_environment/__driver__.lua db8cb7bde7a670621710d0149a6167d84e7a12d0 +++ tests/empty_environment/__driver__.lua 0bc59bbb2475e7185ce3f0f7eee7c6351b7871d3 @@ -6,14 +6,14 @@ return {"env", "-i", unpack(mtn(unpack(arg)))} end ---check(if test "$OSTYPE" = "msys"; then --- cp $(which libiconv-2.dll) . --- cp $(which zlib1.dll) . ---fi) +if os.getenv("OSTYPE") == "msys" then + local iconv = getpathof("libiconv-2", ".dll") + local zlib = getpathof("zlib1", ".dll") + copyfile(iconv, "libiconv-2.dll") + copyfile(zlib, "zlib1.dll") +end check(noenv_mtn("--help"), 2, false, false) writefile("testfile", "blah blah") check(noenv_mtn("add", "testfile"), 0, false, false) check(noenv_mtn("commit", "--branch=testbranch", "--message=foo"), 0, false, false) - -check(false) -- need to fix for windows ============================================================ --- testsuite.lua 7cf86a0135ed5ac1219668f597b01192bce857a4 +++ testsuite.lua 1b2b288fe7a790acc82b8f3bf51b4318ac6619c5 @@ -1,8 +1,9 @@ #!./tester ostype = string.sub(get_ostype(), 1, string.find(get_ostype(), " ")-1) -function getpathof(exe) +-- maybe this should go in tester.lua instead? +function getpathof(exe, ext) local function gotit(now) if test.log == nil then logfile:write(exe, " found at ", now, "\n") @@ -12,14 +13,17 @@ return now end local path = os.getenv("PATH") - local char, ext + local char if ostype == "Windows" then char = ';' - ext = ".exe" else char = ':' - ext = "" end + if ostype == "Windows" then + if ext == nil then ext = ".exe" end + else + if ext == nil then ext = "" end + end local now = initial_dir.."/"..exe..ext if exists(now) then return gotit(now) end for x in string.gfind(path, "[^"..char.."]*"..char) do @@ -35,10 +39,11 @@ else test.log:write("Cannot find ", exe, "\n") end - return exe + return nil end monotone_path = getpathof("mtn") +if monotone_path == nil then monotone_path = "mtn" end function safe_mtn(...) return {monotone_path, "--norc", "--root=" .. test.root, unpack(arg)}