diff --git a/docs.openc3.com/docs/tools/script-runner.md b/docs.openc3.com/docs/tools/script-runner.md index fd167c9d35..bfdecd5d43 100644 --- a/docs.openc3.com/docs/tools/script-runner.md +++ b/docs.openc3.com/docs/tools/script-runner.md @@ -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: @@ -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") ``` @@ -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 diff --git a/openc3/lib/openc3/script/suite.rb b/openc3/lib/openc3/script/suite.rb index 6c6b087ed0..5ebadcc577 100644 --- a/openc3/lib/openc3/script/suite.rb +++ b/openc3/lib/openc3/script/suite.rb @@ -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 diff --git a/openc3/python/openc3/script/suite.py b/openc3/python/openc3/script/suite.py index 3a1e7a75e1..35804aca67 100644 --- a/openc3/python/openc3/script/suite.py +++ b/openc3/python/openc3/script/suite.py @@ -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" ]