Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debug GauntletTestController from VisualStudio #41

Open
realfleo opened this issue Feb 22, 2023 · 1 comment
Open

Debug GauntletTestController from VisualStudio #41

realfleo opened this issue Feb 22, 2023 · 1 comment

Comments

@realfleo
Copy link

Hi great framework, many thanks.
Can you explain how to debug a GauntletTestController from VisualStudio? I want to do some modification and don't know how to attach when running from console.

Something like that, maybe?
https://docs.unrealengine.com/4.26/en-US/ProductionPipelines/BuildTools/AutomationTool/Overview/

Many thanks!

@PanPandzik
Copy link

PanPandzik commented May 5, 2023

So it's a little bit complicated. For first, sorry for my English, it's not my native language - just ask if something will be confusing.

There are two command-line arguments that let you "pause" the game on initialization: "-WaitForDebugger" and "-waitforattach". It's easy if you just run a game, because in that case you run a game with launch parameters, e.g.

MyGame.exe -waitforattach

But you have to run your game with Gauntlet via UAT, so use a command-line, like that:

"C:\Workspace\MayhemWorkspace\Engine\Build\BatchFiles\RunUAT.bat" RunUnreal -project="C:\Workspace\MayhemWorkspace\Mayhem\Mayhem.uproject" -scriptdir="C:\Workspace\MayhemWorkspace\Mayhem" -platform=Win64 -configuration=Development -WaitForDebugger -build=local -test="AnsharTests.Automation.SmokeTest"

So… if you add "-waitforattach" here, nothing will happen. I don't know why, but probably UAT doesn't pass the argument or does it but too late? I use a workaround for that, and I add this argument to the command-line in automation project script of my test (C# UnrealTestNode). In the case of the Daedalic plugin it will be DaeGauntletTest.cs in DaedalicTestAutomationPlugin.Automation project.

        public override SmokeTestConfig GetConfiguration()
        {
            SmokeTestConfig Config = base.GetConfiguration();
            UnrealTestRole ClientRole = Config.RequireRole(UnrealTargetRole.Client);

            ClientRole.CommandLine += "-waitforattach";

            return Config;
        }

So, if you did it, then you can run the game with gauntlet and attach your VS debugger to the process (Debug -> Attach to Process). If -waitforattach was passed correctly, then game window probably don't show up until you attach debugger, or it will be just black screen, so don't worry. If you still can't catch the breakpoint inside your Gauntlet Controller, for first, make sure your automation project use a right controller. Also, you can turn off "Enable Just My Code" option.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants