diff --git a/examples/example_2/makefile b/examples/example_2/makefile index e195db63eaac74e4bcd8b60a813208429c33a54d..9f211f79d7a4d5b246d3934e1f9ce42b0b3319b8 100644 --- a/examples/example_2/makefile +++ b/examples/example_2/makefile @@ -43,6 +43,7 @@ CFLAGS += -Wundef CFLAGS += -Wold-style-definition CFLAGS += -Wmissing-prototypes CFLAGS += -Wmissing-declarations +CFLAGS += -DUNITY_FIXTURES TARGET_BASE1=all_tests TARGET1 = $(TARGET_BASE1)$(TARGET_EXTENSION) @@ -63,7 +64,7 @@ all: clean default default: $(C_COMPILER) $(CFLAGS) $(INC_DIRS) $(SYMBOLS) $(SRC_FILES1) -o $(TARGET1) - ./$(TARGET1) + ./$(TARGET1) -v clean: $(CLEANUP) diff --git a/extras/fixture/src/unity_fixture.c b/extras/fixture/src/unity_fixture.c index 6bdbe5b821430e345b12da1ed8981b3daf4dcdb0..575f9e976a667469d74f3f9c1f5b0278e513b123 100644 --- a/extras/fixture/src/unity_fixture.c +++ b/extras/fixture/src/unity_fixture.c @@ -374,10 +374,10 @@ void UnityConcludeFixtureTest(void) { if (Unity.CurrentTestIgnored) { - if (UnityFixture.Verbose) - { + //if (UnityFixture.Verbose) + //{ UNITY_OUTPUT_CHAR('\n'); - } + //} Unity.TestIgnores++; } else if (!Unity.CurrentTestFailed) @@ -391,6 +391,7 @@ void UnityConcludeFixtureTest(void) else if (Unity.CurrentTestFailed) { Unity.TestFailures++; + UNITY_OUTPUT_CHAR('\n'); } Unity.CurrentTestFailed = 0; diff --git a/src/unity.c b/src/unity.c index d6fd0a142c3ae9f1ff10fec57b71ed96955efd24..3cc6200fad1f2c18067136ed2996631d18eda2c6 100644 --- a/src/unity.c +++ b/src/unity.c @@ -260,31 +260,44 @@ void UnityPrintFloat(_UF number) //----------------------------------------------- +void UnityPrintFail(void); void UnityPrintFail(void) { UnityPrint(UnityStrFail); } +void UnityPrintOk(void); void UnityPrintOk(void) { UnityPrint(UnityStrOk); } //----------------------------------------------- +static void UnityTestResultsBegin(const char* file, const UNITY_LINE_TYPE line); static void UnityTestResultsBegin(const char* file, const UNITY_LINE_TYPE line) { +#ifndef UNITY_FIXTURES UnityPrint(file); UNITY_OUTPUT_CHAR(':'); UnityPrintNumber((_U_SINT)line); UNITY_OUTPUT_CHAR(':'); UnityPrint(Unity.CurrentTestName); UNITY_OUTPUT_CHAR(':'); +#else + UNITY_UNUSED(file); + UNITY_UNUSED(line); +#endif } //----------------------------------------------- +static void UnityTestResultsFailBegin(const UNITY_LINE_TYPE line); static void UnityTestResultsFailBegin(const UNITY_LINE_TYPE line) { +#ifndef UNITY_FIXTURES UnityTestResultsBegin(Unity.TestFile, line); +#else + UNITY_UNUSED(line); +#endif UnityPrint(UnityStrFail); UNITY_OUTPUT_CHAR(':'); } @@ -312,6 +325,7 @@ void UnityConcludeTest(void) } //----------------------------------------------- +static void UnityAddMsgIfSpecified(const char* msg); static void UnityAddMsgIfSpecified(const char* msg) { if (msg) @@ -322,6 +336,7 @@ static void UnityAddMsgIfSpecified(const char* msg) } //----------------------------------------------- +static void UnityPrintExpectedAndActualStrings(const char* expected, const char* actual); static void UnityPrintExpectedAndActualStrings(const char* expected, const char* actual) { UnityPrint(UnityStrExpected); diff --git a/src/unity_internals.h b/src/unity_internals.h index 15529155127b413f4883c0019f777da457f97293..1d21684875e82c4bf8a7300a3c560fd1bbf6bc87 100644 --- a/src/unity_internals.h +++ b/src/unity_internals.h @@ -555,6 +555,8 @@ extern const char UnityStrErr64[]; #define UNITY_END() UnityEnd() #endif +#define UNITY_UNUSED(x) (void)(sizeof(x)) + //------------------------------------------------------- // Basic Fail and Ignore //-------------------------------------------------------