mirror of
https://github.com/ThrowTheSwitch/Unity.git
synced 2025-12-19 07:18:10 +08:00
Ruby script cleanup.
Fix warnings. Remove 32-bit tests from standard suite because they're not running on most platforms.
This commit is contained in:
@@ -171,10 +171,10 @@ class UnityModuleGenerator
|
|||||||
def neutralize_filename(name, start_cap = true)
|
def neutralize_filename(name, start_cap = true)
|
||||||
return name if name.empty?
|
return name if name.empty?
|
||||||
name = name.split(/(?:\s+|_|(?=[A-Z][a-z]))|(?<=[a-z])(?=[A-Z])/).map { |v| v.capitalize }.join('_')
|
name = name.split(/(?:\s+|_|(?=[A-Z][a-z]))|(?<=[a-z])(?=[A-Z])/).map { |v| v.capitalize }.join('_')
|
||||||
if start_cap
|
return if start_cap
|
||||||
return name
|
name
|
||||||
else
|
else
|
||||||
return name[0].downcase + name[1..-1]
|
name[0].downcase + name[1..-1]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -182,8 +182,8 @@ class UnityModuleGenerator
|
|||||||
def create_filename(part1, part2 = '')
|
def create_filename(part1, part2 = '')
|
||||||
name = part2.empty? ? part1 : part1 + '_' + part2
|
name = part2.empty? ? part1 : part1 + '_' + part2
|
||||||
case (@options[:naming])
|
case (@options[:naming])
|
||||||
when 'bumpy' then neutralize_filename(name,false).gsub('_','')
|
when 'bumpy' then neutralize_filename(name,false).delete('_')
|
||||||
when 'camel' then neutralize_filename(name).gsub('_','')
|
when 'camel' then neutralize_filename(name).delete('_')
|
||||||
when 'snake' then neutralize_filename(name).downcase
|
when 'snake' then neutralize_filename(name).downcase
|
||||||
when 'caps' then neutralize_filename(name).upcase
|
when 'caps' then neutralize_filename(name).upcase
|
||||||
else name
|
else name
|
||||||
|
|||||||
@@ -1002,8 +1002,7 @@ void UnityAssertFloatSpecial(const UNITY_FLOAT actual,
|
|||||||
is_trait = !isinf(actual) && !isnan(actual);
|
is_trait = !isinf(actual) && !isnan(actual);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case UNITY_FLOAT_INVALID_TRAIT:
|
default: /* including UNITY_FLOAT_INVALID_TRAIT */
|
||||||
default:
|
|
||||||
trait_index = 0;
|
trait_index = 0;
|
||||||
trait_names[0] = UnityStrInvalidFloatTrait;
|
trait_names[0] = UnityStrInvalidFloatTrait;
|
||||||
break;
|
break;
|
||||||
@@ -1143,8 +1142,7 @@ void UnityAssertDoubleSpecial(const UNITY_DOUBLE actual,
|
|||||||
is_trait = !isinf(actual) && !isnan(actual);
|
is_trait = !isinf(actual) && !isnan(actual);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case UNITY_FLOAT_INVALID_TRAIT:
|
default: /* including UNITY_FLOAT_INVALID_TRAIT */
|
||||||
default:
|
|
||||||
trait_index = 0;
|
trait_index = 0;
|
||||||
trait_names[0] = UnityStrInvalidFloatTrait;
|
trait_names[0] = UnityStrInvalidFloatTrait;
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ endif
|
|||||||
CFLAGS += -std=c99 -pedantic -Wall -Wextra -Werror
|
CFLAGS += -std=c99 -pedantic -Wall -Wextra -Werror
|
||||||
#CFLAGS += -Wconversion #disabled because if falsely complains about the isinf and isnan macros
|
#CFLAGS += -Wconversion #disabled because if falsely complains about the isinf and isnan macros
|
||||||
CFLAGS += -Wno-switch-enum -Wno-double-promotion
|
CFLAGS += -Wno-switch-enum -Wno-double-promotion
|
||||||
|
CFLAGS += -Wno-poison-system-directories
|
||||||
CFLAGS += -Wbad-function-cast -Wcast-qual -Wold-style-definition -Wshadow -Wstrict-overflow \
|
CFLAGS += -Wbad-function-cast -Wcast-qual -Wold-style-definition -Wshadow -Wstrict-overflow \
|
||||||
-Wstrict-prototypes -Wswitch-default -Wundef
|
-Wstrict-prototypes -Wswitch-default -Wundef
|
||||||
#DEBUG = -O0 -g
|
#DEBUG = -O0 -g
|
||||||
|
|||||||
@@ -300,8 +300,8 @@ module RakefileHelpers
|
|||||||
|
|
||||||
def run_make_tests()
|
def run_make_tests()
|
||||||
[ "make -s", # test with all defaults
|
[ "make -s", # test with all defaults
|
||||||
"make -s DEBUG=-m32", # test 32-bit architecture with 64-bit support
|
#"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 UNITY_SUPPORT_64=", # test 32-bit build without 64-bit types
|
||||||
"make -s UNITY_INCLUDE_DOUBLE= ", # test without double
|
"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 default noStdlibMalloc",
|
||||||
"cd #{File.join("..","extras","fixture",'test')} && make -s C89",
|
"cd #{File.join("..","extras","fixture",'test')} && make -s C89",
|
||||||
|
|||||||
Reference in New Issue
Block a user