Until now, XJRunner tests have been limited to functions which have no input arguments and a single return argument (which returns the result). XJTAG v3.5 relaxes that restriction, allowing input in XJRunner tests, though there is still a requirement to have a single return argument for the result.
This is useful in a number of different scenarios. For example:
- You might create a general purpose flash programming function that takes the image to program as an argument; or
- You might have a function that has a parameter to switch debug output on and off. The function could be run once in the test list with no debug output and then conditionally a second time if it fails with the debug output enabled.
In order to make a function with input arguments available, the function must be explicitly defined as GLOBAL. Once the function is marked as GLOBAL it will appear in the list of functions (either via the relevant device if it’s in a device file, or the Global functions if it’s in a circuit code file) for you to select it for testing.
When you add a test with input arguments it will appear as red in the XJRunner Test list – because the parameters have not yet been defined. Double-click the test and then select the Arguments tab, which will show a list of the arguments required. The arguments can be literals (ie numbers or strings) or (think of typing a spreadsheet formula here!) you can type an ‘=’ character followed by any valid XJEase expression. If you want to enter a string starting with an ‘=’ character, enclose the string in double-quotes, e.g. “= some string”.
When you set an argument on a function a small ‘A’ icon will appear next to the function where it is shown in XJDeveloper.
In XJRunner, where the arguments cannot be edited, no icon is shown.