Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@
#include "Tests/TestCounter.h"
#include "Tests/CommonTestFunctions.h"

#ifdef Nil
#define SPACETIMEDB_NIL_MACRO_SAVED
#pragma push_macro("Nil")
#undef Nil
#endif

/* Implementation for every primitive ---------------------------------- */
#define DEFINE_UFUNC(Suffix, Expected, RowStructType) \
void UInsertPrimitiveHandler::OnInsertOne##Suffix(const FEventContext& Context, const RowStructType& Value) \
Expand Down Expand Up @@ -1712,3 +1718,7 @@ void UUuidActionsHandler::OnInsertCallUuidV7(const FEventContext& Context, const
Counter->MarkFailure(TEXT("InsertCallUuidV7"), ErrorMessage);
}
}
#ifdef SPACETIMEDB_NIL_MACRO_SAVED
#pragma pop_macro("Nil")
#undef SPACETIMEDB_NIL_MACRO_SAVED
#endif
36 changes: 34 additions & 2 deletions sdks/unreal/tests/sdk_unreal_harness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,34 @@ fn normalize_path(path: PathBuf) -> String {
path.display().to_string().replace('\\', "/")
}

fn env_override_path(var: &str) -> Option<String> {
env::var(var)
.ok()
.filter(|value| !value.trim().is_empty())
.map(|value| value.replace('\\', "/"))
}

fn host_unreal_platform() -> &'static str {
if cfg!(target_os = "windows") {
"Win64"
} else if cfg!(target_os = "macos") {
"Mac"
} else {
"Linux"
}
}

/// Returns full path to Unreal Editor executable
fn ue_editor_exe() -> String {
if let Some(path) = env_override_path("UE_EDITOR_PATH") {
return path;
}

let root = ue_root();
let path = if cfg!(target_os = "windows") {
root.join("Engine/Binaries/Win64/UnrealEditor.exe")
} else if cfg!(target_os = "macos") {
root.join("Engine/Binaries/Mac/UnrealEditor.app/Contents/MacOS/UnrealEditor")
} else {
root.join("Engine/Binaries/Linux/UnrealEditor")
};
Expand All @@ -36,9 +59,15 @@ fn ue_editor_exe() -> String {

/// Returns full path to Unreal Build script (Build.bat or Build.sh)
fn ue_build_script() -> String {
if let Some(path) = env_override_path("UE_BUILD_SCRIPT_PATH") {
return path;
}

let root = ue_root();
let path = if cfg!(target_os = "windows") {
root.join("Engine/Build/BatchFiles/Build.bat")
} else if cfg!(target_os = "macos") {
root.join("Engine/Build/BatchFiles/Mac/Build.sh")
} else {
root.join("Engine/Build/BatchFiles/Linux/Build.sh")
};
Expand Down Expand Up @@ -78,8 +107,11 @@ pub fn make_test_with_suite(suite: &TestSuite, test_name: &str) -> Test {
)
} else {
format!(
"\"{}\" {}Editor Linux Development \"{}\" -skipbuildengine",
build_script, suite.unreal_module, uproject_path
"\"{}\" {}Editor {} Development \"{}\" -skipbuildengine",
build_script,
suite.unreal_module,
host_unreal_platform(),
uproject_path
)
};

Expand Down
Loading