[test] Add lit helper for windows paths
authorKeith Smiley <keithbsmiley@gmail.com>
Sat, 26 Feb 2022 04:40:21 +0000 (20:40 -0800)
committerKeith Smiley <keithbsmiley@gmail.com>
Tue, 15 Mar 2022 03:05:55 +0000 (20:05 -0700)
commit6541d3e979c1c53adca758d35dfe4e6f4d4e597c
treeb2f537f16f00f9cb986de1f0760ada1d258863cb
parent2481adb59cb63c90879f4537ad36339da3ad61a6
[test] Add lit helper for windows paths

This adds 2 new lit helpers `%{fs-src-root}` and `%{fs-sep}`, these
allow writing tests that correctly handle slashes on Windows. In the
case of tests like clang/test/CodeGen/debug-prefix-map.c, these are
unable to correctly test behavior on both platforms, unless they fork
and add OS requirements, because the relevant logic hits host specific
codepaths like checking if paths are absolute.

Differential Revision: https://reviews.llvm.org/D111457
llvm/docs/CommandGuide/lit.rst
llvm/docs/TestingGuide.rst
llvm/utils/lit/lit/TestRunner.py