Version: 1.0.4
A .NET global tool for triggering PlcTestSuite test execution from the command line via the TwinCAT ADS protocol.
Prerequisites: .NET 8.0+ Runtime, TwinCAT 3 with ADS, PlcTestSuite >= 1.1.1
Install:
dotnet tool install --global PlcTestSuite_Cli --version 1.0.4 --add-source "<path-to-nupkg-folder>"Verify:
testsuite help# Run all tests in a suite
testsuite run <TestSuiteName> [Port]
# Run a single test
testsuite rerun <TestSuiteName> <TestName> [Port]Examples:
testsuite run GlobalTestSuite.TestSuite
testsuite run GlobalTestSuite.TestSuite 852
testsuite rerun GlobalTestSuite.TestSuite MAIN.Test_Counter_AddTwoParameters:
TestSuiteName: Fully qualified PLC test suite object (e.g.,GlobalTestSuite.TestSuite)TestName: Fully qualified test name (e.g.,MAIN.Test_Counter_AddTwo)Port: ADS port (default: 851)
Manage connection settings for local or remote PLCs. Config stored in ~/.testsuite/config.json.
# Show current configuration
testsuite config show
# Set custom AmsNetId for remote PLC
testsuite config set-amsnetid <AmsNetId>
# Reset to local (default)
testsuite config resetExample:
testsuite config set-amsnetid 192.168.1.100.1.1
testsuite run GlobalTestSuite.TestSuite # Uses configured AmsNetId
testsuite config reset # Back to AmsNetId.LocalCommunicates with TwinCAT via ADS protocol, invoking RPC methods on PlcTestSuite objects:
run→ callsReRunTests()rerun→ callsReRunIndividualTest(string testId)
Connection: Defaults to AmsNetId.Local. Configure custom AmsNetId via config command for remote PLCs.
Test Results: PlcTestSuite exports JUnit XML to C:\ProgramData\Beckhoff\TwinCAT\3.1\Boot\TEST_Result.xml
Requirements:
- PlcTestSuite >= 1.1.1 library in PLC project
- Test suite object exposing
ReRunTests()andReRunIndividualTest(string)methods - TwinCAT runtime running and accessible via ADS
Connection Failed:
- Verify TwinCAT runtime is running
- Check ADS port is correct (default: 851)
- Verify test suite object name is correct
- For remote: verify AmsNetId with
testsuite config show, check routing and firewall (port 48898)
Method Invocation Failed:
- Ensure PlcTestSuite >= 1.1.1
- Verify test suite/test names are correct
Exit Codes: 0 = Success, 1 = Error
Local Testing:
testsuite run GlobalTestSuite.TestSuite
testsuite rerun GlobalTestSuite.TestSuite MAIN.Test_FailedTestRemote PLC:
testsuite config set-amsnetid 192.168.1.100.1.1
testsuite run GlobalTestSuite.TestSuite
testsuite config resetUninstall:
dotnet tool uninstall --global PlcTestSuite_Cli- PlcTestSuite - Unit testing framework for TwinCAT 3
MIT