mirror of
https://github.com/ThrowTheSwitch/Unity.git
synced 2025-08-06 13:50:49 +08:00
- restored examples to working condition
- restored makefiles to working condition - updated files to include copyright notice - fixed bug in string array comparisons - ignored tests no longer run teardown - tests failing for uncaught cexceptions now get exception id reported git-svn-id: http://unity.svn.sourceforge.net/svnroot/unity/trunk@70 e7d17a6e-8845-0410-bbbc-c8efb4fdad7e
This commit is contained in:
46
examples/test/no_ruby/TestProductionCode2_Runner.c
Normal file
46
examples/test/no_ruby/TestProductionCode2_Runner.c
Normal file
@ -0,0 +1,46 @@
|
||||
/* AUTOGENERATED FILE. DO NOT EDIT. */
|
||||
#include "unity.h"
|
||||
#include <setjmp.h>
|
||||
#include <stdio.h>
|
||||
|
||||
char MessageBuffer[50];
|
||||
|
||||
extern void setUp(void);
|
||||
extern void tearDown(void);
|
||||
|
||||
extern void test_IgnoredTest(void);
|
||||
extern void test_AnotherIgnoredTest(void);
|
||||
extern void test_ThisFunctionHasNotBeenTested_NeedsToBeImplemented(void);
|
||||
|
||||
static void runTest(UnityTestFunction test)
|
||||
{
|
||||
if (TEST_PROTECT())
|
||||
{
|
||||
setUp();
|
||||
test();
|
||||
}
|
||||
if (TEST_PROTECT() && !TEST_IS_IGNORED)
|
||||
{
|
||||
tearDown();
|
||||
}
|
||||
}
|
||||
void resetTest()
|
||||
{
|
||||
tearDown();
|
||||
setUp();
|
||||
}
|
||||
|
||||
|
||||
int main(void)
|
||||
{
|
||||
Unity.TestFile = "test/TestProductionCode2.c";
|
||||
UnityBegin();
|
||||
|
||||
// RUN_TEST calls runTest
|
||||
RUN_TEST(test_IgnoredTest, 13);
|
||||
RUN_TEST(test_AnotherIgnoredTest, 18);
|
||||
RUN_TEST(test_ThisFunctionHasNotBeenTested_NeedsToBeImplemented, 23);
|
||||
|
||||
UnityEnd();
|
||||
return 0;
|
||||
}
|
50
examples/test/no_ruby/TestProductionCode_Runner.c
Normal file
50
examples/test/no_ruby/TestProductionCode_Runner.c
Normal file
@ -0,0 +1,50 @@
|
||||
/* AUTOGENERATED FILE. DO NOT EDIT. */
|
||||
#include "unity.h"
|
||||
#include <setjmp.h>
|
||||
#include <stdio.h>
|
||||
|
||||
char MessageBuffer[50];
|
||||
|
||||
extern void setUp(void);
|
||||
extern void tearDown(void);
|
||||
|
||||
extern void test_FindFunction_WhichIsBroken_ShouldReturnZeroIfItemIsNotInList_WhichWorksEvenInOurBrokenCode(void);
|
||||
extern void test_FindFunction_WhichIsBroken_ShouldReturnTheIndexForItemsInList_WhichWillFailBecauseOurFunctionUnderTestIsBroken(void);
|
||||
extern void test_FunctionWhichReturnsLocalVariable_ShouldReturnTheCurrentCounterValue(void);
|
||||
extern void test_FunctionWhichReturnsLocalVariable_ShouldReturnTheCurrentCounterValueAgain(void);
|
||||
extern void test_FunctionWhichReturnsLocalVariable_ShouldReturnCurrentCounter_ButFailsBecauseThisTestIsActuallyFlawed(void);
|
||||
|
||||
static void runTest(UnityTestFunction test)
|
||||
{
|
||||
if (TEST_PROTECT())
|
||||
{
|
||||
setUp();
|
||||
test();
|
||||
}
|
||||
if (TEST_PROTECT() && !TEST_IS_IGNORED)
|
||||
{
|
||||
tearDown();
|
||||
}
|
||||
}
|
||||
void resetTest()
|
||||
{
|
||||
tearDown();
|
||||
setUp();
|
||||
}
|
||||
|
||||
|
||||
int main(void)
|
||||
{
|
||||
Unity.TestFile = "test/TestProductionCode.c";
|
||||
UnityBegin();
|
||||
|
||||
// RUN_TEST calls runTest
|
||||
RUN_TEST(test_FindFunction_WhichIsBroken_ShouldReturnZeroIfItemIsNotInList_WhichWorksEvenInOurBrokenCode, 20);
|
||||
RUN_TEST(test_FindFunction_WhichIsBroken_ShouldReturnTheIndexForItemsInList_WhichWillFailBecauseOurFunctionUnderTestIsBroken, 30);
|
||||
RUN_TEST(test_FunctionWhichReturnsLocalVariable_ShouldReturnTheCurrentCounterValue, 41);
|
||||
RUN_TEST(test_FunctionWhichReturnsLocalVariable_ShouldReturnTheCurrentCounterValueAgain, 51);
|
||||
RUN_TEST(test_FunctionWhichReturnsLocalVariable_ShouldReturnCurrentCounter_ButFailsBecauseThisTestIsActuallyFlawed, 57);
|
||||
|
||||
UnityEnd();
|
||||
return 0;
|
||||
}
|
Reference in New Issue
Block a user