From abd4284bc62127a2db69c8c81501a56bb29284c8 Mon Sep 17 00:00:00 2001 From: Jiang Xin Date: Tue, 25 Jun 2013 23:53:57 +0800 Subject: test: run testcases with POSIX absolute paths on Windows Some test cases are skipped on Windows by marking with POSIX prereq. This is because arguments look like absolute paths (such as /a/b) for regular Windows programs (*.exe executables, no bash scripts) are changed to Windows paths (like C:/msysgit/a/b). There is no cygpath nor equivalent on msysGit, but it is easy to write one. New subcommand "mingw_path" is added in test-path-utils, so that we can get the expected absolute paths on Windows. E.g. COMMAND LINE Linux output Windows output ================================== ============ =============== test-path-utils mingw_path / / C:/msysgit test-path-utils mingw_path /a/b/ /a/b/ C:/msysgit/a/b/ With this utility, most skipped test cases in t0060 can be turned on to be tested correctly on Windows. Signed-off-by: Jiang Xin Signed-off-by: Junio C Hamano --- test-path-utils.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'test-path-utils.c') diff --git a/test-path-utils.c b/test-path-utils.c index 1bf4730619..bb975e4d3e 100644 --- a/test-path-utils.c +++ b/test-path-utils.c @@ -116,6 +116,11 @@ int main(int argc, char **argv) return 0; } + if (argc == 3 && !strcmp(argv[1], "mingw_path")) { + puts(argv[2]); + return 0; + } + if (argc == 4 && !strcmp(argv[1], "relative_path")) { struct strbuf sb = STRBUF_INIT; const char *in, *prefix, *rel; -- cgit v1.2.1