diff options
Diffstat (limited to 'src/compiler/glsl/tests/cache_test.c')
-rw-r--r-- | src/compiler/glsl/tests/cache_test.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/compiler/glsl/tests/cache_test.c b/src/compiler/glsl/tests/cache_test.c index de92e5aba0e..7a1ff0ac5bc 100644 --- a/src/compiler/glsl/tests/cache_test.c +++ b/src/compiler/glsl/tests/cache_test.c @@ -127,7 +127,7 @@ rmrf_local(const char *path) } static void -check_timestamp_and_gpu_id_directories_created(const char *cache_dir) +check_timestamp_and_gpu_id_directories_created(char *cache_dir) { bool sub_dirs_created = false; @@ -180,13 +180,16 @@ test_disk_cache_create(void) expect_null(cache, "disk_cache_create with XDG_CACHE_HOME set with" "a non-existing parent directory"); + /* Create string with expected directory hierarchy */ + char expected_dir_h[255]; + sprintf(expected_dir_h, "%s%s%s", CACHE_TEST_TMP "/xdg-cache-home/mesa/", + get_arch_bitness_str(), "/make_check/test"); + mkdir(CACHE_TEST_TMP, 0755); cache = disk_cache_create("test", "make_check"); expect_non_null(cache, "disk_cache_create with XDG_CACHE_HOME set"); - check_timestamp_and_gpu_id_directories_created(CACHE_TEST_TMP - "/xdg-cache-home" - "/mesa/make_check/test"); + check_timestamp_and_gpu_id_directories_created(expected_dir_h); disk_cache_destroy(cache); @@ -199,13 +202,15 @@ test_disk_cache_create(void) expect_null(cache, "disk_cache_create with MESA_GLSL_CACHE_DIR set with" "a non-existing parent directory"); + sprintf(expected_dir_h, "%s%s%s", CACHE_TEST_TMP + "/mesa-glsl-cache-dir/mesa/", get_arch_bitness_str(), + "/make_check/test"); + mkdir(CACHE_TEST_TMP, 0755); cache = disk_cache_create("test", "make_check"); expect_non_null(cache, "disk_cache_create with MESA_GLSL_CACHE_DIR set"); - check_timestamp_and_gpu_id_directories_created(CACHE_TEST_TMP - "/mesa-glsl-cache-dir" - "/mesa/make_check/test"); + check_timestamp_and_gpu_id_directories_created(expected_dir_h); disk_cache_destroy(cache); } |