Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Unity Test ![CI][]

__Copyright (c) 2007 - 2024 Unity Project by Mike Karlesky, Mark VanderVoord, and Greg Williams__
__Copyright (c) 2007 - 2026 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 Down
10 changes: 4 additions & 6 deletions auto/generate_test_runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -239,17 +239,15 @@ def count_tests(tests)
if @options[:use_param_tests]
idx = 0
tests.each do |test|
if (test[:args].nil? || test[:args].empty?)
if test[:args].nil? || test[:args].empty?
idx += 1
else
test[:args].each do |args|
idx += 1
end
test[:args].each { idx += 1 }
end
end
return idx
idx
else
return tests.size
tests.size
end
end

Expand Down
Empty file modified auto/unity_test_summary.rb
100644 → 100755
Empty file.
5 changes: 2 additions & 3 deletions src/unity.c
Original file line number Diff line number Diff line change
Expand Up @@ -868,6 +868,8 @@ void UnityAssertEqualIntArray(UNITY_INTERNAL_PTR expected,
const UNITY_DISPLAY_STYLE_T style,
const UNITY_FLAGS_T flags)
{
UNITY_INT expect_val = 0;
UNITY_INT actual_val = 0;
UNITY_UINT32 elements = num_elements;
unsigned int length = style & 0xF;
unsigned int increment = 0;
Expand Down Expand Up @@ -895,9 +897,6 @@ void UnityAssertEqualIntArray(UNITY_INTERNAL_PTR expected,

while ((elements > 0) && (elements--))
{
UNITY_INT expect_val;
UNITY_INT actual_val;

switch (length)
{
case 1:
Expand Down
8 changes: 8 additions & 0 deletions src/unity_internals.h
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,10 @@ typedef enum
#endif
#endif

#if defined(__GNUC__) || defined(__clang__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wpadded"
#endif
struct UNITY_STORAGE_T
{
const char* TestFile;
Expand Down Expand Up @@ -556,6 +560,9 @@ struct UNITY_STORAGE_T
jmp_buf AbortFrame;
#endif
};
#if defined(__GNUC__) || defined(__clang__)
#pragma GCC diagnostic pop
#endif

extern struct UNITY_STORAGE_T Unity;

Expand Down Expand Up @@ -857,6 +864,7 @@ extern const char UnityStrErrFloat[];
extern const char UnityStrErrDouble[];
extern const char UnityStrErr64[];
extern const char UnityStrErrShorthand[];
extern const char UnityStrErrDetailStack[];

/*-------------------------------------------------------
* Test Running Macros
Expand Down
28 changes: 27 additions & 1 deletion test/rakefile_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,34 @@ def run_tests(test_files)
# Link the test executable
link_it(test_base, obj_list)

# Execute unit test and generate results file
# Execute unit test
output = runtest(test_base)

# Verify outputs seem to have happened
failures = 0
output = output.each_line.map do |line|
if line =~ /Element.*Expected.*Was/ && !(line =~ /Element \d+ Expected \S+ Was \S+/)
failures += 1
line + " [[[[ OUTPUT FAILED TO PRINT CORRECTLY ]]]]"
else
line
end
end.join

# Update the final test summary
if failures > 0
output.sub!(/^(\d+) Tests (\d+) Failures (\d+) Ignored/) do
tests = $1
failures = $2.to_i + failures
ignored = $3
"#{tests} Tests #{failures} Failures #{ignored} Ignored"
end
output.sub!(/OK$/,"FAILED")
report output
raise "Command failed. (#{failures.to_s} Output Formatting Issues)"
end

# Generate results file
save_test_results(test_base, output)
end
end
Expand Down
Loading