mirror of
https://github.com/ThrowTheSwitch/Unity.git
synced 2025-06-19 21:38:30 +08:00
- catch optional fixtures plugin up to mainline unity (somewhat. like fixing line endings)
This commit is contained in:
@ -43,6 +43,7 @@ CFLAGS += -Wundef
|
|||||||
CFLAGS += -Wold-style-definition
|
CFLAGS += -Wold-style-definition
|
||||||
CFLAGS += -Wmissing-prototypes
|
CFLAGS += -Wmissing-prototypes
|
||||||
CFLAGS += -Wmissing-declarations
|
CFLAGS += -Wmissing-declarations
|
||||||
|
CFLAGS += -DUNITY_FIXTURES
|
||||||
|
|
||||||
TARGET_BASE1=all_tests
|
TARGET_BASE1=all_tests
|
||||||
TARGET1 = $(TARGET_BASE1)$(TARGET_EXTENSION)
|
TARGET1 = $(TARGET_BASE1)$(TARGET_EXTENSION)
|
||||||
@ -63,7 +64,7 @@ all: clean default
|
|||||||
|
|
||||||
default:
|
default:
|
||||||
$(C_COMPILER) $(CFLAGS) $(INC_DIRS) $(SYMBOLS) $(SRC_FILES1) -o $(TARGET1)
|
$(C_COMPILER) $(CFLAGS) $(INC_DIRS) $(SYMBOLS) $(SRC_FILES1) -o $(TARGET1)
|
||||||
./$(TARGET1)
|
./$(TARGET1) -v
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
$(CLEANUP)
|
$(CLEANUP)
|
||||||
|
@ -374,10 +374,10 @@ void UnityConcludeFixtureTest(void)
|
|||||||
{
|
{
|
||||||
if (Unity.CurrentTestIgnored)
|
if (Unity.CurrentTestIgnored)
|
||||||
{
|
{
|
||||||
if (UnityFixture.Verbose)
|
//if (UnityFixture.Verbose)
|
||||||
{
|
//{
|
||||||
UNITY_OUTPUT_CHAR('\n');
|
UNITY_OUTPUT_CHAR('\n');
|
||||||
}
|
//}
|
||||||
Unity.TestIgnores++;
|
Unity.TestIgnores++;
|
||||||
}
|
}
|
||||||
else if (!Unity.CurrentTestFailed)
|
else if (!Unity.CurrentTestFailed)
|
||||||
@ -391,6 +391,7 @@ void UnityConcludeFixtureTest(void)
|
|||||||
else if (Unity.CurrentTestFailed)
|
else if (Unity.CurrentTestFailed)
|
||||||
{
|
{
|
||||||
Unity.TestFailures++;
|
Unity.TestFailures++;
|
||||||
|
UNITY_OUTPUT_CHAR('\n');
|
||||||
}
|
}
|
||||||
|
|
||||||
Unity.CurrentTestFailed = 0;
|
Unity.CurrentTestFailed = 0;
|
||||||
|
15
src/unity.c
15
src/unity.c
@ -260,31 +260,44 @@ void UnityPrintFloat(_UF number)
|
|||||||
|
|
||||||
//-----------------------------------------------
|
//-----------------------------------------------
|
||||||
|
|
||||||
|
void UnityPrintFail(void);
|
||||||
void UnityPrintFail(void)
|
void UnityPrintFail(void)
|
||||||
{
|
{
|
||||||
UnityPrint(UnityStrFail);
|
UnityPrint(UnityStrFail);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void UnityPrintOk(void);
|
||||||
void UnityPrintOk(void)
|
void UnityPrintOk(void)
|
||||||
{
|
{
|
||||||
UnityPrint(UnityStrOk);
|
UnityPrint(UnityStrOk);
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------
|
//-----------------------------------------------
|
||||||
|
static void UnityTestResultsBegin(const char* file, const UNITY_LINE_TYPE line);
|
||||||
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);
|
UnityPrint(file);
|
||||||
UNITY_OUTPUT_CHAR(':');
|
UNITY_OUTPUT_CHAR(':');
|
||||||
UnityPrintNumber((_U_SINT)line);
|
UnityPrintNumber((_U_SINT)line);
|
||||||
UNITY_OUTPUT_CHAR(':');
|
UNITY_OUTPUT_CHAR(':');
|
||||||
UnityPrint(Unity.CurrentTestName);
|
UnityPrint(Unity.CurrentTestName);
|
||||||
UNITY_OUTPUT_CHAR(':');
|
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)
|
static void UnityTestResultsFailBegin(const UNITY_LINE_TYPE line)
|
||||||
{
|
{
|
||||||
|
#ifndef UNITY_FIXTURES
|
||||||
UnityTestResultsBegin(Unity.TestFile, line);
|
UnityTestResultsBegin(Unity.TestFile, line);
|
||||||
|
#else
|
||||||
|
UNITY_UNUSED(line);
|
||||||
|
#endif
|
||||||
UnityPrint(UnityStrFail);
|
UnityPrint(UnityStrFail);
|
||||||
UNITY_OUTPUT_CHAR(':');
|
UNITY_OUTPUT_CHAR(':');
|
||||||
}
|
}
|
||||||
@ -312,6 +325,7 @@ void UnityConcludeTest(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------
|
//-----------------------------------------------
|
||||||
|
static void UnityAddMsgIfSpecified(const char* msg);
|
||||||
static void UnityAddMsgIfSpecified(const char* msg)
|
static void UnityAddMsgIfSpecified(const char* msg)
|
||||||
{
|
{
|
||||||
if (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)
|
static void UnityPrintExpectedAndActualStrings(const char* expected, const char* actual)
|
||||||
{
|
{
|
||||||
UnityPrint(UnityStrExpected);
|
UnityPrint(UnityStrExpected);
|
||||||
|
@ -555,6 +555,8 @@ extern const char UnityStrErr64[];
|
|||||||
#define UNITY_END() UnityEnd()
|
#define UNITY_END() UnityEnd()
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define UNITY_UNUSED(x) (void)(sizeof(x))
|
||||||
|
|
||||||
//-------------------------------------------------------
|
//-------------------------------------------------------
|
||||||
// Basic Fail and Ignore
|
// Basic Fail and Ignore
|
||||||
//-------------------------------------------------------
|
//-------------------------------------------------------
|
||||||
|
Reference in New Issue
Block a user