From 5ce8d4c146fef7c8890cd40e112858db69702bd2 Mon Sep 17 00:00:00 2001 From: skallweitNV <64953474+skallweitNV@users.noreply.github.com> Date: Wed, 14 Dec 2022 18:11:01 +0100 Subject: Shader cache improvements (#2564) * Make shader cache tests check the output buffer * Add shader cache eviction test * Cleanup comments * Improve TestReporter thread safety * Split lockFile test into two tests * Cleanup PersistentCache tests * Disable multi-threaded tests on aarch64 --- tools/slang-unit-test/unit-test-lock-file.cpp | 34 +++++++++++++++++---------- 1 file changed, 22 insertions(+), 12 deletions(-) (limited to 'tools/slang-unit-test/unit-test-lock-file.cpp') diff --git a/tools/slang-unit-test/unit-test-lock-file.cpp b/tools/slang-unit-test/unit-test-lock-file.cpp index 33e787a1d..312d9a1e2 100644 --- a/tools/slang-unit-test/unit-test-lock-file.cpp +++ b/tools/slang-unit-test/unit-test-lock-file.cpp @@ -10,20 +10,30 @@ using namespace Slang; -SLANG_UNIT_TEST(lockFile) +static const String fileName = Path::simplify(Path::getParentDirectory(Path::getExecutablePath()) + "/test_lock_file"); + +SLANG_UNIT_TEST(lockFileOpenClose) { - static String fileName = Path::simplify(Path::getParentDirectory(Path::getExecutablePath()) + "/test_lock_file"); + LockFile file; + SLANG_CHECK(file.isOpen() == false); + SLANG_CHECK_ABORT(file.open(fileName) == SLANG_OK); + SLANG_CHECK(file.isOpen() == true); + SLANG_CHECK(File::exists(fileName) == true); + file.close(); + SLANG_CHECK(file.isOpen() == false); - // Open/close lock file. - { - LockFile file; - SLANG_CHECK(file.isOpen() == false); - SLANG_CHECK_ABORT(file.open(fileName) == SLANG_OK); - SLANG_CHECK(file.isOpen() == true); - SLANG_CHECK(File::exists(fileName) == true); - file.close(); - SLANG_CHECK(file.isOpen() == false); - } + // Cleanup. + File::remove(fileName); + SLANG_CHECK(File::exists(fileName) == false); +} + +SLANG_UNIT_TEST(lockFileSync) +{ + // aarch64 builds currently fail to run multi-threaded tests within the test-server. + // Tests work fine without the test-server, which is puzzling. For now we disable them. +#if SLANG_PROCESSOR_ARM_64 + SLANG_IGNORE_TEST +#endif // Test using multiple threads. { -- cgit v1.2.3