diff options
| author | skallweitNV <64953474+skallweitNV@users.noreply.github.com> | 2022-12-14 18:11:01 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-12-14 09:11:01 -0800 |
| commit | 5ce8d4c146fef7c8890cd40e112858db69702bd2 (patch) | |
| tree | d37e4faaaaa3631563b9993077787f44f234eb21 /tools/slang-unit-test/unit-test-lock-file.cpp | |
| parent | 9d048351d283f8df2a68aca52b3573dcbb8cdb9b (diff) | |
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
Diffstat (limited to 'tools/slang-unit-test/unit-test-lock-file.cpp')
| -rw-r--r-- | tools/slang-unit-test/unit-test-lock-file.cpp | 34 |
1 files changed, 22 insertions, 12 deletions
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. { |
