summaryrefslogtreecommitdiffstats
path: root/tools/slang-unit-test/unit-test-lock-file.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/slang-unit-test/unit-test-lock-file.cpp')
-rw-r--r--tools/slang-unit-test/unit-test-lock-file.cpp34
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.
{