AutomationConnectIQ-Sample12

Automation Connect IQ SDK

Explanation about what was added in Ver0.3.

Unit Test, Connect IQ runs what is called “Run No Evil”.

using namespace AutomationConnectIQ.Lib;
$sdk = New-Object GarminSDK -Property @{
	Key = "developer_key"
}
$proj = New-Object Jungle("monkey.jungle")
$sim = New-Object Simulator($sdk)
$sim.WaitForInput()

$deviceName = "fr45"

# Run UnitTest (use GarminSDK methods)
$sdk.BuildProgram($proj, $deviceName, $proj.DefaultProgramPath, $true)
$sdk.StartProgram($proj.DefaultProgramPath, $deviceName, $true)

remove-variable sdk
remove-variable proj
Remove-Variable deviceName

$check = New-Object Checker -Property @{
	Key = "developer_key"
	Project = "monkey.jungle"
}
# Run UnitTest (use Checker method)
$check.UnitTest($check.Devices[0])
remove-variable check
  • Lines 12-13: Using GarminSDK methods
    The last argument of the method with the program name of BuildProgram and StartProgram specifies whether it is for Unit Test.
    Since false is specified as the default argument, if the final argument is omitted, the program will be built normally and started in the simulator.
  • Line 24: Added new Checker.UnitTest method.
    By entering the device name, it is possible to perform Unit Test on that device.
    At the same time, the Checker.Devices attribute is prepared so that the information of the device name that can be executed in the project can be retrieved.
    This gives the same output as Jungle.Devices.
    On the Eclipse side, the default is to perform Unit Test on all devices. Is it necessary? I think that it is a method specified by the device.
    If necessary, I think that Checker.Devices can be turned on Foreach.

The result of the execution looks like this.


On the Eclipse side, PASS / FAIL is displayed in color, but since it is a text output, the one executed by PowerShell is not colored.

コメント

タイトルとURLをコピーしました