From 9e7c259822d0f4dc3ac00537995b96b231f671b5 Mon Sep 17 00:00:00 2001 From: Mark VanderVoord Date: Sat, 16 Jan 2021 20:19:29 -0500 Subject: [PATCH 1/3] Do we need to be admin to install gems? --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9807cbb..96e7e19 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -19,8 +19,8 @@ jobs: # Install Ruby Testing Tools - name: Setup Ruby Testing Tools run: | - gem install rspec - gem install rubocop -v 0.57.2 + sudo gem install rspec + sudo gem install rubocop -v 0.57.2 # Run Tests - name: Run All Unit Tests From 3c1c5338af388ee45eb347b0955c16de5b644c7e Mon Sep 17 00:00:00 2001 From: Mark VanderVoord Date: Sat, 16 Jan 2021 20:27:49 -0500 Subject: [PATCH 2/3] Need to checkout. Drop Slack support --- .github/workflows/main.yml | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 96e7e19..fcae2ad 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -22,20 +22,11 @@ jobs: sudo gem install rspec sudo gem install rubocop -v 0.57.2 + # Checks out repository under $GITHUB_WORKSPACE + - name: Checkout Latest Repo + uses: actions/checkout@v2 + # Run Tests - name: Run All Unit Tests run: | cd test && rake ci - - # Slack notification - - uses: 8398a7/action-slack@v3 - with: - icon_emoji: ':octocat:' - status: ${{ job.status }} - # Github Actions limit visibility into renamed jobs; explicit job names here solve this limitation - job_name: "Unit Tests" - fields: repo,author,eventName,workflow,job - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_CI_CHANNEL_WEBHOOK }} - if: always() # Pick up events even if the job fails or is canceled. From fcab680286c60c199f793a49a93019c76b8f8a21 Mon Sep 17 00:00:00 2001 From: Mark VanderVoord Date: Sat, 16 Jan 2021 21:03:18 -0500 Subject: [PATCH 3/3] Ruby script cleanup. Fix warnings. Remove 32-bit tests from standard suite because they're not running on most platforms. --- auto/generate_module.rb | 14 +++++++------- src/unity.c | 6 ++---- test/Makefile | 1 + test/rakefile_helper.rb | 4 ++-- 4 files changed, 12 insertions(+), 13 deletions(-) diff --git a/auto/generate_module.rb b/auto/generate_module.rb index f7e1598..119234c 100644 --- a/auto/generate_module.rb +++ b/auto/generate_module.rb @@ -168,13 +168,13 @@ class UnityModuleGenerator end ############################ - def neutralize_filename(name, start_cap=true) + def neutralize_filename(name, start_cap = true) return name if name.empty? - name = name.split(/(?:\s+|_|(?=[A-Z][a-z]))|(?<=[a-z])(?=[A-Z])/).map{|v|v.capitalize}.join('_') - if start_cap - return name + name = name.split(/(?:\s+|_|(?=[A-Z][a-z]))|(?<=[a-z])(?=[A-Z])/).map { |v| v.capitalize }.join('_') + return if start_cap + name else - return name[0].downcase + name[1..-1] + name[0].downcase + name[1..-1] end end @@ -182,8 +182,8 @@ class UnityModuleGenerator def create_filename(part1, part2 = '') name = part2.empty? ? part1 : part1 + '_' + part2 case (@options[:naming]) - when 'bumpy' then neutralize_filename(name,false).gsub('_','') - when 'camel' then neutralize_filename(name).gsub('_','') + when 'bumpy' then neutralize_filename(name,false).delete('_') + when 'camel' then neutralize_filename(name).delete('_') when 'snake' then neutralize_filename(name).downcase when 'caps' then neutralize_filename(name).upcase else name diff --git a/src/unity.c b/src/unity.c index 0426d03..be3528f 100644 --- a/src/unity.c +++ b/src/unity.c @@ -1002,8 +1002,7 @@ void UnityAssertFloatSpecial(const UNITY_FLOAT actual, is_trait = !isinf(actual) && !isnan(actual); break; - case UNITY_FLOAT_INVALID_TRAIT: - default: + default: /* including UNITY_FLOAT_INVALID_TRAIT */ trait_index = 0; trait_names[0] = UnityStrInvalidFloatTrait; break; @@ -1143,8 +1142,7 @@ void UnityAssertDoubleSpecial(const UNITY_DOUBLE actual, is_trait = !isinf(actual) && !isnan(actual); break; - case UNITY_FLOAT_INVALID_TRAIT: - default: + default: /* including UNITY_FLOAT_INVALID_TRAIT */ trait_index = 0; trait_names[0] = UnityStrInvalidFloatTrait; break; diff --git a/test/Makefile b/test/Makefile index d8d10d2..5be0488 100644 --- a/test/Makefile +++ b/test/Makefile @@ -10,6 +10,7 @@ endif CFLAGS += -std=c99 -pedantic -Wall -Wextra -Werror #CFLAGS += -Wconversion #disabled because if falsely complains about the isinf and isnan macros CFLAGS += -Wno-switch-enum -Wno-double-promotion +CFLAGS += -Wno-poison-system-directories CFLAGS += -Wbad-function-cast -Wcast-qual -Wold-style-definition -Wshadow -Wstrict-overflow \ -Wstrict-prototypes -Wswitch-default -Wundef #DEBUG = -O0 -g diff --git a/test/rakefile_helper.rb b/test/rakefile_helper.rb index e205bc6..8678944 100644 --- a/test/rakefile_helper.rb +++ b/test/rakefile_helper.rb @@ -300,8 +300,8 @@ module RakefileHelpers def run_make_tests() [ "make -s", # test with all defaults - "make -s DEBUG=-m32", # test 32-bit architecture with 64-bit support - "make -s DEBUG=-m32 UNITY_SUPPORT_64=", # test 32-bit build without 64-bit types + #"make -s DEBUG=-m32", # test 32-bit architecture with 64-bit support + #"make -s DEBUG=-m32 UNITY_SUPPORT_64=", # test 32-bit build without 64-bit types "make -s UNITY_INCLUDE_DOUBLE= ", # test without double "cd #{File.join("..","extras","fixture",'test')} && make -s default noStdlibMalloc", "cd #{File.join("..","extras","fixture",'test')} && make -s C89",