[testing infra] Pretty-printing tests fail when need to find an out-of-line module

2987a13
Opened by Vadim Petrochenkov at 2023-09-28 04:42:37

Example, run-pass\mod_file_with_path_attr.rs:

#[path = "mod_file_aux.rs"] // <- can't find this file when compiling pretty-printing tests
mod m;

pub fn main() {
    assert_eq!(m::foo(), 10);
}

Test runner needs to somehow provide a source directory when compiling tests, so out-of-line modules could be successfully resolved.

  1. Aside: This also affects include!, and indeed, some of the // ignore-pretty FIXMEs already tagged with this issue number are actually using include!. (No doubt though, the necessary changes to testing infrastructure are clearly similar).

    Michael Lamparski at 2018-02-24 23:46:57

  2. Triage: Could you explain a bit more on how to reproduce the problem? Is there some ./x-command that fails because of this, for example?

    Martin Nordholts at 2023-09-28 04:42:37