From 57d0b12f9b07caf3173be04587125fe4eca33fb1 Mon Sep 17 00:00:00 2001 From: jadebenn Date: Sat, 6 Apr 2024 21:50:32 -0500 Subject: [PATCH] expand cmake presets --- CMakePresets.json | 172 +++++++++++++++------ tests/dCommonTests/AMFDeserializeTests.cpp | 4 +- tests/dCommonTests/Amf3Tests.cpp | 4 +- 3 files changed, 129 insertions(+), 51 deletions(-) diff --git a/CMakePresets.json b/CMakePresets.json index 60191bad..fa2b47aa 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -10,7 +10,7 @@ "name": "default", "displayName": "Default configure step", "description": "Use 'build' dir and Unix makefiles", - "binaryDir": "${sourceDir}/build", + "binaryDir": "${sourceDir}/build/default", "generator": "Unix Makefiles" }, { @@ -41,8 +41,8 @@ "name": "windows-msvc", "displayName": "[Multi] Windows (MSVC)", "description": "Set architecture to 64-bit (b/c RakNet)", - "inherits": "default", "generator": "Visual Studio 17 2022", + "binaryDir": "${sourceDir}/build/msvc", "architecture": { "value": "x64" }, @@ -81,16 +81,6 @@ "rhs": "Linux" } }, - { - "name": "macos-config", - "inherits": "default", - "hidden": true, - "condition": { - "type": "equals", - "lhs": "${hostSystemName}", - "rhs": "Darwin" - } - }, { "name": "linux-clang-debug", "inherits": [ @@ -99,7 +89,8 @@ "debug-config" ], "displayName": "[Debug] Linux (Clang)", - "description": "Create a debug build using the Clang toolchain for Linux" + "description": "Create a debug build using the Clang toolchain for Linux", + "binaryDir": "${sourceDir}/build/clang/debug" }, { "name": "linux-clang-release", @@ -109,7 +100,8 @@ "release-config" ], "displayName": "[Release] Linux (Clang)", - "description": "Create a release build using the Clang toolchain for Linux" + "description": "Create a release build using the Clang toolchain for Linux", + "binaryDir": "${sourceDir}/build/clang/release" }, { "name": "linux-gnu-debug", @@ -119,7 +111,8 @@ "debug-config" ], "displayName": "[Debug] Linux (GNU)", - "description": "Create a debug build using the GNU toolchain for Linux" + "description": "Create a debug build using the GNU toolchain for Linux", + "binaryDir": "${sourceDir}/build/gnu/debug" }, { "name": "linux-gnu-release", @@ -129,25 +122,20 @@ "release-config" ], "displayName": "[Release] Linux (GNU)", - "description": "Create a release build using the GNU toolchain for Linux" + "description": "Create a release build using the GNU toolchain for Linux", + "binaryDir": "${sourceDir}/build/gnu/release" }, { - "name": "macos-debug", - "inherits": [ - "macos-config", - "debug-config" - ], - "displayName": "[Debug] MacOS", - "description": "Create a debug build using MacOS" - }, - { - "name": "macos-release", - "inherits": [ - "macos-config", - "release-config" - ], - "displayName": "[Release] MacOS", - "description": "Create a release build using MacOS" + "name": "macos", + "inherits": "macos-config", + "displayName": "[Multi] MacOS", + "description": "Create a build for MacOS", + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Darwin" + }, + "binaryDir": "${sourceDir}/build/macos" } ], "buildPresets": [ @@ -208,14 +196,14 @@ }, { "name": "macos-debug", - "configurePreset": "macos-debug", + "configurePreset": "macos", "displayName": "[Debug] MacOS", "description": "This preset is used to build in debug mode on MacOS", "jobs": 2 }, { "name": "macos-release", - "configurePreset": "macos-release", + "configurePreset": "macos", "displayName": "[Release] MacOS", "description": "This preset is used to build in release mode on MacOS", "jobs": 2 @@ -233,18 +221,32 @@ } }, { - "name": "windows-msvc", + "name": "windows-msvc-test", "inherits": "default", "configurePreset": "windows-msvc", - "displayName": "[Multi] Windows (MSVC)", - "description": "Runs all tests on a Windows configuration", - "configuration": "Release", + "hidden": true, "filter": { "exclude": { "name": "((example)|(minigzip))+" } } }, + { + "name": "windows-msvc-debug", + "inherits": "windows-msvc-test", + "configurePreset": "windows-msvc", + "displayName": "[Debug] Windows (MSVC)", + "description": "Runs all tests on a Windows configuration", + "configuration": "Debug" + }, + { + "name": "windows-msvc-release", + "inherits": "windows-msvc-test", + "configurePreset": "windows-msvc", + "displayName": "[Release] Windows (MSVC)", + "description": "Runs all tests on a Windows configuration", + "configuration": "Release" + }, { "name": "linux-clang-debug", "inherits": "default", @@ -280,7 +282,7 @@ { "name": "macos-debug", "inherits": "default", - "configurePreset": "macos-debug", + "configurePreset": "macos", "displayName": "[Debug] MacOS", "description": "Runs all tests on a MacOS configuration", "configuration": "Debug" @@ -288,7 +290,7 @@ { "name": "macos-release", "inherits": "default", - "configurePreset": "macos-release", + "configurePreset": "macos", "displayName": "[Release] MacOS", "description": "Runs all tests on a MacOS configuration", "configuration": "Release" @@ -312,9 +314,28 @@ } ] }, + { + "name": "windows-msvc-debug", + "displayName": "[Debug] Windows (MSVC)", + "description": "MSVC debug workflow preset for Windows", + "steps": [ + { + "type": "configure", + "name": "windows-msvc" + }, + { + "type": "build", + "name": "windows-msvc-debug" + }, + { + "type": "test", + "name": "windows-msvc-debug" + } + ] + }, { "name": "ci-windows-2022", - "displayName": "Windows CI Workflow", + "displayName": "[Release] Windows (MSVC)", "description": "CI workflow preset for Windows", "steps": [ { @@ -327,13 +348,32 @@ }, { "type": "test", - "name": "windows-msvc" + "name": "windows-msvc-release" + } + ] + }, + { + "name": "linux-gnu-debug", + "displayName": "[Debug] Linux (GNU)", + "description": "GNU debug workflow preset for Linux", + "steps": [ + { + "type": "configure", + "name": "linux-gnu-debug" + }, + { + "type": "build", + "name": "linux-gnu-debug" + }, + { + "type": "test", + "name": "linux-gnu-debug" } ] }, { "name": "ci-ubuntu-22.04", - "displayName": "Ubuntu CI Workflow", + "displayName": "[Release] Linux (GNU)", "description": "CI workflow preset for Ubuntu", "steps": [ { @@ -350,10 +390,29 @@ } ] }, + { + "name": "linux-clang-debug", + "displayName": "[Debug] Linux (Clang)", + "description": "Clang debug workflow preset for Linux", + "steps": [ + { + "type": "configure", + "name": "linux-clang-debug" + }, + { + "type": "build", + "name": "linux-clang-debug" + }, + { + "type": "test", + "name": "linux-clang-debug" + } + ] + }, { "name": "linux-clang-release", - "displayName": "Build using Clang on Linux", - "description": "Clang workflow preset for Linux", + "displayName": "[Release] Linux (Clang)", + "description": "Clang release workflow preset for Linux", "steps": [ { "type": "configure", @@ -369,14 +428,33 @@ } ] }, + { + "name": "macos-debug", + "displayName": "[Debug] MacOS", + "description": "Release workflow preset for MacOS", + "steps": [ + { + "type": "configure", + "name": "macos" + }, + { + "type": "build", + "name": "macos-debug" + }, + { + "type": "test", + "name": "macos-debug" + } + ] + }, { "name": "ci-macos-13", - "displayName": "MacOS CI Workflow", + "displayName": "[Release] MacOS", "description": "CI workflow preset for MacOS", "steps": [ { "type": "configure", - "name": "macos-release" + "name": "macos" }, { "type": "build", diff --git a/tests/dCommonTests/AMFDeserializeTests.cpp b/tests/dCommonTests/AMFDeserializeTests.cpp index c949ae50..fb9e5a4f 100644 --- a/tests/dCommonTests/AMFDeserializeTests.cpp +++ b/tests/dCommonTests/AMFDeserializeTests.cpp @@ -176,7 +176,7 @@ TEST(dCommonTests, AMFDeserializeAMFArrayTest) { /** * @brief This test checks that if we recieve an unimplemented eAmf * we correctly throw an error and can actch it. - * Yes this leaks memory. + * Yes this leaks memory. */ TEST(dCommonTests, AMFDeserializeUnimplementedValuesTest) { std::vector unimplementedValues = { @@ -363,7 +363,7 @@ TEST(dCommonTests, AMFBadConversionTest) { ASSERT_EQ(result->Get("BehaviorID"), nullptr); // Does not exist in the associative portion - ASSERT_EQ(result->Get("DOES_NOT_EXIST"), nullptr); + ASSERT_EQ(result->Get("DOES_NOT_EXIST"), nullptr); result->Push(true); diff --git a/tests/dCommonTests/Amf3Tests.cpp b/tests/dCommonTests/Amf3Tests.cpp index 5b52cf27..79d0d496 100644 --- a/tests/dCommonTests/Amf3Tests.cpp +++ b/tests/dCommonTests/Amf3Tests.cpp @@ -78,7 +78,7 @@ TEST(dCommonTests, AMF3InsertionAssociativeTest) { ASSERT_EQ(array.Get("Integer")->GetValueType(), eAmf::Integer); ASSERT_EQ(array.Get("Double")->GetValueType(), eAmf::Double); ASSERT_EQ(array.GetArray("Array")->GetValueType(), eAmf::Array); - ASSERT_EQ(array.Get("Null")->GetValueType(), eAmf::Null); + ASSERT_EQ(array.Get("Null")->GetValueType(), eAmf::Null); ASSERT_EQ(array.Get>("Undefined")->GetValueType(), eAmf::Undefined); } @@ -101,6 +101,6 @@ TEST(dCommonTests, AMF3InsertionDenseTest) { ASSERT_EQ(array.Get(4)->GetValueType(), eAmf::Integer); ASSERT_EQ(array.Get(5)->GetValueType(), eAmf::Double); ASSERT_EQ(array.GetArray(6)->GetValueType(), eAmf::Array); - ASSERT_EQ(array.Get(7)->GetValueType(), eAmf::Null); + ASSERT_EQ(array.Get(7)->GetValueType(), eAmf::Null); ASSERT_EQ(array.Get>(8)->GetValueType(), eAmf::Undefined); }