Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion docs.openc3.com/docs/tools/script-runner.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ To generate a new Suite use the File -> New Suite and then choose either Ruby or

### Group

The Group class contains the methods used to run the test or operations. Any methods starting with 'script', 'op', or 'test' which are implemented inside a Group class are automatically included as scripts to run. For example, in the above image, you'll notice the 'script_power_on' is in the Script drop down menu. Here's another simple example:
The Group class contains the methods used to run the test or operations. Any methods starting with 'script_', 'op_', or 'test_' which are implemented inside a Group class are automatically included as scripts to run. For example, in the above image, you'll notice the 'script_power_on' is in the Script drop down menu. Here's another simple example:

<Tabs groupId="script-language">
<TabItem value="python" label="Python">
Expand All @@ -142,6 +142,10 @@ class ExampleGroup(Group):
print("setup")
def script_1(self):
print("script 1")
def test_1(self):
print("test 1")
def op_1(self):
print("op 1")
def teardown(self):
print("teardown")
```
Expand All @@ -158,6 +162,12 @@ class ExampleGroup < OpenC3::Group
def script_1
puts "script 1"
end
def test_1
puts "test 1"
end
def op_1
puts "op 1"
end
def teardown
puts "teardown"
end
Expand Down
2 changes: 1 addition & 1 deletion openc3/lib/openc3/script/suite.rb
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ def self.scripts
# Find all the script methods
methods = []
self.instance_methods.each do |method_name|
if /^test|^script|op_/.match?(method_name.to_s)
if /^test_|^script_|^op_/.match?(method_name.to_s)
methods << method_name.to_s
end
end
Expand Down
2 changes: 1 addition & 1 deletion openc3/python/openc3/script/suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ def scripts(cls):
func
for func in dir(cls)
if callable(getattr(cls, func))
and re.search(r"^test|^script|op_", func)
and re.search(r"^test_|^script_|^op_", func)
and func != "scripts"
and func != "test_cases"
]
Expand Down
Loading