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

Add --notgame arg that omits -game flag in runAutomationCommands #23

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ Resources:

## Legal

Copyright © 2017-2018, Adam Rehn. Licensed under the MIT License, see the file [LICENSE](https://github.com/adamrehn/ue4cli/blob/master/LICENSE) for details.
Copyright © 2017-2018, Adam Rehn. Licensed under the MIT License, see the file [LICENSE](https://github.com/adamrehn/ue4cli/blob/master/LICENSE) for details.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

setup(
name='ue4cli',
version='0.0.49',
version='0.0.51',
description='Command-line interface for Unreal Engine 4',
long_description=__readme__,
long_description_content_type='text/markdown',
Expand Down
16 changes: 12 additions & 4 deletions ue4cli/UnrealManagerBase.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ def setEngineRootOverride(self, rootDir):
"""

# Set the new root directory
ConfigurationManager.setConfigKey('rootDirOverride', os.path.abspath(rootDir))
rootDir = os.path.abspath(rootDir)
ConfigurationManager.setConfigKey('rootDirOverride', rootDir)
print('Set engine root path override: {}'.format(rootDir))

# Check that the specified directory is valid and warn the user if it is not
try:
Expand Down Expand Up @@ -451,7 +453,7 @@ def packageDescriptor(self, dir=os.getcwd(), args=[]):
else:
self.packagePlugin(dir, args)

def runAutomationCommands(self, projectFile, commands, extraArgs, capture=False, enableRHI=False):
def runAutomationCommands(self, projectFile, commands, extraArgs, capture=False, enableRHI=False, disableGameArg=False):
'''
Invokes the Automation Test commandlet for the specified project with the supplied automation test commands
'''
Expand All @@ -467,7 +469,9 @@ def runAutomationCommands(self, projectFile, commands, extraArgs, capture=False,
# preventing them from executing correctly.

command = '{} {}'.format(Utility.escapePathForShell(self.getEditorBinary(True)), Utility.escapePathForShell(projectFile))
command += ' -game -buildmachine -stdout -fullstdoutlogoutput -forcelogflush -unattended -nopause -nosplash'
if disableGameArg == False:
command += ' -game'
command += ' -buildmachine -stdout -fullstdoutlogoutput -forcelogflush -unattended -nopause -nosplash'
if enableRHI == False:
command += ' -nullrhi'
command += ' -ExecCmds="automation {};quit" '.format(';'.join(commands))
Expand Down Expand Up @@ -510,6 +514,10 @@ def automationTests(self, dir=os.getcwd(), args=[]):
enableRHI = len(Utility.findArgs(args, ['--withrhi'])) > 0
args = Utility.stripArgs(args, ['--withrhi'])

# Determine if tests should be run as a game
disableGameArg = len(Utility.findArgs(args, ['--notgame'])) > 0
args = Utility.stripArgs(args, ['--notgame'])

# Verify that at least one argument was supplied
if len(args) == 0:
raise RuntimeError('at least one test name must be specified')
Expand Down Expand Up @@ -552,7 +560,7 @@ def automationTests(self, dir=os.getcwd(), args=[]):

# Attempt to run the automation tests
Utility.printStderr('Running automation tests...')
logOutput = self.runAutomationCommands(projectFile, command, extraArgs, capture=True, enableRHI=enableRHI)
logOutput = self.runAutomationCommands(projectFile, command, extraArgs, capture=True, enableRHI=enableRHI, disableGameArg=disableGameArg)

# Propagate the log output
print(logOutput.stdout)
Expand Down