Tests using XDG_DATA_HOME are not working on Darwin
Darwin dirs.m handling is redirecting VLC_USERDATA_DIR to hardcoded values:
char *config_GetUserDir (vlc_userdir_t type)
{
const char *psz_path;
switch (type) {
case VLC_CONFIG_DIR:
case VLC_TEMPLATES_DIR:
case VLC_USERDATA_DIR:
case VLC_CACHE_DIR:
return getAppDependentDir(type);
static char *getAppDependentDir(vlc_userdir_t type)
{
NSString *formatString;
switch (type) {
case VLC_CONFIG_DIR:
formatString = @"%s/Library/Preferences/%@";
break;
case VLC_TEMPLATES_DIR:
case VLC_USERDATA_DIR:
formatString = @"%s/Library/Application Support/%@";
break;
But the tests (test_modules_lua_extensions and test_modules_misc_medialibrary) want to override this value when running, to configure the runtime environment.
There are three solutions:
- handle the XDG vars like on POSIX.
- add a new interception mechanism for darwin.
- setup HOME as well.