Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
102 commits
Select commit Hold shift + click to select a range
43a3256
Test across multiple versions of Ruby
mvandervoord Jan 16, 2023
278b8dd
Pull in PR #553.
mvandervoord Feb 6, 2023
1807cb9
Merge branch 'master' into platform_matrix
mvandervoord Feb 6, 2023
5e4c587
Merge branch 'master' into platform_matrix
mvandervoord Feb 6, 2023
36259d4
Merge PR #545
mvandervoord Feb 6, 2023
cd354d9
Merge branch 'master' into platform_matrix
mvandervoord Feb 6, 2023
7a31075
Bump years.
mvandervoord Feb 6, 2023
a7639ee
Bump rubocop up to newer ruby versions (in progress)
mvandervoord Feb 16, 2023
88069f0
Fix docs issues.
mvandervoord Nov 8, 2023
bd32847
Merge branch 'master' into platform_matrix
mvandervoord Nov 8, 2023
3f7564e
Catch up on Ruby style and formatting changes.
mvandervoord Nov 13, 2023
a1b1600
Update change log and known issues.
mvandervoord Nov 13, 2023
bf56029
Merge pull request #656 from ThrowTheSwitch/platform_matrix
mvandervoord Nov 13, 2023
3911b01
Update generate test runner to leverage custom UNITY_END()
andre-lei Nov 16, 2023
985f6e0
Add help option to test command line args
Skinner927 Dec 2, 2023
fcb4e53
Update help menu to use mnemonics
Skinner927 Dec 4, 2023
049ddda
Fix tests for new help verbiage
Skinner927 Dec 4, 2023
4a606dc
Add missing `generate_test_runner.rb` options to docs
Skinner927 Dec 4, 2023
3adb5dd
Add FALLTHRU
Skinner927 Dec 4, 2023
da5a45b
Merge pull request #706 from Skinner927/add-help-to-test-binaries
mvandervoord Dec 4, 2023
b4f6557
Bump rubocop version
mvandervoord Jan 4, 2024
64939db
generate test runner: clean injected defines so the ifndef doesn't us…
mvandervoord Jan 19, 2024
ef7f968
Merge branch 'ThrowTheSwitch:master' into dev/gen-testrunner-use-begi…
andre-lei Feb 21, 2024
2777955
Document unity exec time options.
mvandervoord Mar 9, 2024
b512a1c
Flesh out documentation for command line options for runner generator.
mvandervoord Mar 9, 2024
e3457a8
Fix temperamental test in core test suite.
mvandervoord Mar 10, 2024
860062d
Fixed issue #715 (typo that disabled two tests)
mvandervoord Mar 10, 2024
85452ad
:memo: Add Code of Conduct and Contributing docs
mvandervoord Mar 13, 2024
671f8d2
Update all the boilerplates
mvandervoord Mar 17, 2024
f1d953a
Fix shebang placement
Mar 20, 2024
c444b63
Merge pull request #719 from fellerts/shebang
mvandervoord Mar 20, 2024
c3a3843
Merge branch 'ThrowTheSwitch:master' into dev/gen-testrunner-use-begi…
andre-lei Mar 20, 2024
3cbe499
Don't call assertions until after we've concluded test framework tink…
mvandervoord Mar 31, 2024
0ace9d8
Cast line_num to allow compilation with `-WConversion`
astro-stan Apr 7, 2024
c2637c5
Merge pull request #721 from sdimovv/patch-1
mvandervoord Apr 8, 2024
9b77170
Remove redundant line casts from `UNITY_TEST_ASSERT_*` macros
astro-stan Apr 18, 2024
e095ac4
Merge pull request #723 from sdimovv/patch-2
mvandervoord Apr 18, 2024
e6f73b6
Update the year in README.md
mrunix00 Apr 26, 2024
530364d
Merge pull request #726 from mrunix00/patch-1
mvandervoord Apr 26, 2024
5ff17d6
Label as static internal functions enabled by UNITY_USE_COMMAND_LINE_…
mchernosky Apr 26, 2024
25ca536
Merge pull request #728 from mchernosky/fix-command-line-arg-build
mvandervoord Apr 26, 2024
8e4c9b9
Update main.yml
dreamer-coding Apr 30, 2024
1d28a99
Merge pull request #729 from dreamer-coding-555/update_github_action
mvandervoord Apr 30, 2024
35229fd
Merge branch 'ThrowTheSwitch:master' into dev/gen-testrunner-use-begi…
andre-lei May 3, 2024
5659085
Merge pull request #737 from andre-lei/dev/gen-testrunner-use-begin-e…
mvandervoord Jun 10, 2024
18fb339
add strict match option as '-n' again.
mvandervoord Jun 13, 2024
c546414
- Protect against people not defining UNITY_USE_COMMAND)LINES_ARGS bu…
mvandervoord Aug 1, 2024
f8be3a5
Update unity_config.h
schorg Aug 14, 2024
6ebcd60
Add changelog entry for NOT float/double tests
davidjb Aug 23, 2024
6531b4e
Merge pull request #747 from davidjb/patch-1
mvandervoord Aug 23, 2024
73237c5
Merge pull request #745 from schorg/patch-1
mvandervoord Aug 24, 2024
1a29024
It's a New Year
mvandervoord Jan 1, 2025
cbcd08f
Add release notes and bump version.
mvandervoord Jan 1, 2025
459d53a
New command line options
koy-rehme-bae Jan 8, 2025
df0b5d9
Add unit tests for new switches
koy-rehme-bae Jan 19, 2025
ce122c4
Merge pull request #762 from koy-rehme-bae/fixtures_command_line_argu…
mvandervoord Jan 21, 2025
cdf1d02
Create FUNDING.yml
mvandervoord Feb 17, 2025
0921c26
Allow the memory extra and fixture extra to be enabled seperatly.
rsmyth-ecmi Mar 5, 2025
8badc0e
Add fixture help message option for UNITY_CUSTOM_HELP_MSG
rsmyth-ecmi Mar 5, 2025
b0bcdb5
Add support for randomizing test execution order
jamestiotio Jan 30, 2024
19da6e1
Fix minor typo
gr33kdude Mar 24, 2025
64e68d9
Merge pull request #772 from gr33kdude/master
mvandervoord Mar 24, 2025
23e8edb
Merge pull request #714 from jamestiotio/shuffle_tests
mvandervoord Mar 31, 2025
c359bf3
Initial implementation
ml-physec Apr 16, 2025
bfc785c
Add example
ml-physec Apr 16, 2025
6947818
[Docs] Fix typos in docs files
yahyayozo Apr 19, 2025
9578ffd
Merge pull request #778 from yahyayozo/master
mvandervoord Apr 26, 2025
3fb2484
Add IAR specific mapping for UNITY_NORETURN
rstahn May 27, 2025
48fbee9
Merge pull request #781 from rstahn/patch-1
mvandervoord May 27, 2025
5edda03
Cleanup definition of UNITY_COMPARISON_T in unity_internals.h
rstahn May 28, 2025
50c3720
Fix definition of UNITY_NOT_EQUAL in unity_internals.h
rstahn May 28, 2025
b9d897b
Merge pull request #783 from rstahn/patch-1
mvandervoord May 28, 2025
bcb0746
fix: Correct UINT max value handling
burakutkuc Jun 5, 2025
ac52c41
fix: Fail when values are equal but equality is not allowed. Handled …
burakutkuc Jun 13, 2025
6a3fc44
fix: Add casts in function-like macros for type safety
burakutkuc Jun 13, 2025
4c8dab0
Fix meson pkg-config generation
rsmyth-ecmi Mar 10, 2025
e4942f1
Fix up shebangs in the auto directory
rsmyth-ecmi Jun 25, 2025
442a060
Fix clang errors in makefile
RossSmyth Jul 3, 2025
1638627
Fix -Wextra-semi-stmt error with proper macro hygiene
RossSmyth Jul 3, 2025
8bac364
Fix reserved-identifier errors
RossSmyth Jul 3, 2025
faaaaa4
Fix Wmissing-noreturn errors
RossSmyth Jul 3, 2025
6decd7a
Wno-unused-macros and Wno-padded don't emit anything
RossSmyth Jul 3, 2025
4a59f29
Fix -Wmissing-prototypes errors
RossSmyth Jul 3, 2025
fa03368
Merge pull request #775 from ml-physec/more-details
mvandervoord Jul 9, 2025
12705bf
Remove warning without emits
RossSmyth Jul 3, 2025
fe8d1e9
Merge pull request #792 from RossSmyth/errors
mvandervoord Jul 9, 2025
eb79bce
Bump version to encapsulate recent changes.
mvandervoord Jul 9, 2025
f96b64f
fix: fixed error from regression test results; removed the unnecessar…
burakutkuc Jul 10, 2025
0bc0fed
Merge pull request #784 from burakutkuc/fix-assert-uint-overflow
mvandervoord Jul 10, 2025
3ba2bb9
Merge pull request #790 from rsmyth-ecmi/shebangFix
mvandervoord Jul 10, 2025
04f3d38
Merge pull request #771 from rsmyth-ecmi/MesonFix
mvandervoord Jul 10, 2025
bddb136
Merge pull request #769 from rsmyth-ecmi/MesonConfig
mvandervoord Jul 10, 2025
25e9af9
Update detail-stack implementation after #784
ml-physec Aug 7, 2025
0d7ea70
Merge pull request #798 from ml-physec/fix-details-print
mvandervoord Aug 7, 2025
864b4ea
Convert C++ comments to ANSI C style
RolandMarchand Sep 26, 2025
36e9b19
Merge pull request #806 from RolandMarchand/ansi-c-comments
mvandervoord Sep 29, 2025
3240ac9
add table of contents in docs
savashn Oct 27, 2025
d89dafa
Merge pull request #812 from savashn/table-of-contents
mvandervoord Oct 27, 2025
18c4e93
Try build Unity w/ -UUNITY_EXCLUDE_FLOAT_PRINT
JamesB192 Nov 12, 2025
747c2ee
Misadress style CI bot failure, my bad
JamesB192 Nov 12, 2025
51d2db9
Merge pull request #815 from JamesB192/master
mvandervoord Nov 12, 2025
d1fe18b
Updates for the new year.
mvandervoord Jan 23, 2026
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
13 changes: 13 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
github: ThrowTheSwitch
#patreon: # Replace with a single Patreon username
#open_collective: # Replace with a single Open Collective username
#ko_fi: # Replace with a single Ko-fi username
#tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
#community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
#liberapay: # Replace with a single Liberapay username
#issuehunt: # Replace with a single IssueHunt username
#lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
#polar: # Replace with a single Polar username
#buy_me_a_coffee: # Replace with a single Buy Me a Coffee username
#thanks_dev: # Replace with a single thanks.dev username
#custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
7 changes: 5 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,19 @@ jobs:
unit-tests:
name: "Unit Tests"
runs-on: ubuntu-latest
strategy:
matrix:
ruby: ['2.7', '3.0', '3.1', '3.2']
steps:
# Install Ruby Testing Tools
- name: Setup Ruby Testing Tools
run: |
sudo gem install rspec
sudo gem install rubocop -v 0.57.2
sudo gem install rubocop -v 1.57.2

# Checks out repository under $GITHUB_WORKSPACE
- name: Checkout Latest Repo
uses: actions/checkout@v2
uses: actions/checkout@v4

# Run Tests
- name: Run All Unit Tests
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) <year> 2007-21 Mike Karlesky, Mark VanderVoord, Greg Williams
Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
14 changes: 10 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Unity Test ![CI][]

__Copyright (c) 2007 - 2021 Unity Project by Mike Karlesky, Mark VanderVoord, and Greg Williams__
__Copyright (c) 2007 - 2024 Unity Project by Mike Karlesky, Mark VanderVoord, and Greg Williams__

Welcome to the Unity Test Project, one of the main projects of ThrowTheSwitch.org.
Unity Test is a unit testing framework built for C, with a focus on working with embedded toolchains.
Expand All @@ -12,6 +12,8 @@ If you'd like to leave the hard work to us, you might be interested in Ceedling,

If you're new to Unity, we encourage you to tour the [getting started guide][].

You can also find the [change log][] and [known issues][] in our documentation.

## Getting Started

The [docs][] folder contains a [getting started guide][] and much more tips about using Unity.
Expand Down Expand Up @@ -54,7 +56,7 @@ The message is output stating why.

Compare two integers for equality and display errors as signed integers.
A cast will be performed to your natural integer size so often this can just be used.
When you need to specify the exact size, like when comparing arrays, you can use a specific version:
When you need to specify the exact size, you can use a specific version.

TEST_ASSERT_EQUAL_UINT(expected, actual)
TEST_ASSERT_EQUAL_UINT8(expected, actual)
Expand All @@ -72,7 +74,8 @@ Like INT, there are variants for different sizes also.
TEST_ASSERT_EQUAL_HEX64(expected, actual)

Compares two integers for equality and display errors as hexadecimal.
Like the other integer comparisons, you can specify the size... here the size will also effect how many nibbles are shown (for example, `HEX16` will show 4 nibbles).
Like the other integer comparisons, you can specify the size...
here the size will also affect how many nibbles are shown (for example, `HEX16` will show 4 nibbles).

TEST_ASSERT_EQUAL(expected, actual)

Expand Down Expand Up @@ -214,7 +217,8 @@ Fails if the pointer is equal to NULL
TEST_ASSERT_EQUAL_MEMORY(expected, actual, len)

Compare two blocks of memory.
This is a good generic assertion for types that can't be coerced into acting like standard types... but since it's a memory compare, you have to be careful that your data types are packed.
This is a good generic assertion for types that can't be coerced into acting like standard types...
but since it's a memory compare, you have to be careful that your data types are packed.

### \_MESSAGE

Expand All @@ -224,5 +228,7 @@ This is useful for specifying more information about the problem.

[CI]: https://github.com/ThrowTheSwitch/Unity/workflows/CI/badge.svg
[getting started guide]: docs/UnityGettingStartedGuide.md
[change log]: docs/UnityChangeLog.md
[known issues]: docs/UnityKnownIssues.md
[docs]: docs/
[UnityAssertionsReference.md]: docs/UnityAssertionsReference.md
7 changes: 7 additions & 0 deletions auto/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# =========================================================================
# Unity - A Test Framework for C
# ThrowTheSwitch.org
# Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams
# SPDX-License-Identifier: MIT
# =========================================================================

11 changes: 6 additions & 5 deletions auto/colour_prompt.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# ==========================================
# Unity Project - A Test Framework for C
# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams
# [Released under MIT License. Please refer to license.txt for details]
# ==========================================
# =========================================================================
# Unity - A Test Framework for C
# ThrowTheSwitch.org
# Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams
# SPDX-License-Identifier: MIT
# =========================================================================

if RUBY_PLATFORM =~ /(win|w)32$/
begin
Expand Down
13 changes: 7 additions & 6 deletions auto/colour_reporter.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# ==========================================
# Unity Project - A Test Framework for C
# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams
# [Released under MIT License. Please refer to license.txt for details]
# ==========================================
# =========================================================================
# Unity - A Test Framework for C
# ThrowTheSwitch.org
# Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams
# SPDX-License-Identifier: MIT
# =========================================================================

require_relative 'colour_prompt'

Expand All @@ -12,7 +13,7 @@ def report(message)
if !$colour_output
$stdout.puts(message)
else
message = message.join('\n') if message.class == Array
message = message.join('\n') if message.instance_of?(Array)
message.each_line do |line|
line.chomp!
colour = case line
Expand Down
7 changes: 7 additions & 0 deletions auto/extract_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
#!/usr/bin/env python3
# =========================================================================
# Unity - A Test Framework for C
# ThrowTheSwitch.org
# Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams
# SPDX-License-Identifier: MIT
# =========================================================================

import re
import sys

Expand Down
7 changes: 7 additions & 0 deletions auto/generate_config.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# =========================================================================
# Unity - A Test Framework for C
# ThrowTheSwitch.org
# Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams
# SPDX-License-Identifier: MIT
# =========================================================================

#this is a sample configuration file for generate_module
#you would use it by calling generate_module with the -ygenerate_config.yml option
#files like this are useful for customizing generate_module to your environment
Expand Down
49 changes: 27 additions & 22 deletions auto/generate_module.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# ==========================================
# Unity Project - A Test Framework for C
# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams
# [Released under MIT License. Please refer to license.txt for details]
# ==========================================
# =========================================================================
# Unity - A Test Framework for C
# ThrowTheSwitch.org
# Copyright (c) 2007-26 Mike Karlesky, Mark VanderVoord, & Greg Williams
# SPDX-License-Identifier: MIT
# =========================================================================

# This script creates all the files with start code necessary for a new module.
# A simple module only requires a source file, header file, and test file.
Expand All @@ -13,7 +14,7 @@
require 'pathname'

# TEMPLATE_TST
TEMPLATE_TST ||= '#ifdef TEST
TEMPLATE_TST ||= '#ifdef %5$s

#include "unity.h"

Expand All @@ -32,7 +33,7 @@
TEST_IGNORE_MESSAGE("Need to Implement %1$s");
}

#endif // TEST
#endif // %5$s
'.freeze

# TEMPLATE_SRC
Expand Down Expand Up @@ -108,7 +109,8 @@ def self.default_options
update_svn: false,
boilerplates: {},
test_prefix: 'Test',
mock_prefix: 'Mock'
mock_prefix: 'Mock',
test_define: 'TEST'
}
end

Expand All @@ -132,9 +134,9 @@ def files_to_operate_on(module_name, pattern = nil)

# create triad definition
prefix = @options[:test_prefix] || 'Test'
triad = [{ ext: '.c', path: @options[:path_src], prefix: '', template: TEMPLATE_SRC, inc: :src, boilerplate: @options[:boilerplates][:src] },
triad = [{ ext: '.c', path: @options[:path_src], prefix: '', template: TEMPLATE_SRC, inc: :src, boilerplate: @options[:boilerplates][:src] },
{ ext: '.h', path: @options[:path_inc], prefix: '', template: TEMPLATE_INC, inc: :inc, boilerplate: @options[:boilerplates][:inc] },
{ ext: '.c', path: @options[:path_tst], prefix: prefix, template: TEMPLATE_TST, inc: :tst, boilerplate: @options[:boilerplates][:tst] }]
{ ext: '.c', path: @options[:path_tst], prefix: prefix, template: TEMPLATE_TST, inc: :tst, boilerplate: @options[:boilerplates][:tst], test_define: @options[:test_define] }]

# prepare the pattern for use
pattern = (pattern || @options[:pattern] || 'src').downcase
Expand All @@ -154,10 +156,11 @@ def files_to_operate_on(module_name, pattern = nil)
path: (Pathname.new("#{cfg[:path]}#{subfolder}") + filename).cleanpath,
name: submodule_name,
template: cfg[:template],
test_define: cfg[:test_define],
boilerplate: cfg[:boilerplate],
includes: case (cfg[:inc])
when :src then (@options[:includes][:src] || []) | (pattern_traits[:inc].map { |f| format(f, module_name) })
when :inc then (@options[:includes][:inc] || [])
when :inc then @options[:includes][:inc] || []
when :tst then (@options[:includes][:tst] || []) | (pattern_traits[:inc].map { |f| format("#{@options[:mock_prefix]}#{f}", module_name) })
end
}
Expand All @@ -168,18 +171,19 @@ def files_to_operate_on(module_name, pattern = nil)
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(&:capitalize).join('_')
name = name[0].downcase + name[1..-1] unless start_cap
name = name[0].downcase + name[1..] unless start_cap
name
end

############################
def create_filename(part1, part2 = '')
name = part2.empty? ? part1 : part1 + '_' + part2
name = part2.empty? ? part1 : "#{part1}_#{part2}"
case (@options[:naming])
when 'bumpy' then neutralize_filename(name, false).delete('_')
when 'bumpy' then neutralize_filename(name, start_cap: false).delete('_')
when 'camel' then neutralize_filename(name).delete('_')
when 'snake' then neutralize_filename(name).downcase
when 'caps' then neutralize_filename(name).upcase
Expand Down Expand Up @@ -212,7 +216,8 @@ def generate(module_name, pattern = nil)
f.write(file[:template] % [file[:name],
file[:includes].map { |ff| "#include \"#{ff}\"\n" }.join,
file[:name].upcase.tr('-', '_'),
file[:name].tr('-', '_')])
file[:name].tr('-', '_'),
file[:test_define]])
end
if @options[:update_svn]
`svn add \"#{file[:path]}\"`
Expand Down Expand Up @@ -260,12 +265,12 @@ def destroy(module_name, pattern = nil)
case arg
when /^-d/ then destroy = true
when /^-u/ then options[:update_svn] = true
when /^-p\"?(\w+)\"?/ then options[:pattern] = Regexp.last_match(1)
when /^-s\"?(.+)\"?/ then options[:path_src] = Regexp.last_match(1)
when /^-i\"?(.+)\"?/ then options[:path_inc] = Regexp.last_match(1)
when /^-t\"?(.+)\"?/ then options[:path_tst] = Regexp.last_match(1)
when /^-n\"?(.+)\"?/ then options[:naming] = Regexp.last_match(1)
when /^-y\"?(.+)\"?/ then options = UnityModuleGenerator.grab_config(Regexp.last_match(1))
when /^-p"?(\w+)"?/ then options[:pattern] = Regexp.last_match(1)
when /^-s"?(.+)"?/ then options[:path_src] = Regexp.last_match(1)
when /^-i"?(.+)"?/ then options[:path_inc] = Regexp.last_match(1)
when /^-t"?(.+)"?/ then options[:path_tst] = Regexp.last_match(1)
when /^-n"?(.+)"?/ then options[:naming] = Regexp.last_match(1)
when /^-y"?(.+)"?/ then options = UnityModuleGenerator.grab_config(Regexp.last_match(1))
when /^(\w+)/
raise "ERROR: You can't have more than one Module name specified!" unless module_name.nil?

Expand Down
Loading