From 97000e01041909f744d5d5c3ff26f239a475ea3a Mon Sep 17 00:00:00 2001 From: mvandervoord Date: Sun, 25 Nov 2012 15:52:27 -0500 Subject: [PATCH] - make test runner handle spaces and dashes in file names --- auto/generate_test_runner.rb | 9 ++++++--- examples/rakefile.rb | 2 +- extras/fixture/rakefile.rb | 2 +- extras/fixture/src/unity_fixture.c | 8 ++------ 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/auto/generate_test_runner.rb b/auto/generate_test_runner.rb index a3158cb..b7d37ac 100644 --- a/auto/generate_test_runner.rb +++ b/auto/generate_test_runner.rb @@ -176,21 +176,24 @@ class UnityTestRunnerGenerator output.puts(" GlobalOrderError = NULL;") end mocks.each do |mock| - output.puts(" #{mock}_Init();") + mock_clean = mock.gsub(/(?:-|\s+)/, "_") + output.puts(" #{mock_clean}_Init();") end output.puts("}\n") output.puts("static void CMock_Verify(void)") output.puts("{") mocks.each do |mock| - output.puts(" #{mock}_Verify();") + mock_clean = mock.gsub(/(?:-|\s+)/, "_") + output.puts(" #{mock_clean}_Verify();") end output.puts("}\n") output.puts("static void CMock_Destroy(void)") output.puts("{") mocks.each do |mock| - output.puts(" #{mock}_Destroy();") + mock_clean = mock.gsub(/(?:-|\s+)/, "_") + output.puts(" #{mock_clean}_Destroy();") end output.puts("}\n") end diff --git a/examples/rakefile.rb b/examples/rakefile.rb index 198fe91..0a64118 100644 --- a/examples/rakefile.rb +++ b/examples/rakefile.rb @@ -8,7 +8,7 @@ require HERE+'rakefile_helper' include RakefileHelpers # Load default configuration, for now -DEFAULT_CONFIG_FILE = 'gcc.yml' +DEFAULT_CONFIG_FILE = 'gcc_32.yml' configure_toolchain(DEFAULT_CONFIG_FILE) task :unit do diff --git a/extras/fixture/rakefile.rb b/extras/fixture/rakefile.rb index fbff3bd..5d81e72 100644 --- a/extras/fixture/rakefile.rb +++ b/extras/fixture/rakefile.rb @@ -14,7 +14,7 @@ require HERE + 'rakefile_helper' include RakefileHelpers # Load default configuration, for now -DEFAULT_CONFIG_FILE = 'gcc.yml' +DEFAULT_CONFIG_FILE = 'gcc_32.yml' configure_toolchain(DEFAULT_CONFIG_FILE) task :unit do diff --git a/extras/fixture/src/unity_fixture.c b/extras/fixture/src/unity_fixture.c index ec0b4c5..fa2a298 100644 --- a/extras/fixture/src/unity_fixture.c +++ b/extras/fixture/src/unity_fixture.c @@ -107,12 +107,8 @@ void UnityTestRunner(unityfunction* setup, UnityPointer_UndoAllSets(); if (!Unity.CurrentTestFailed) UnityMalloc_EndTest(); - UnityConcludeFixtureTest(); - } - else - { - //aborting - jwg - di i need these for the other TEST_PROTECTS? } + UnityConcludeFixtureTest(); } } @@ -254,7 +250,7 @@ void* unity_realloc(void * oldMem, size_t size) return oldMem; newMem = unity_malloc(size); - memcpy(newMem, oldMem, size); + memcpy(newMem, oldMem, guard->size); unity_free(oldMem); return newMem; }