Skip to content
Open
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
28 changes: 14 additions & 14 deletions goldenmaster/Plugins/buildPlugins.bat
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ if exist "%ApiGearTarget_path%\" (
)

@REM Build ApiGear plugin
call :buildUEplugin "%script_path%\ApiGear\ApiGear.uplugin" , "%script_path%build\ApiGear"
call :buildUEplugin "%script_path%\ApiGear\ApiGear.uplugin" "%script_path%build\ApiGear"
if !buildresult! GEQ 1 call :cleanup !buildresult!
if !buildresult! GEQ 1 exit /b !buildresult!

Expand All @@ -52,42 +52,42 @@ if %ERRORLEVEL% GEQ 1 call :cleanup %ERRORLEVEL%
if %ERRORLEVEL% GEQ 1 exit /b %ERRORLEVEL%

@REM Building and testing Testbed2 module
call :buildUEplugin "%script_path%\Testbed2\Testbed2.uplugin" , "%script_path%build\Testbed2"
call :buildUEplugin "%script_path%\Testbed2\Testbed2.uplugin" "%script_path%build\Testbed2"
if !buildresult! GEQ 1 call :cleanup !buildresult!
if !buildresult! GEQ 1 exit /b !buildresult!

@REM Building and testing TbEnum module
call :buildUEplugin "%script_path%\TbEnum\TbEnum.uplugin" , "%script_path%build\TbEnum"
call :buildUEplugin "%script_path%\TbEnum\TbEnum.uplugin" "%script_path%build\TbEnum"
if !buildresult! GEQ 1 call :cleanup !buildresult!
if !buildresult! GEQ 1 exit /b !buildresult!

@REM Building and testing TbSame1 module
call :buildUEplugin "%script_path%\TbSame1\TbSame1.uplugin" , "%script_path%build\TbSame1"
call :buildUEplugin "%script_path%\TbSame1\TbSame1.uplugin" "%script_path%build\TbSame1"
if !buildresult! GEQ 1 call :cleanup !buildresult!
if !buildresult! GEQ 1 exit /b !buildresult!

@REM Building and testing TbSame2 module
call :buildUEplugin "%script_path%\TbSame2\TbSame2.uplugin" , "%script_path%build\TbSame2"
call :buildUEplugin "%script_path%\TbSame2\TbSame2.uplugin" "%script_path%build\TbSame2"
if !buildresult! GEQ 1 call :cleanup !buildresult!
if !buildresult! GEQ 1 exit /b !buildresult!

@REM Building and testing TbSimple module
call :buildUEplugin "%script_path%\TbSimple\TbSimple.uplugin" , "%script_path%build\TbSimple"
call :buildUEplugin "%script_path%\TbSimple\TbSimple.uplugin" "%script_path%build\TbSimple"
if !buildresult! GEQ 1 call :cleanup !buildresult!
if !buildresult! GEQ 1 exit /b !buildresult!

@REM Building and testing Testbed1 module
call :buildUEplugin "%script_path%\Testbed1\Testbed1.uplugin" , "%script_path%build\Testbed1"
call :buildUEplugin "%script_path%\Testbed1\Testbed1.uplugin" "%script_path%build\Testbed1"
if !buildresult! GEQ 1 call :cleanup !buildresult!
if !buildresult! GEQ 1 exit /b !buildresult!

@REM Building and testing TbNames module
call :buildUEplugin "%script_path%\TbNames\TbNames.uplugin" , "%script_path%build\TbNames"
call :buildUEplugin "%script_path%\TbNames\TbNames.uplugin" "%script_path%build\TbNames"
if !buildresult! GEQ 1 call :cleanup !buildresult!
if !buildresult! GEQ 1 exit /b !buildresult!

@REM Building and testing CustomTypes module
call :buildUEplugin "%script_path%\CustomTypes\CustomTypes.uplugin" , "%script_path%build\CustomTypes"
call :buildUEplugin "%script_path%\CustomTypes\CustomTypes.uplugin" "%script_path%build\CustomTypes"
if !buildresult! GEQ 1 call :cleanup !buildresult!
if !buildresult! GEQ 1 exit /b !buildresult!

Expand All @@ -98,7 +98,7 @@ if %ERRORLEVEL% GEQ 1 call :cleanup %ERRORLEVEL%
if %ERRORLEVEL% GEQ 1 exit /b %ERRORLEVEL%

@REM Building and testing ExternTypes module
call :buildUEplugin "%script_path%\ExternTypes\ExternTypes.uplugin" , "%script_path%build\ExternTypes"
call :buildUEplugin "%script_path%\ExternTypes\ExternTypes.uplugin" "%script_path%build\ExternTypes"
if !buildresult! GEQ 1 call :cleanup !buildresult!
if !buildresult! GEQ 1 exit /b !buildresult!

Expand All @@ -109,12 +109,12 @@ if %ERRORLEVEL% GEQ 1 call :cleanup %ERRORLEVEL%
if %ERRORLEVEL% GEQ 1 exit /b %ERRORLEVEL%

@REM Building and testing Counter module
call :buildUEplugin "%script_path%\Counter\Counter.uplugin" , "%script_path%build\Counter"
call :buildUEplugin "%script_path%\Counter\Counter.uplugin" "%script_path%build\Counter"
if !buildresult! GEQ 1 call :cleanup !buildresult!
if !buildresult! GEQ 1 exit /b !buildresult!

@REM Building and testing TbIfaceimport module
call :buildUEplugin "%script_path%\TbIfaceimport\TbIfaceimport.uplugin" , "%script_path%build\TbIfaceimport"
call :buildUEplugin "%script_path%\TbIfaceimport\TbIfaceimport.uplugin" "%script_path%build\TbIfaceimport"
if !buildresult! GEQ 1 call :cleanup !buildresult!
if !buildresult! GEQ 1 exit /b !buildresult!

Expand All @@ -125,7 +125,7 @@ if %ERRORLEVEL% GEQ 1 call :cleanup %ERRORLEVEL%
if %ERRORLEVEL% GEQ 1 exit /b %ERRORLEVEL%

@REM Building and testing TbRefIfaces module
call :buildUEplugin "%script_path%\TbRefIfaces\TbRefIfaces.uplugin" , "%script_path%build\TbRefIfaces"
call :buildUEplugin "%script_path%\TbRefIfaces\TbRefIfaces.uplugin" "%script_path%build\TbRefIfaces"
if !buildresult! GEQ 1 call :cleanup !buildresult!
if !buildresult! GEQ 1 exit /b !buildresult!

Expand All @@ -138,7 +138,7 @@ exit /b 0
@REM build UE plugin
:buildUEplugin
(
"%RunUAT_path%" BuildPlugin -verbose -Rocket -Plugin=%1 -TargetPlatforms=Win64 -StrictIncludes -Package=%2
"%RunUAT_path%" BuildPlugin -verbose -Rocket -NoEditorTelemetry -WarningsAsErrors -Plugin=%1 -TargetPlatforms=Win64 -StrictIncludes -Package=%2
set buildresult=!ERRORLEVEL!
)
exit /b %ERRORLEVEL%
Expand Down
2 changes: 1 addition & 1 deletion goldenmaster/Plugins/buildPlugins.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ fi
# build UE plugin
buildUEplugin()
{
"$RunUAT_path" BuildPlugin -verbose -Rocket -Plugin=$1 -TargetPlatforms=Linux -StrictIncludes -Package=$2
"$RunUAT_path" BuildPlugin -verbose -Rocket -NoEditorTelemetry -WarningsAsErrors -Plugin=$1 -TargetPlatforms=Linux -StrictIncludes -Package=$2
buildresult=$?
}

Expand Down
65 changes: 57 additions & 8 deletions goldenmaster/Plugins/buildTestPlugins.bat
Original file line number Diff line number Diff line change
Expand Up @@ -164,20 +164,69 @@ xcopy /E /Y "%script_path%\TbRefIfaces" "%TbRefIfacesPluginTarget_path%\" >nul
if %ERRORLEVEL% GEQ 1 exit /b %ERRORLEVEL%


@REM run build and tests
call :buildTestPlugins "%ProjectTarget_path%/TP_Blank.uproject" %script_path% ".Impl.+.OLink.+.MsgBus."
if %ERRORLEVEL% GEQ 1 exit /b %ERRORLEVEL%
if not exist %script_path%index.json (echo WARNING: no test results found) else findstr /C:"\"failed\": 0" %script_path%index.json >nul
if %ERRORLEVEL% GEQ 1 exit /b %ERRORLEVEL%
@REM Run primary tests (with ASan if enabled)
set "SANITIZER="
if defined ENABLE_ASAN (
set "SANITIZER=asan"
)

call :buildTestPlugins "%ProjectTarget_path%/TP_Blank.uproject" ".Impl.+.OLink.+.MsgBus." "%SANITIZER%" "%script_path%RunTests.log" "%script_path%"
if %ERRORLEVEL% GEQ 1 (
echo ERROR: Tests failed
exit /b %ERRORLEVEL%
)

@REM Check test results
if not exist %script_path%index.json (
echo WARNING: no test results found
) else (
findstr /C:"\"failed\": 0" %script_path%index.json >nul
if %ERRORLEVEL% GEQ 1 (
echo ERROR: Tests failed ^(check index.json^)
exit /b %ERRORLEVEL%
)
)

@REM TSan tests (opt-in with ENABLE_TSAN=1)
@REM Usage: set ENABLE_TSAN=1 && buildTestPlugins.bat
if defined ENABLE_TSAN (
call :buildTestPlugins "%ProjectTarget_path%/TP_Blank.uproject" ".Impl.+.OLink.+.MsgBus." "tsan" "%script_path%RunTests-TSan.log" "%script_path%tsan-results"
if %ERRORLEVEL% GEQ 1 (
echo ERROR: TSan tests failed ^(threading issues detected^)
exit /b %ERRORLEVEL%
)
@REM Check TSan test results
if exist %script_path%tsan-results\index.json (
findstr /C:"\"failed\": 0" %script_path%tsan-results\index.json >nul
if %ERRORLEVEL% GEQ 1 (
echo ERROR: TSan tests failed ^(check tsan-results\index.json^)
exit /b %ERRORLEVEL%
)
)
)
exit /b 0

@REM function implementations

@REM build UE plugin
@REM Run tests with optional sanitizer
@REM Args: project tests sanitizer log_file report_path
:buildTestPlugins
(
set "sanitizer=%~3"
set "log_file=%~4"
set "report_path=%~5"
set "SANITIZER_FLAGS="

echo === Running Tests ===
if "%sanitizer%"=="asan" (
echo Enabled: ASan + UBSan
set "SANITIZER_FLAGS=-EnableASan -EnableUndefinedBehaviorSanitizer"
) else if "%sanitizer%"=="tsan" (
echo Enabled: TSan
set "SANITIZER_FLAGS=-EnableThreadSanitizer"
)

@REM do not use -unattended as this seems to cause some issue when exiting the editor after test run
"%RunUAT_path%" BuildCookRun -installed -project="%1" -run -RunAutomationTest="%3" -nullrhi -NoP4 -build -verbose -nodebuginfo -log="%2/RunTests.log" -addcmdline="-ReportExportPath=%2 " -Configuration=Test -notools -utf8output
set buildresult=!ERRORLEVEL!
"%RunUAT_path%" BuildCookRun -installed !SANITIZER_FLAGS! -project="%~1" -run -RunAutomationTest="%~2" -nullrhi -NoP4 -build -verbose -WarningsAsErrors -nodebuginfo -NoEditorTelemetry -log="!log_file!" -addcmdline="-ReportExportPath=!report_path!" -Configuration=Test -notools -utf8output
)
exit /b %ERRORLEVEL%
81 changes: 75 additions & 6 deletions goldenmaster/Plugins/buildTestPlugins.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,33 @@ if [ $? -ne 0 ]; then exit 1; fi;
# function implementations
#

# build and test plugins
# Run tests with optional sanitizer
# Args: project tests sanitizer log_file report_path
buildTestPlugins()
{
local project=$1
local tests=$2
local sanitizer=$3
local log_file=$4
local report_path=$5

local SANITIZER_FLAGS=""

echo "=== Running Tests ==="
case "$sanitizer" in
asan)
echo "Enabled: ASan + UBSan"
SANITIZER_FLAGS="-EnableASan -EnableUndefinedBehaviorSanitizer"
;;
tsan)
echo "Enabled: TSan"
SANITIZER_FLAGS="-EnableThreadSanitizer"
;;
esac

# do not use -unattended as this seems to cause some issue when exiting the editor after test run
"$RunUAT_path" BuildCookRun -installed -project="$1" -run -RunAutomationTest="$3" -nullrhi -NoP4 -build -verbose -nodebuginfo -log="$2/RunTests.log" -addcmdline="-ReportExportPath=$2 " -Configuration=Test -notools -utf8output
buildresult=$?
"$RunUAT_path" BuildCookRun -installed $SANITIZER_FLAGS -project="$project" -run -RunAutomationTest="$tests" -nullrhi -NoP4 -build -verbose -WarningsAsErrors -nodebuginfo -NoEditorTelemetry -log="$log_file" -addcmdline="-ReportExportPath=$report_path" -Configuration=Test -notools -utf8output
return $?
}

#
Expand Down Expand Up @@ -121,6 +142,54 @@ mkdir -p "$ProjectTarget_path/Plugins/TbRefIfaces" && cp -rf "$script_path/TbRef
if [ $? -ne 0 ]; then exit 1; fi;


buildTestPlugins "$ProjectTarget_path/TP_Blank.uproject" "$script_path" ".Impl.+.OLink.+.MsgBus."
if [ $buildresult -ne 0 ]; then exit 1; fi;
if [ ! -f $script_path/index.json ]; then echo "WARNING: no test results found"; else grep '"failed": 0' $script_path/index.json > /dev/null; fi
# Run primary tests (with ASan if enabled)
SANITIZER=""
if [ ! -z "$ENABLE_ASAN" ]; then
SANITIZER="asan"
fi

buildTestPlugins "$ProjectTarget_path/TP_Blank.uproject" \
".Impl.+.OLink.+.MsgBus." \
"$SANITIZER" \
"$script_path/RunTests.log" \
"$script_path"

if [ $? -ne 0 ]; then
echo "ERROR: Tests failed"
exit 1
fi

# Check test results
if [ ! -f "$script_path/index.json" ]; then
echo "WARNING: no test results found"
else
grep '"failed": 0' "$script_path/index.json" > /dev/null
if [ $? -ne 0 ]; then
echo "ERROR: Tests failed (check index.json)"
exit 1
fi
fi

# TSan tests (opt-in with ENABLE_TSAN=1)
# Usage: ENABLE_TSAN=1 ./buildTestPlugins.sh
if [ ! -z "$ENABLE_TSAN" ]; then
buildTestPlugins "$ProjectTarget_path/TP_Blank.uproject" \
".Impl.+.OLink.+.MsgBus." \
"tsan" \
"$script_path/RunTests-TSan.log" \
"$script_path/tsan-results"

if [ $? -ne 0 ]; then
echo "ERROR: TSan tests failed (threading issues detected)"
exit 1
fi

# Check TSan test results
if [ -f "$script_path/tsan-results/index.json" ]; then
grep '"failed": 0' "$script_path/tsan-results/index.json" > /dev/null
if [ $? -ne 0 ]; then
echo "ERROR: TSan tests failed (check tsan-results/index.json)"
exit 1
fi
fi
fi
6 changes: 3 additions & 3 deletions templates/buildPlugins.bat.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ if exist "%ApiGearTarget_path%\" (

{{ if .Features.apigear -}}
@REM Build ApiGear plugin
call :buildUEplugin "%script_path%\ApiGear\ApiGear.uplugin" , "%script_path%build\ApiGear"
call :buildUEplugin "%script_path%\ApiGear\ApiGear.uplugin" "%script_path%build\ApiGear"
if !buildresult! GEQ 1 call :cleanup !buildresult!
if !buildresult! GEQ 1 exit /b !buildresult!

Expand All @@ -60,7 +60,7 @@ if %ERRORLEVEL% GEQ 1 exit /b %ERRORLEVEL%
{{- end }}
{{ range .System.Modules}}
@REM Building and testing {{Camel .Name}} module
call :buildUEplugin "%script_path%\{{Camel .Name}}\{{Camel .Name}}.uplugin" , "%script_path%build\{{Camel .Name}}"
call :buildUEplugin "%script_path%\{{Camel .Name}}\{{Camel .Name}}.uplugin" "%script_path%build\{{Camel .Name}}"
if !buildresult! GEQ 1 call :cleanup !buildresult!
if !buildresult! GEQ 1 exit /b !buildresult!

Expand All @@ -82,7 +82,7 @@ exit /b 0
@REM build UE plugin
:buildUEplugin
(
"%RunUAT_path%" BuildPlugin -verbose -Rocket -Plugin=%1 -TargetPlatforms=Win64 -StrictIncludes -Package=%2
"%RunUAT_path%" BuildPlugin -verbose -Rocket -NoEditorTelemetry -WarningsAsErrors -Plugin=%1 -TargetPlatforms=Win64 -StrictIncludes -Package=%2
set buildresult=!ERRORLEVEL!
)
exit /b %ERRORLEVEL%
Expand Down
2 changes: 1 addition & 1 deletion templates/buildPlugins.sh.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ fi
# build UE plugin
buildUEplugin()
{
"$RunUAT_path" BuildPlugin -verbose -Rocket -Plugin=$1 -TargetPlatforms=Linux -StrictIncludes -Package=$2
"$RunUAT_path" BuildPlugin -verbose -Rocket -NoEditorTelemetry -WarningsAsErrors -Plugin=$1 -TargetPlatforms=Linux -StrictIncludes -Package=$2
buildresult=$?
}

Expand Down
65 changes: 57 additions & 8 deletions templates/buildTestPlugins.bat.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -73,20 +73,69 @@ xcopy /E /Y "%script_path%\{{ Camel .Name}}" "%{{ Camel .Name}}PluginTarget_path
if %ERRORLEVEL% GEQ 1 exit /b %ERRORLEVEL%
{{ end }}

@REM run build and tests
call :buildTestPlugins "%ProjectTarget_path%/TP_Blank.uproject" %script_path% ".Impl.{{ if .Features.olink_tests -}}+.OLink.{{ end }}{{ if .Features.msgbus_tests -}}+.MsgBus.{{ end }}"
if %ERRORLEVEL% GEQ 1 exit /b %ERRORLEVEL%
if not exist %script_path%index.json (echo WARNING: no test results found) else findstr /C:"\"failed\": 0" %script_path%index.json >nul
if %ERRORLEVEL% GEQ 1 exit /b %ERRORLEVEL%
@REM Run primary tests (with ASan if enabled)
set "SANITIZER="
if defined ENABLE_ASAN (
set "SANITIZER=asan"
)

call :buildTestPlugins "%ProjectTarget_path%/TP_Blank.uproject" ".Impl.{{ if .Features.olink_tests -}}+.OLink.{{ end }}{{ if .Features.msgbus_tests -}}+.MsgBus.{{ end }}" "%SANITIZER%" "%script_path%RunTests.log" "%script_path%"
if %ERRORLEVEL% GEQ 1 (
echo ERROR: Tests failed
exit /b %ERRORLEVEL%
)

@REM Check test results
if not exist %script_path%index.json (
echo WARNING: no test results found
) else (
findstr /C:"\"failed\": 0" %script_path%index.json >nul
if %ERRORLEVEL% GEQ 1 (
echo ERROR: Tests failed ^(check index.json^)
exit /b %ERRORLEVEL%
)
)

@REM TSan tests (opt-in with ENABLE_TSAN=1)
@REM Usage: set ENABLE_TSAN=1 && buildTestPlugins.bat
if defined ENABLE_TSAN (
call :buildTestPlugins "%ProjectTarget_path%/TP_Blank.uproject" ".Impl.{{ if .Features.olink_tests -}}+.OLink.{{ end }}{{ if .Features.msgbus_tests -}}+.MsgBus.{{ end }}" "tsan" "%script_path%RunTests-TSan.log" "%script_path%tsan-results"
if %ERRORLEVEL% GEQ 1 (
echo ERROR: TSan tests failed ^(threading issues detected^)
exit /b %ERRORLEVEL%
)
@REM Check TSan test results
if exist %script_path%tsan-results\index.json (
findstr /C:"\"failed\": 0" %script_path%tsan-results\index.json >nul
if %ERRORLEVEL% GEQ 1 (
echo ERROR: TSan tests failed ^(check tsan-results\index.json^)
exit /b %ERRORLEVEL%
)
)
)
exit /b 0

@REM function implementations

@REM build UE plugin
@REM Run tests with optional sanitizer
@REM Args: project tests sanitizer log_file report_path
:buildTestPlugins
(
set "sanitizer=%~3"
set "log_file=%~4"
set "report_path=%~5"
set "SANITIZER_FLAGS="

echo === Running Tests ===
if "%sanitizer%"=="asan" (
echo Enabled: ASan + UBSan
set "SANITIZER_FLAGS=-EnableASan -EnableUndefinedBehaviorSanitizer"
) else if "%sanitizer%"=="tsan" (
echo Enabled: TSan
set "SANITIZER_FLAGS=-EnableThreadSanitizer"
)

@REM do not use -unattended as this seems to cause some issue when exiting the editor after test run
"%RunUAT_path%" BuildCookRun -installed -project="%1" -run -RunAutomationTest="%3" -nullrhi -NoP4 -build -verbose -nodebuginfo -log="%2/RunTests.log" -addcmdline="-ReportExportPath=%2 " -Configuration=Test -notools -utf8output
set buildresult=!ERRORLEVEL!
"%RunUAT_path%" BuildCookRun -installed !SANITIZER_FLAGS! -project="%~1" -run -RunAutomationTest="%~2" -nullrhi -NoP4 -build -verbose -WarningsAsErrors -nodebuginfo -NoEditorTelemetry -log="!log_file!" -addcmdline="-ReportExportPath=!report_path!" -Configuration=Test -notools -utf8output
)
exit /b %ERRORLEVEL%
Loading
Loading