From 3a6f1f29a35ee990172d14a86caac4cc74890791 Mon Sep 17 00:00:00 2001 From: Mark VanderVoord Date: Wed, 20 Mar 2024 15:55:59 -0400 Subject: [PATCH] :beetle: Fixed issue where `-oblah.yml` isn't parsed by powershell. :fern: `-o blah.yml` also accepted as valid input now. --- README.md | 19 +++++++++++++------ lib/cmock.rb | 10 +++++++++- 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 16d10adf..f8808550 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ CMock ![CI](https://github.com/ThrowTheSwitch/CMock/workflows/CI/badge.svg) ===== + CMock is a mock and stub generator and runtime for unit testing C. It's been designed to work smoothly with Unity Test, another of the embedded-software testing tools developed by ThrowTheSwitch.org. CMock automagically parses your C headers and creates @@ -12,22 +13,28 @@ a test-centered build manager for unit testing C code. - [Change Log](docs/CMockChangeLog.md) Getting Started -================ +=============== If you're using Ceedling, there is no need to install CMock. It will handle it for you. For everyone else, the simplest way is to grab it off github. You can also download it as a zip if you prefer. The Github method looks something like this: > git clone --recursive https://github.com/throwtheswitch/cmock.git - > cd cmock - > bundle install # Ensures you have all RubyGems needed + +Contributing to this Project +============================ If you plan to help with the development of CMock (or just want to verify that it can -perform its self tests on your system) then you can enter the test directory and then -ask it to test: +perform its self tests on your system) then you can grab its self-testing dependencies, +then run its self-tests: + > cd cmock + > bundle install # Ensures you have all RubyGems needed > cd test - > rake # Run all CMock self tests + > rake # Run all CMock self tests + +Before working on this project, you're going to want to read our guidelines on +[contributing](docs/CONTRIBUTING.md). API Documentation ================= diff --git a/lib/cmock.rb b/lib/cmock.rb index b889f5e1..36b9e053 100644 --- a/lib/cmock.rb +++ b/lib/cmock.rb @@ -86,10 +86,13 @@ def option_maker(options, key, val) options = {} filelist = [] + opt_flag = false ARGV.each do |arg| case arg when /^-o"?([a-zA-Z0-9@._\\\/:\s]+)"?/ options.merge! CMockConfig.load_config_file_from_yaml(arg.gsub(/^-o/, '')) + when /^-o$/ + opt_flag = true when '--skeleton' options[:skeleton] = true when /^--strippables="?(.*)"?/ @@ -100,7 +103,12 @@ def option_maker(options, key, val) options = option_maker(options, Regexp.last_match(1), Regexp.last_match(2)) else - filelist << arg + if opt_flag + options.merge! CMockConfig.load_config_file_from_yaml(arg) + opt_flag = false + else + filelist << arg + end end end