Running XJEase projects

XJEase projects (with an .xjd extension) can be run directly or from within an XJPack file. To run from an XJPack file, an XJRunner licence is required. To run an un-packed project, an XJEase licence is required in addition, i.e. a development system.

By default, XJRun will look for a function called CircuitTest and run that, returning its result if any as the program's exit code. However, most XJTAG projects define their tests in a test list, so XJRun also has a -testlist switch, which will run the tests in the same way as XJRunner does.

Exit code

The exit code of the process is set depending on how the XJEase code that was run exited.

If the code was terminated with a call to EXIT then the exit code is set to 1.

When the -testlist argument is given, the exit code of the process is the number of tests that have failed.

If you're running the CircuitTest function and it has a return value then the value of that variable is returned as the exit code. Otherwise, zero is returned. Note that Windows exit codes are 8 bits only, and so any value returned from CircuitTest greater than 255 will be truncated to 8 bits.

The exit code can be captured inside a batch file or in a Windows command prompt by examining the %ERRORLEVEL% variable. In PowerShell, it is accessed using the $LASTEXITCODE variable.

Example

Run the default tests in the packed XJDemo v4 project:

xjrun -testlist "\Demo Board v4\XJDemo4.xjp"

Output:

Selecting profile 'XJLink only'...
Testing U11 ADC Voltages...
Testing I2C interface of U11...
        Device successfully acknowledged I2C address 0x90
Testing channel 0...
        Net (+3V3_MCU_SENSE): Read 2235 mV (scaled to 3224 mV)
Testing channel 1...
        Net (+1V8_CPLD_SENSE): Read 1803 mV
Testing channel 2...
        Net (+3V3_CPLD_SENSE): Read 2235 mV (scaled to 3224 mV)
PowerRailCheck passed - ran in profile XJLink only

Entering New Serial Number...
Reading existing serial number from I2C EEPROM U5 via PIO...
        Read SN: 654321

Serial Number
Please enter board serial number:               (min 1, max 7 characters) 654321
System serial number set as SN: 654321
NEW_SERIAL_NUMBER passed - ran in profile XJLink only
Serial number set to 654321 by the test system

Selecting profile 'All chains'...
Checking the integrity of the JTAG chain.
CheckChain passed - ran in profile All chains

Performing standard Connection Test...
...
...