From e8b25c01a5dba772112c6ee63015e4c2aa09fc15 Mon Sep 17 00:00:00 2001 From: Achim Stremplat Date: Fri, 3 Dec 2021 11:44:45 +0100 Subject: [PATCH] Release v0.10.0 (addendum) --- components/libRamsesBase/tests/LinkAdaptor_test.cpp | 4 ++-- datamodel/libCore/tests/Undo_test.cpp | 9 +++++++-- datamodel/libTesting/include/testing/TestUtil.h | 1 + 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/components/libRamsesBase/tests/LinkAdaptor_test.cpp b/components/libRamsesBase/tests/LinkAdaptor_test.cpp index f7e8968a..4827a16f 100644 --- a/components/libRamsesBase/tests/LinkAdaptor_test.cpp +++ b/components/libRamsesBase/tests/LinkAdaptor_test.cpp @@ -58,7 +58,7 @@ end } #if (!defined (__linux__)) -// TODO: Investigate this on Linux +// awaitPreviewDirty does not work in Linux as expected. See RAOS-692 TEST_F(LinkAdaptorFixture, linkWorksIfScriptContentChanges) { const auto luaScript{context.createObject(raco::user_types::LuaScript::typeDescription.typeName, "lua_script", "lua_script_id")}; @@ -93,7 +93,7 @@ function run() end )"); - raco::awaitPreviewDirty(recorder, luaScript); + EXPECT_TRUE(raco::awaitPreviewDirty(recorder, luaScript)); ASSERT_NO_FATAL_FAILURE(dispatch()); ASSERT_TRUE(backend.logicEngine().update()); diff --git a/datamodel/libCore/tests/Undo_test.cpp b/datamodel/libCore/tests/Undo_test.cpp index 0217ba4f..2345bbbe 100644 --- a/datamodel/libCore/tests/Undo_test.cpp +++ b/datamodel/libCore/tests/Undo_test.cpp @@ -710,6 +710,9 @@ void main() { postCheck("alt_name"); } +#if (!defined(__linux__)) +// awaitPreviewDirty does not work in Linux as expected. See RAOS-692 + TEST_F(UndoTest, lua_resync_after_undo) { TextFile luaFile = makeFile("test.lua", R"( function interface() @@ -738,7 +741,7 @@ end recorder.reset(); raco::utils::file::write(luaFile.path.string(), altLuaScript); - raco::awaitPreviewDirty(recorder, lua); + EXPECT_TRUE(raco::awaitPreviewDirty(recorder, lua)); EXPECT_FALSE(luaOutputs.hasProperty("vec")); EXPECT_TRUE(luaOutputs.hasProperty("renamed")); @@ -788,7 +791,7 @@ end recorder.reset(); raco::utils::file::write(luaFile.path.string(), altLuaScript); - raco::awaitPreviewDirty(recorder, lua); + EXPECT_TRUE(raco::awaitPreviewDirty(recorder, lua)); EXPECT_FALSE(luaOutputs.hasProperty("vec")); EXPECT_TRUE(luaOutputs.hasProperty("renamed")); @@ -802,3 +805,5 @@ end //The assert fails - needs to be fixed. See RAOS-687 //ASSERT_FALSE(commandInterface.errors().hasError({node})); } + +#endif \ No newline at end of file diff --git a/datamodel/libTesting/include/testing/TestUtil.h b/datamodel/libTesting/include/testing/TestUtil.h index 29c745af..a190b73f 100644 --- a/datamodel/libTesting/include/testing/TestUtil.h +++ b/datamodel/libTesting/include/testing/TestUtil.h @@ -85,6 +85,7 @@ inline bool awaitPreviewDirty(const raco::core::DataChangeRecorder& recorder, co while (std::find(dirtyObjects.begin(), dirtyObjects.end(), obj) == dirtyObjects.end()) { if (std::chrono::steady_clock::now() > timeoutTS) { assert(false && "Timeout"); + return false; } std::this_thread::sleep_for(std::chrono::milliseconds{5}); QCoreApplication::processEvents();