diff --git a/.travis.yml b/.travis.yml index 74dc382..d75cbd2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,3 +4,6 @@ rvm: - "2.0.0" script: - cd test && rake ci + - make -s + - cd ../extras/fixture/test && rake ci + - make -s default noStdlibMalloc diff --git a/src/unity.c b/src/unity.c index 8b43332..8fa0a1b 100644 --- a/src/unity.c +++ b/src/unity.c @@ -7,11 +7,9 @@ #include "unity.h" #include -#ifndef UNITY_OUTPUT_CHAR_USE_PUTC -//If defined as something else, make sure we declare it here so it's ready for use -extern int UNITY_OUTPUT_CHAR(int); +#ifdef UNITY_OMIT_OUTPUT_CHAR_HEADER_DECLARATION +int UNITY_OUTPUT_CHAR(int); //If omitted from header, declare it here so it's ready for use #endif - #define UNITY_FAIL_AND_BAIL { Unity.CurrentTestFailed = 1; longjmp(Unity.AbortFrame, 1); } #define UNITY_IGNORE_AND_BAIL { Unity.CurrentTestIgnored = 1; longjmp(Unity.AbortFrame, 1); } /// return prematurely if we are already in failure or ignore state diff --git a/src/unity_internals.h b/src/unity_internals.h index 81058be..560d28f 100644 --- a/src/unity_internals.h +++ b/src/unity_internals.h @@ -291,12 +291,11 @@ typedef UNITY_DOUBLE_TYPE _UD; //Default to using putchar, which is defined in stdio.h #include #define UNITY_OUTPUT_CHAR(a) putchar(a) -// We need to flag the output char function uses putc in -// unity.c the extern function is not declared then. -// Previously the extern was declared in this header but -// when redundant function declaration compiler flag is enabled -// it wont compile. -#define UNITY_OUTPUT_CHAR_USE_PUTC +#else +//If defined as something else, make sure we declare it here so it's ready for use + #ifndef UNITY_OMIT_OUTPUT_CHAR_HEADER_DECLARATION +extern int UNITY_OUTPUT_CHAR(int); + #endif #endif #ifndef UNITY_PRINT_EOL diff --git a/test/tests/testunity.c b/test/tests/testunity.c index 3af4d25..32c486c 100644 --- a/test/tests/testunity.c +++ b/test/tests/testunity.c @@ -8,8 +8,6 @@ #include "unity.h" #include -int putcharSpy(int c); - // Dividing by these constants produces +/- infinity. // The rationale is given in UnityAssertFloatIsInf's body. #ifndef UNITY_EXCLUDE_FLOAT