From 44ed8c4b2c47768a46235d07a0beb9e5240228fd Mon Sep 17 00:00:00 2001 From: domrjchen Date: Wed, 1 Nov 2023 19:47:27 +0800 Subject: [PATCH] Fix ios-demo script and remove the TaskTest that alway randomly fails. --- ios/TGFXDemo.xcodeproj/project.pbxproj | 4 +- ...{generate_tgfx_demo.sh => tgfx_install.sh} | 2 +- test/src/TaskTest.cpp | 56 ------------------- 3 files changed, 3 insertions(+), 59 deletions(-) rename ios/{generate_tgfx_demo.sh => tgfx_install.sh} (89%) delete mode 100644 test/src/TaskTest.cpp diff --git a/ios/TGFXDemo.xcodeproj/project.pbxproj b/ios/TGFXDemo.xcodeproj/project.pbxproj index c6d4ab3c..e53a4e2b 100644 --- a/ios/TGFXDemo.xcodeproj/project.pbxproj +++ b/ios/TGFXDemo.xcodeproj/project.pbxproj @@ -312,7 +312,7 @@ ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_TEAM = 3A75DREAB8; + DEVELOPMENT_TEAM = 36588GHG2N; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", @@ -348,7 +348,7 @@ ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_TEAM = 3A75DREAB8; + DEVELOPMENT_TEAM = 36588GHG2N; GCC_PREPROCESSOR_DEFINITIONS = "GLES_SILENCE_DEPRECATION=1"; GENERATE_INFOPLIST_FILE = YES; HEADER_SEARCH_PATHS = ""; diff --git a/ios/generate_tgfx_demo.sh b/ios/tgfx_install.sh similarity index 89% rename from ios/generate_tgfx_demo.sh rename to ios/tgfx_install.sh index 3c52f63e..925c7638 100755 --- a/ios/generate_tgfx_demo.sh +++ b/ios/tgfx_install.sh @@ -5,7 +5,7 @@ set -eo pipefail ../sync_deps.sh # generate tgfx's xcode project. -cmake ../CMakeLists.txt -G Xcode -B tgfx -DCMAKE_TOOLCHAIN_FILE=./vendor_tools/ios.toolchain.cmake -DPLATFORM=OS64 -DENABLE_ARC=OFF -DENABLE_BITCODE=OFF +cmake ../CMakeLists.txt -G Xcode -B tgfx -DCMAKE_TOOLCHAIN_FILE=../third-party/vendor_tools/ios.toolchain.cmake -DPLATFORM=OS64 -DENABLE_ARC=OFF -DENABLE_BITCODE=OFF # Prepare the workspace in the TEMP directory NAME="TGFXDemo.xcworkspace" diff --git a/test/src/TaskTest.cpp b/test/src/TaskTest.cpp deleted file mode 100644 index 94dc6d7c..00000000 --- a/test/src/TaskTest.cpp +++ /dev/null @@ -1,56 +0,0 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// -// -// Tencent is pleased to support the open source community by making tgfx available. -// -// Copyright (C) 2023 THL A29 Limited, a Tencent company. All rights reserved. -// -// Licensed under the BSD 3-Clause License (the "License"); you may not use this file except -// in compliance with the License. You may obtain a copy of the License at -// -// https://opensource.org/licenses/BSD-3-Clause -// -// unless required by applicable law or agreed to in writing, software distributed under the -// license is distributed on an "as is" basis, without warranties or conditions of any kind, -// either express or implied. see the license for the specific language governing permissions -// and limitations under the license. -// -///////////////////////////////////////////////////////////////////////////////////////////////// - -#include -#include "tgfx/utils/Task.h" -#include "utils/Log.h" -#include "utils/TestUtils.h" - -namespace tgfx { - -TGFX_TEST(TaskTest, Task) { - std::vector> tasks = {}; - for (int i = 0; i < 17; i++) { - auto task = Task::Run([=] { - LOGI("Task %d is executing...", i); - std::this_thread::sleep_for(std::chrono::milliseconds(20)); - LOGI("Task %d is finished", i); - }); - tasks.push_back(task); - } - // Wait a little moment for the tasks to be executed. - std::this_thread::yield(); - auto task = tasks[0]; - EXPECT_TRUE(task->executing()); - task->cancel(); - auto taskCancelled = task->cancelled(); - task = tasks[16]; - EXPECT_TRUE(task->executing()); - task->cancel(); - EXPECT_TRUE(task->cancelled()); - for (auto& item : tasks) { - item->wait(); - EXPECT_FALSE(item->executing()); - } - task = tasks[0]; - EXPECT_NE(task->finished(), taskCancelled); - task = tasks[16]; - EXPECT_FALSE(task->finished()); - tasks = {}; -} -} // namespace tgfx