]> git.ipfire.org Git - thirdparty/mlmmj.git/commitdiff
test: restore usage of top_srcdir which was actually setup in kyua.conf
authorBaptiste Daroussin <bapt@FreeBSD.org>
Tue, 27 May 2025 09:35:47 +0000 (11:35 +0200)
committerBaptiste Daroussin <bapt@FreeBSD.org>
Tue, 27 May 2025 09:35:47 +0000 (11:35 +0200)
Add a test of the presence of the variable, it fails if the kyua.conf
path is not provided to the kyua call

tests/mlmmj.c

index 5080cb84ca048fad239a3a6fa459aae0c6ae7c18..0444f2f5fa98e2633b6ef19a9d9774823e00e635 100644 (file)
@@ -1893,8 +1893,9 @@ setup_listtext(const atf_tc_t *tc)
 {
        char *dir = NULL;
        rmdir("list/text");
-       xasprintf(&dir, "%s/../listtexts/en",
-           atf_tc_get_config_var(tc, "srcdir"));
+       ATF_REQUIRE_MSG(atf_tc_has_config_var(tc, "top_srcdir"), "missing configuration variable 'top_srcdir'");
+       xasprintf(&dir, "%s/listtexts/en",
+           atf_tc_get_config_var(tc, "top_srcdir"));
 
        symlink(dir, "list/text");
 }