From 787fe7ef3391f9970e8f599a19252bfbae58498c Mon Sep 17 00:00:00 2001 From: MrRedKite Date: Tue, 9 Mar 2021 10:52:41 +0100 Subject: [PATCH 1/2] added "test_define" as array --- plugins/module_generator/lib/module_generator.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/module_generator/lib/module_generator.rb b/plugins/module_generator/lib/module_generator.rb index c4096aed4..d14288c36 100755 --- a/plugins/module_generator/lib/module_generator.rb +++ b/plugins/module_generator/lib/module_generator.rb @@ -46,6 +46,7 @@ def divine_options(optz={}) :naming => ((defined? MODULE_GENERATOR_NAMING ) ? MODULE_GENERATOR_NAMING : nil ), :update_svn => ((defined? MODULE_GENERATOR_UPDATE_SVN ) ? MODULE_GENERATOR_UPDATE_SVN : false ), :skeleton_path=> ((defined? MODULE_GENERATOR_SOURCE_ROOT ) ? MODULE_GENERATOR_SOURCE_ROOT.gsub('\\', '/').sub(/^\//, '').sub(/\/$/, '') : "src" ), + :test_define => ((defined? MODULE_GENERATOR_TEST_DEFINE ) ? MODULE_GENERATOR_TEST_DEFINE : "TEST" ), } # Read Boilerplate template file. From 9cd844993ddd59c68013b982ac97dc02023f4caf Mon Sep 17 00:00:00 2001 From: MrRedKite Date: Tue, 9 Mar 2021 11:51:02 +0100 Subject: [PATCH 2/2] Added explanation of "Test defines" in readme --- plugins/module_generator/README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/plugins/module_generator/README.md b/plugins/module_generator/README.md index e72a86b23..a3c2c7ad9 100644 --- a/plugins/module_generator/README.md +++ b/plugins/module_generator/README.md @@ -93,6 +93,16 @@ put that corporate copyright notice (or maybe a copyleft notice, if that's your ***************************/ ``` +### Test Defines + +You can specify the "#ifdef TEST" at the top of the test files with a custom define. +This example will put a "#ifdef CEEDLING_TEST" at the top of the test files. + +``` +:module_generator: + :test_define: CEEDLING_TEST +``` + ### Naming Convention Finally, you can force a particular naming convention. Even if someone calls the generator @@ -106,3 +116,4 @@ Your options are as follows: - `:snake` - snake_case_is_all_lower_and_uses_underscores - `:caps` - CAPS_FEELS_LIKE_YOU_ARE_SCREAMING +