From fba034195eb9b3a13eb1c17a6be5c4d9c4826b80 Mon Sep 17 00:00:00 2001 From: marauder2k7 Date: Thu, 27 Jul 2023 09:25:32 +0100 Subject: [PATCH 1/4] Update test-results.yml --- .github/workflows/test-results.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test-results.yml b/.github/workflows/test-results.yml index 12fbe4b9d..9e9082fd5 100644 --- a/.github/workflows/test-results.yml +++ b/.github/workflows/test-results.yml @@ -23,10 +23,12 @@ jobs: } - { name: "Linux Test Results", + runos: ubuntu-latest, artifact-name: "torque3dLinuxGCCUnitTest" } - { name: "Mac Test Results", + runos: macos-latest, artifact-name: "torque3dMacOSXCLANGUnitTest" } From a43675be7e5174c3cf9fb55baa3c1a768e176aa7 Mon Sep 17 00:00:00 2001 From: marauder2k7 Date: Thu, 27 Jul 2023 09:53:52 +0100 Subject: [PATCH 2/4] test runner --- .github/workflows/build-windows-msvc.yml | 1 - .github/workflows/test-results-linux.yml | 40 ++++++++++++++++++++++ .github/workflows/test-results-mac.yml | 40 ++++++++++++++++++++++ .github/workflows/test-results-windows.yml | 40 ++++++++++++++++++++++ 4 files changed, 120 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/test-results-linux.yml create mode 100644 .github/workflows/test-results-mac.yml create mode 100644 .github/workflows/test-results-windows.yml diff --git a/.github/workflows/build-windows-msvc.yml b/.github/workflows/build-windows-msvc.yml index ee642d711..6dd243048 100644 --- a/.github/workflows/build-windows-msvc.yml +++ b/.github/workflows/build-windows-msvc.yml @@ -9,7 +9,6 @@ concurrency: cancel-in-progress: true jobs: build-windows: - if: github.repository == 'TorqueGameEngines/Torque3D' name: ${{matrix.config.name}} runs-on: windows-latest strategy: diff --git a/.github/workflows/test-results-linux.yml b/.github/workflows/test-results-linux.yml new file mode 100644 index 000000000..0792902a1 --- /dev/null +++ b/.github/workflows/test-results-linux.yml @@ -0,0 +1,40 @@ +name: Report Test Results +on: + workflow_run: + workflows: ["Linux Build"] + types: + - completed + +permissions: + checks: write + +jobs: + checks: + name: ${{matrix.config.name}} + runs-on: ${{matrix.config.runos}} + strategy: + fail-fast: false + matrix: + config: + - { + name: "Linux Test Results", + runos: ubuntu-latest, + artifact-name: "torque3dLinuxGCCUnitTest" + } + + steps: + - name: Download Linux Test Report + uses: dawidd6/action-download-artifact@v2 + with: + path: Linux + name: ${{matrix.config.artifact-name}} + workflow: ${{ github.event.workflow.id }} + run_id: ${{ github.event.workflow_run.id }} + + - name: Test Reporter + uses: phoenix-actions/test-reporting@v12 + with: + artifact: ${{matrix.config.artifact-name}} + name: ${{matrix.config.name}} + path: "**/My Projects/Torque3D/game/test_detail.xml" + reporter: java-junit diff --git a/.github/workflows/test-results-mac.yml b/.github/workflows/test-results-mac.yml new file mode 100644 index 000000000..8c55748a1 --- /dev/null +++ b/.github/workflows/test-results-mac.yml @@ -0,0 +1,40 @@ +name: Report Test Results +on: + workflow_run: + workflows: ["MacOSX Build"] + types: + - completed + +permissions: + checks: write + +jobs: + checks: + name: ${{matrix.config.name}} + runs-on: ${{matrix.config.runos}} + strategy: + fail-fast: false + matrix: + config: + - { + name: "Mac Test Results", + runos: macos-latest, + artifact-name: "torque3dMacOSXCLANGUnitTest" + } + + steps: + - name: Download Mac Test Report + uses: dawidd6/action-download-artifact@v2 + with: + path: macOS + name: ${{matrix.config.artifact-name}} + workflow: ${{ github.event.workflow.id }} + run_id: ${{ github.event.workflow_run.id }} + + - name: Test Reporter + uses: phoenix-actions/test-reporting@v12 + with: + artifact: ${{matrix.config.artifact-name}} + name: ${{matrix.config.name}} + path: "**/My Projects/Torque3D/game/test_detail.xml" + reporter: java-junit diff --git a/.github/workflows/test-results-windows.yml b/.github/workflows/test-results-windows.yml new file mode 100644 index 000000000..0fa435464 --- /dev/null +++ b/.github/workflows/test-results-windows.yml @@ -0,0 +1,40 @@ +name: Report Test Results +on: + workflow_run: + workflows: ["Windows Build"] + types: + - completed + +permissions: + checks: write + +jobs: + checks: + name: ${{matrix.config.name}} + runs-on: ${{matrix.config.runos}} + strategy: + fail-fast: false + matrix: + config: + - { + name: "Windows Test Results", + runos: windows-latest, + artifact-name: "torque3dWindowsMSVCUnitTest" + } + + steps: + - name: Download Windows Test Report + uses: dawidd6/action-download-artifact@v2 + with: + path: Windows + name: ${{matrix.config.artifact-name}} + workflow: ${{ github.event.workflow.id }} + run_id: ${{ github.event.workflow_run.id }} + + - name: Test Reporter + uses: phoenix-actions/test-reporting@v12 + with: + artifact: ${{matrix.config.artifact-name}} + name: ${{matrix.config.name}} + path: "**/My Projects/Torque3D/game/test_detail.xml" + reporter: java-junit From 74d87c54a018e9c89e7a6840caf072fc36a7a161 Mon Sep 17 00:00:00 2001 From: marauder2k7 Date: Tue, 1 Aug 2023 06:43:45 +0100 Subject: [PATCH 3/4] Update test-results-linux.yml --- .github/workflows/test-results-linux.yml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/.github/workflows/test-results-linux.yml b/.github/workflows/test-results-linux.yml index c7a5977f6..7f61a8c5f 100644 --- a/.github/workflows/test-results-linux.yml +++ b/.github/workflows/test-results-linux.yml @@ -21,15 +21,6 @@ jobs: runos: ubuntu-latest, artifact-name: "torque3dLinuxGCCUnitTest" } -<<<<<<<< HEAD:.github/workflows/test-results.yml - - { - name: "Mac Test Results", - runos: macos-latest, - artifact-name: "torque3dMacOSXCLANGUnitTest" - } -======== ->>>>>>>> upstream/development:.github/workflows/test-results-linux.yml - steps: - name: Download Linux Test Report uses: dawidd6/action-download-artifact@v2 From 24562e675885e30bc30dfc6deba54bb0ac1803ff Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Sun, 3 Mar 2024 22:04:09 -0600 Subject: [PATCH 4/4] aug ArrayObject to have a uniquePair command like uniqueket and uniquevalue, removes duplicate entries, but only if *both* match also, use that for the populateAllFonts() cache generator --- Engine/source/console/arrayObject.cpp | 22 +++++++++++++++++++ Engine/source/console/arrayObject.h | 6 ++++- .../utility/scripts/helperFunctions.tscript | 2 +- 3 files changed, 28 insertions(+), 2 deletions(-) diff --git a/Engine/source/console/arrayObject.cpp b/Engine/source/console/arrayObject.cpp index cfd25d6cb..d5eaffe98 100644 --- a/Engine/source/console/arrayObject.cpp +++ b/Engine/source/console/arrayObject.cpp @@ -404,6 +404,22 @@ void ArrayObject::uniqueKey() //----------------------------------------------------------------------------- +void ArrayObject::uniquePair() +{ + for (S32 i = 0; i < mArray.size(); i++) + { + for (S32 j = i + 1; j < mArray.size(); j++) + { + if (isEqual(mArray[i].key, mArray[j].key) && isEqual(mArray[i].value, mArray[j].value)) + { + erase(j); + j--; + } + } + } +} +//----------------------------------------------------------------------------- + void ArrayObject::duplicate(ArrayObject* obj) { empty(); @@ -740,6 +756,12 @@ DefineEngineMethod( ArrayObject, uniqueKey, void, (),, object->uniqueKey(); } +DefineEngineMethod(ArrayObject, uniquePair, void, (), , + "Removes any elements that have duplicated key and value pairs (leaving the first instance)") +{ + object->uniquePair(); +} + DefineEngineMethod( ArrayObject, duplicate, bool, ( ArrayObject* target ),, "Alters array into an exact duplicate of the target array.\n" "@param target ArrayObject to duplicate\n" ) diff --git a/Engine/source/console/arrayObject.h b/Engine/source/console/arrayObject.h index 81531b6c2..cde4f92b6 100644 --- a/Engine/source/console/arrayObject.h +++ b/Engine/source/console/arrayObject.h @@ -158,6 +158,10 @@ public: /// (keeps the first instance only) void uniqueKey(); + /// Removes any duplicate keys from the array + /// (keeps the first instance only) + void uniquePair(); + /// Makes this array an exact duplicate of another array void duplicate( ArrayObject *obj ); @@ -229,4 +233,4 @@ public: static void initPersistFields(); }; -#endif // _ARRAYOBJECT_H_ \ No newline at end of file +#endif // _ARRAYOBJECT_H_ diff --git a/Templates/BaseGame/game/core/utility/scripts/helperFunctions.tscript b/Templates/BaseGame/game/core/utility/scripts/helperFunctions.tscript index 905100648..fc6e0d33c 100644 --- a/Templates/BaseGame/game/core/utility/scripts/helperFunctions.tscript +++ b/Templates/BaseGame/game/core/utility/scripts/helperFunctions.tscript @@ -650,7 +650,7 @@ function populateAllFonts() continue; %fontarray.push_back(%obj.fontType,%obj.fontSize); } - %fontarray.uniqueKey(); + %fontarray.uniquePair(); %fontarrayCount = %fontarray.count();