-
Notifications
You must be signed in to change notification settings - Fork 1
Command line tools
STH provides a command line runner, that accepts some commands that can be run in a CI. Here is the list of all available command and options for each command accepted by the command line runner.
Command line actions should be run using Godot headless mode (no GUI), without debug option. The STH command line runner must be invoked without desired otpions. Command line should be more or less like this :
godot.exe --headless --path [PATH/TO/PROJECT/CONTAINING/STH] -s "res://addons/simple-test-harness/src/command_line/command_line_runner.gd" [STH options]
This command allows to look for test cases in specified paths, run them and generate a XUnit
compatible report. Generated report is named `report_[datetime].xml" in given output directory.
Command line arguments :
-
-lp
(--lookup-paths
) : Coma separated list of paths where to look for test cases to run, -
-o
(--output
) : Output directory, where reports will be generated.
The following command line will generate the following XUnit
report in D:/workspaces/reports.report_2023-02-19T20_05_38.xml
:
godot.exe --headless --path "d:/workspaces/my-game -s "res://addons/simple-test-harness/src/command_line/command_line_runner.gd" -lp "res://src-test" -o "D:/workspaces/reports"
<?xml version="1.0" encoding="utf-8"?>
<testsuites id="2023-02-19T20:05:38" name="report_2023-02-19T20:05:38" time="1401">
<testsuite name="sth_tcp_client_server_test" tests="5" failures="0" skipped="0" time="1395">
<testcase name="test_server_and_client_connection_and_disconnection_signals" classname="test_server_and_client_connection_and_disconnection_signals" time="207">
</testcase>
<testcase name="test_client_can_reconnect_to_server_multiple_times" classname="test_client_can_reconnect_to_server_multiple_times" time="833">
</testcase>
<testcase name="test_client_can_send_message_to_server" classname="test_client_can_send_message_to_server" time="117">
</testcase>
<testcase name="test_server_can_send_message_to_client" classname="test_server_can_send_message_to_client" time="116">
</testcase>
<testcase name="test_client_can_send_lot_of_messages_to_server_in_right_order" classname="test_client_can_send_lot_of_messages_to_server_in_right_order" time="117">
</testcase>
</testsuite>
</testsuites>