Other Parts Discussed in Thread: TEST2,
Tool/software: Code Composer Studio
We have a number of legacy automated test scripts that were written in gel.
I am able to run the test inside of Code Composer Studio 7.0 via the GEL Files window, Load GEL, and Run. The test script executes to completion, I see passing results, and a results file is generated.
Because we have many of these, we were looking for a way to batch these test scripts. This lead us to look at the Debug Server Scripting interface.
As a proof of concept, I made a small wrapper script to launch the GEL script that already exists:
//****************************************************************************
//** Load environment
//****************************************************************************
importPackage(Packages.com.ti.debug.engine.scripting)
importPackage(Packages.com.ti.ccstudio.scripting.environment)
importPackage(Packages.java.lang)
// Create our scripting environment object - which is the main entry point into any script and
var script = ScriptingEnvironment.instance()
// Get the Debug Server and start a Debug Session
debugServer = script.getServer("DebugServer.1")
debugServer.setConfig("C:\\workspace\\project\\TMS320F28335.ccxml")
debugSession = debugServer.openSession("*", "*")
debugSession.target.connect()
debugSession.memory.loadProgram("C:\\workspace\\project\\Debug\\project.out")
debugSession.expression.evaluate('GEL_LoadGel("C:/DSP/test.gel")')
debugSession.expression.evaluate('RunTest()')
If I launch this via the "Scripting Console", everything works as expected and the test executes, passes, and generates its result file.
I was able to expand this further, to include multiple tests (test2.gel, test3.gel, etc.).
The next obvious step, then, would be the ability to launch the testing session directly from command line without bringing up the GUI at all. I searched around and thought I had found what I needed:
eclipsec.exe -noSplash -data C:\\workspace -application com.ti.ccstudio.apps.runScript -ccs.script C:/DSP/batch.js
Unfortunately, this only mostly works. I can see the test execute through most of the initialization sequences, I can see a breakpoint get hit, I can see values being checked, but the test does not finish; however, the debug session does end, returning access back to the command prompt.
What ends up happening is something like:
Actual = 0 (PWM1 TBPRD) Expected = 0 (PWM1 TBPRD) Result : ****** TEST PASSED ******
Actual = 0 (PWM2 TBPRD) Expected = 0 (PWM2 TBPRD) Result : ****** TEST PASSED ******
Actual = 0 (PWM3 TBPRD) Expected = 0 (PWM3 TBPRD) Result : ****** TEST PASSED ******
Actual = 1250 (PWM1 TBPRD)
In the data set above, the last set of data (Actual = 1250) is missing an Expected check and the Pass/Fail determination.
If I turn on GEL_Trace(2), I can see it walking through the various helper functions, ultimately ending at one of the many GEL_System() function calls to help pipe data to log files (due to a bug encountered with Code Composer Studio 6.0 and GEL_EnableFileOutput() not working).
It appears there is some sort of issue/limiting factor, where after so many calls to GEL_System(), execution simply stops without any debug/error information of any kind.
It appears the GEL_EnableFileOutput() bug is corrected in Code Composer Studio 7.0; however, we'd like to avoid changing our large set of automated tests as much as possible.
Has anyone else experienced this? Has anyone identified any workaround?
Edit: After running through a few more tests, with the GEL_System() calls removed, I was able to consistently get them to run to completion - so it appears to definitely be related.
With that said, I did encounter a secondary issue. It appears that the execution of tests is not exactly identical between when it runs inside of Code Composer Studio and when it runs from the eclipsec.exe command line options to launch the ccs.script.
It acts as if the initial variable values are not the same as when the build is loaded through Code Composer Studio itself. Are there specific configuration options that need to be changed to make the two run configurations be the same?
Edit 2: After running one of our longer tests, even with GEL_System() calls removed and replaced with GEL_TextOut(), the script eventually silently terminates.
