lib/dirs: rows skip loudly when WW_TEST_TMPDIR is absent
This commit is contained in:
@@ -1,10 +1,13 @@
|
|||||||
// dirstest — exercises lib/dirs against an env state pre-arranged by
|
// dirstest — exercises lib/dirs against an arranged env cohort. The
|
||||||
// the C driver (test/wcc/975_dirs_run.c).
|
// XDG rows need env control ww cannot self-arrange (no setenv,
|
||||||
|
// deliberately), so every row skips loudly when WW_TEST_TMPDIR is
|
||||||
|
// absent and the suite passes bare; the arranged leg (env cohort
|
||||||
|
// below constructed per row over a scratch HOME, rows asserted `ok`,
|
||||||
|
// not SKIP) is test/libenv/libenv_test.ww.
|
||||||
//
|
//
|
||||||
// Pre-arranged env (set via setenv/unsetenv before exec'ing
|
// Arranged env cohort:
|
||||||
// `ww run lib/dirs/dirstest.ww`; see 975_dirs_run.c):
|
|
||||||
//
|
//
|
||||||
// HOME = <tmpl> (mkdtemp'd /tmp/wwdirs-XXXXXX)
|
// HOME = <tmpl> (fresh scratch dir)
|
||||||
// XDG_CONFIG_HOME = <tmpl>/cfg (absolute → XDG branch)
|
// XDG_CONFIG_HOME = <tmpl>/cfg (absolute → XDG branch)
|
||||||
// XDG_CACHE_HOME = "relative/path" (non-abs → fallback to HOME)
|
// XDG_CACHE_HOME = "relative/path" (non-abs → fallback to HOME)
|
||||||
// XDG_DATA_HOME unset (fallback to HOME)
|
// XDG_DATA_HOME unset (fallback to HOME)
|
||||||
@@ -36,6 +39,7 @@ package dirs_test;
|
|||||||
|
|
||||||
import dirs;
|
import dirs;
|
||||||
import os;
|
import os;
|
||||||
|
import test;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -83,11 +87,8 @@ fn expected(tmpl: str, sub: str, prog: str) str = {
|
|||||||
fn gettmpdir() str = {
|
fn gettmpdir() str = {
|
||||||
match (os.getenv("WW_TEST_TMPDIR")) {
|
match (os.getenv("WW_TEST_TMPDIR")) {
|
||||||
case let s: str => return s;
|
case let s: str => return s;
|
||||||
case void => {
|
case void =>
|
||||||
abort();
|
test.skip("WW_TEST_TMPDIR unset (arranged leg: test/libenv)");
|
||||||
let empty: str;
|
|
||||||
return empty;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user