test fix
This commit is contained in:
1 parent
0d1da36e28
commit
2fa3df7aae
5 files changed
+25
-11
No files matched your search
@@ -38,4 +38,4 @@ playlet_lib_zip_debug_url=http://DEBUG_HOST_IP_ADDRESS:8086/playlet-lib.zip
|
|||||||
|
|
||||||
git_commit_sha=unknown
|
git_commit_sha=unknown
|
||||||
|
|
||||||
bs_const=DEBUG=false;DEBUG_FALLBACK_TO_EMBEDDED=true
|
bs_const=DEBUG=false;TEST_MODE=false;DEBUG_FALLBACK_TO_EMBEDDED=true
|
||||||
@@ -35,7 +35,14 @@ namespace Logger
|
|||||||
msg += `app_state: ${lastExitInfo.app_state}\n`
|
msg += `app_state: ${lastExitInfo.app_state}\n`
|
||||||
msg += `media_player_state: ${lastExitInfo.media_player_state}\n`
|
msg += `media_player_state: ${lastExitInfo.media_player_state}\n`
|
||||||
msg += `mem_limit: ${lastExitInfo.mem_limit}\n`
|
msg += `mem_limit: ${lastExitInfo.mem_limit}\n`
|
||||||
msg += `console_log:\n${lastExitInfo.console_log}\n`
|
|
||||||
|
' Sometimes lastExitInfo.console_log would contain 'AppExitComplete', which
|
||||||
|
' is used to detect test runner exits. So we don't log it in test mode.
|
||||||
|
#if TEST_MODE
|
||||||
|
#else
|
||||||
|
msg += `console_log:\n${lastExitInfo.console_log}\n`
|
||||||
|
#end if
|
||||||
|
|
||||||
msg += `********** End Last Exit Info **********\n`
|
msg += `********** End Last Exit Info **********\n`
|
||||||
|
|
||||||
print msg
|
print msg
|
||||||
|
|||||||
@@ -59,14 +59,19 @@ function LoggerLoop()
|
|||||||
DeleteFile(previousLogsFile)
|
DeleteFile(previousLogsFile)
|
||||||
MoveFile(logsFile, previousLogsFile)
|
MoveFile(logsFile, previousLogsFile)
|
||||||
|
|
||||||
startUpLogs = ReadAsciiFile(FILENAME_STARTUP)
|
' Sometimes lastExitInfo.console_log (which would be contained in startUpLogs)
|
||||||
if not StringUtils.IsNullOrEmpty(startUpLogs)
|
' would contain 'AppExitComplete', which is used to detect test runner exits.
|
||||||
line = `************* Startup Logs *************\n${startUpLogs}*********** End Startup Logs ***********\n`
|
' So we don't log it in test mode.
|
||||||
print line
|
#if TEST_MODE
|
||||||
buffer.FromAsciiString(line)
|
#else
|
||||||
buffer.AppendFile(logsFile)
|
startUpLogs = ReadAsciiFile(FILENAME_STARTUP)
|
||||||
end if
|
if not StringUtils.IsNullOrEmpty(startUpLogs)
|
||||||
|
line = `************* Startup Logs *************\n${startUpLogs}*********** End Startup Logs ***********\n`
|
||||||
|
print line
|
||||||
|
buffer.FromAsciiString(line)
|
||||||
|
buffer.AppendFile(logsFile)
|
||||||
|
end if
|
||||||
|
#end if
|
||||||
m.eventThrottleTimer = CreateObject("roTimespan")
|
m.eventThrottleTimer = CreateObject("roTimespan")
|
||||||
|
|
||||||
appMemoryMonitor = CreateObject("roAppMemoryMonitor")
|
appMemoryMonitor = CreateObject("roAppMemoryMonitor")
|
||||||
|
|||||||
@@ -13,4 +13,4 @@ hidden=1
|
|||||||
|
|
||||||
git_commit_sha=unknown
|
git_commit_sha=unknown
|
||||||
|
|
||||||
bs_const=DEBUG=false
|
bs_const=DEBUG=false;TEST_MODE=false
|
||||||
@@ -42,6 +42,8 @@ export class ManifestEditPlugin implements CompilerPlugin {
|
|||||||
// Test flag
|
// Test flag
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
const testMode = !!builder.options.testMode;
|
const testMode = !!builder.options.testMode;
|
||||||
|
builder.logger.log(`Setting bs_const TEST_MODE to ${testMode}`)
|
||||||
|
manifestContent = manifestContent.replace(/TEST_MODE=(true|false)/i, `TEST_MODE=${testMode}`);
|
||||||
if (testMode) {
|
if (testMode) {
|
||||||
builder.logger.log(`Commenting out "sg_component_libs_provided"`)
|
builder.logger.log(`Commenting out "sg_component_libs_provided"`)
|
||||||
manifestContent = manifestContent.replace(/sg_component_libs_provided=/i, `# sg_component_libs_provided=`);
|
manifestContent = manifestContent.replace(/sg_component_libs_provided=/i, `# sg_component_libs_provided=`);
|
||||||
|
|||||||
Reference in new issue
Block a user