From ded22fef63b381b2755b1ff9ac5624e05c8a4cc0 Mon Sep 17 00:00:00 2001 From: mvandervoord Date: Wed, 30 Oct 2019 09:50:22 -0400 Subject: [PATCH] Make memory handling optional in fixtures --- extras/fixture/rakefile_helper.rb | 1 + extras/fixture/src/unity_fixture.h | 4 ++++ extras/fixture/test/Makefile | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/extras/fixture/rakefile_helper.rb b/extras/fixture/rakefile_helper.rb index c543d10..91c8344 100644 --- a/extras/fixture/rakefile_helper.rb +++ b/extras/fixture/rakefile_helper.rb @@ -148,6 +148,7 @@ def run_tests load_configuration($cfg_file) test_defines = ['TEST'] $cfg['compiler']['defines']['items'] = [] if $cfg['compiler']['defines']['items'].nil? + $cfg['compiler']['defines']['items'] << "UNITY_FIXTURE_NO_EXTRAS" # Get a list of all source files needed src_files = Dir["#{__dir__}/src/*.c"] diff --git a/extras/fixture/src/unity_fixture.h b/extras/fixture/src/unity_fixture.h index c042a26..4cc403e 100644 --- a/extras/fixture/src/unity_fixture.h +++ b/extras/fixture/src/unity_fixture.h @@ -12,6 +12,10 @@ #include "unity_internals.h" #include "unity_fixture_internals.h" +#ifndef UNITY_FIXTURE_NO_EXTRAS +#include "unity_memory.h" +#endif + int UnityMain(int argc, const char* argv[], void (*runAllTests)(void)); diff --git a/extras/fixture/test/Makefile b/extras/fixture/test/Makefile index 897c5dc..bbe3241 100644 --- a/extras/fixture/test/Makefile +++ b/extras/fixture/test/Makefile @@ -3,7 +3,7 @@ ifeq ($(shell uname -s), Darwin) CC = clang endif #DEBUG = -O0 -g -CFLAGS += -std=c99 -pedantic -Wall -Wextra -Werror +CFLAGS += -std=c99 -pedantic -Wall -Wextra -Werror -DUNITY_FIXTURE_NO_EXTRAS CFLAGS += $(DEBUG) SRC = ../src/unity_fixture.c \ ../../../src/unity.c \ -- GitLab