提交 962ce941 编写于 作者: M mvandervoord

- caught up runner generator script tests

git-svn-id: http://unity.svn.sourceforge.net/svnroot/unity/trunk@105 e7d17a6e-8845-0410-bbbc-c8efb4fdad7e
上级 780c17d0
......@@ -32,7 +32,7 @@ task :summary do
end
desc "Build and test Unity"
task :all => [:clean, :unit, :summary]
task :all => [:clean, :scripts, :unit, :summary]
task :default => [:clobber, :all]
task :ci => [:no_color, :default]
task :cruise => [:no_color, :default]
......
/* AUTOGENERATED FILE. DO NOT EDIT. */
//=======Test Runner Used To Run Each Test Below=====
#define RUN_TEST(TestFunc, TestLineNum) \
{ \
Unity.CurrentTestName = #TestFunc; \
Unity.CurrentTestLineNumber = TestLineNum; \
Unity.NumberOfTests++; \
if (TEST_PROTECT()) \
{ \
CEXCEPTION_T e; \
Try { \
setUp(); \
TestFunc(); \
} Catch(e) { TEST_ASSERT_EQUAL_HEX32_MESSAGE(CEXCEPTION_NONE, e, "Unhandled Exception!"); } \
} \
if (TEST_PROTECT() && !TEST_IS_IGNORED) \
{ \
tearDown(); \
} \
UnityConcludeTest(); \
}
//=======Automagically Detected Files To Include=====
#include "unity.h"
#include <setjmp.h>
#include <stdio.h>
#include "CException.h"
char MessageBuffer[50];
//=======External Functions This Runner Calls=====
extern void setUp(void);
extern void tearDown(void);
extern void test_TheFirstThingToTest(void);
extern void test_TheSecondThingToTest(void);
static void runTest(UnityTestFunction test)
{
if (TEST_PROTECT())
{
CEXCEPTION_T e;
Try {
setUp();
test();
} Catch(e) { TEST_ASSERT_EQUAL_HEX32_MESSAGE(CEXCEPTION_NONE, e, "Unhandled Exception!"); }
}
if (TEST_PROTECT() && !TEST_IS_IGNORED)
{
tearDown();
}
}
//=======Test Reset Option=====
void resetTest()
{
tearDown();
......@@ -34,12 +42,11 @@ void resetTest()
}
//=======MAIN=====
int main(void)
{
Unity.TestFile = "test/testdata/testsample.c";
UnityBegin();
// RUN_TEST calls runTest
RUN_TEST(test_TheFirstThingToTest, 21);
RUN_TEST(test_TheSecondThingToTest, 43);
......
/* AUTOGENERATED FILE. DO NOT EDIT. */
//=======Test Runner Used To Run Each Test Below=====
#define RUN_TEST(TestFunc, TestLineNum) \
{ \
Unity.CurrentTestName = #TestFunc; \
Unity.CurrentTestLineNumber = TestLineNum; \
Unity.NumberOfTests++; \
if (TEST_PROTECT()) \
{ \
setUp(); \
TestFunc(); \
} \
if (TEST_PROTECT() && !TEST_IS_IGNORED) \
{ \
tearDown(); \
} \
UnityConcludeTest(); \
}
//=======Automagically Detected Files To Include=====
#include "unity.h"
#include <setjmp.h>
#include <stdio.h>
char MessageBuffer[50];
//=======External Functions This Runner Calls=====
extern void setUp(void);
extern void tearDown(void);
extern void test_TheFirstThingToTest(void);
extern void test_TheSecondThingToTest(void);
static void runTest(UnityTestFunction test)
{
if (TEST_PROTECT())
{
setUp();
test();
}
if (TEST_PROTECT() && !TEST_IS_IGNORED)
{
tearDown();
}
}
//=======Test Reset Option=====
void resetTest()
{
tearDown();
......@@ -30,12 +38,11 @@ void resetTest()
}
//=======MAIN=====
int main(void)
{
Unity.TestFile = "test/testdata/testsample.c";
UnityBegin();
// RUN_TEST calls runTest
RUN_TEST(test_TheFirstThingToTest, 21);
RUN_TEST(test_TheSecondThingToTest, 43);
......
/* AUTOGENERATED FILE. DO NOT EDIT. */
//=======Test Runner Used To Run Each Test Below=====
#define RUN_TEST(TestFunc, TestLineNum) \
{ \
Unity.CurrentTestName = #TestFunc; \
Unity.CurrentTestLineNumber = TestLineNum; \
Unity.NumberOfTests++; \
if (TEST_PROTECT()) \
{ \
CEXCEPTION_T e; \
Try { \
CMock_Init(); \
setUp(); \
TestFunc(); \
CMock_Verify(); \
} Catch(e) { TEST_ASSERT_EQUAL_HEX32_MESSAGE(CEXCEPTION_NONE, e, "Unhandled Exception!"); } \
} \
CMock_Destroy(); \
if (TEST_PROTECT() && !TEST_IS_IGNORED) \
{ \
tearDown(); \
} \
UnityConcludeTest(); \
}
//=======Automagically Detected Files To Include=====
#include "unity.h"
#include "cmock.h"
#include <setjmp.h>
......@@ -6,14 +32,14 @@
#include "CException.h"
#include "Mockstanky.h"
char MessageBuffer[50];
//=======External Functions This Runner Calls=====
extern void setUp(void);
extern void tearDown(void);
extern void test_TheFirstThingToTest(void);
extern void test_TheSecondThingToTest(void);
//=======Mock Management=====
static void CMock_Init(void)
{
Mockstanky_Init();
......@@ -26,24 +52,8 @@ static void CMock_Destroy(void)
{
Mockstanky_Destroy();
}
static void runTest(UnityTestFunction test)
{
if (TEST_PROTECT())
{
CEXCEPTION_T e;
Try {
CMock_Init();
setUp();
test();
CMock_Verify();
} Catch(e) { TEST_ASSERT_EQUAL_HEX32_MESSAGE(CEXCEPTION_NONE, e, "Unhandled Exception!"); }
}
CMock_Destroy();
if (TEST_PROTECT() && !TEST_IS_IGNORED)
{
tearDown();
}
}
//=======Test Reset Option=====
void resetTest()
{
CMock_Verify();
......@@ -54,12 +64,11 @@ void resetTest()
}
//=======MAIN=====
int main(void)
{
Unity.TestFile = "test/testdata/mocksample.c";
UnityBegin();
// RUN_TEST calls runTest
RUN_TEST(test_TheFirstThingToTest, 21);
RUN_TEST(test_TheSecondThingToTest, 43);
......
/* AUTOGENERATED FILE. DO NOT EDIT. */
//=======Test Runner Used To Run Each Test Below=====
#define RUN_TEST(TestFunc, TestLineNum) \
{ \
Unity.CurrentTestName = #TestFunc; \
Unity.CurrentTestLineNumber = TestLineNum; \
Unity.NumberOfTests++; \
if (TEST_PROTECT()) \
{ \
CMock_Init(); \
setUp(); \
TestFunc(); \
CMock_Verify(); \
} \
CMock_Destroy(); \
if (TEST_PROTECT() && !TEST_IS_IGNORED) \
{ \
tearDown(); \
} \
UnityConcludeTest(); \
}
//=======Automagically Detected Files To Include=====
#include "unity.h"
#include "cmock.h"
#include <setjmp.h>
#include <stdio.h>
#include "Mockstanky.h"
char MessageBuffer[50];
//=======External Functions This Runner Calls=====
extern void setUp(void);
extern void tearDown(void);
extern void test_TheFirstThingToTest(void);
extern void test_TheSecondThingToTest(void);
//=======Mock Management=====
static void CMock_Init(void)
{
Mockstanky_Init();
......@@ -25,21 +48,8 @@ static void CMock_Destroy(void)
{
Mockstanky_Destroy();
}
static void runTest(UnityTestFunction test)
{
if (TEST_PROTECT())
{
CMock_Init();
setUp();
test();
CMock_Verify();
}
CMock_Destroy();
if (TEST_PROTECT() && !TEST_IS_IGNORED)
{
tearDown();
}
}
//=======Test Reset Option=====
void resetTest()
{
CMock_Verify();
......@@ -50,12 +60,11 @@ void resetTest()
}
//=======MAIN=====
int main(void)
{
Unity.TestFile = "test/testdata/mocksample.c";
UnityBegin();
// RUN_TEST calls runTest
RUN_TEST(test_TheFirstThingToTest, 21);
RUN_TEST(test_TheSecondThingToTest, 43);
......
/* AUTOGENERATED FILE. DO NOT EDIT. */
//=======Test Runner Used To Run Each Test Below=====
#define RUN_TEST(TestFunc, TestLineNum) \
{ \
Unity.CurrentTestName = #TestFunc; \
Unity.CurrentTestLineNumber = TestLineNum; \
Unity.NumberOfTests++; \
if (TEST_PROTECT()) \
{ \
CEXCEPTION_T e; \
Try { \
CMock_Init(); \
setUp(); \
TestFunc(); \
CMock_Verify(); \
} Catch(e) { TEST_ASSERT_EQUAL_HEX32_MESSAGE(CEXCEPTION_NONE, e, "Unhandled Exception!"); } \
} \
CMock_Destroy(); \
if (TEST_PROTECT() && !TEST_IS_IGNORED) \
{ \
tearDown(); \
} \
UnityConcludeTest(); \
}
//=======Automagically Detected Files To Include=====
#include "unity.h"
#include "cmock.h"
#include "one.h"
......@@ -8,17 +34,18 @@
#include "CException.h"
#include "Mockstanky.h"
char MessageBuffer[50];
int GlobalExpectCount;
int GlobalVerifyOrder;
char* GlobalOrderError;
//=======External Functions This Runner Calls=====
extern void setUp(void);
extern void tearDown(void);
extern void test_TheFirstThingToTest(void);
extern void test_TheSecondThingToTest(void);
//=======Mock Management=====
static void CMock_Init(void)
{
GlobalExpectCount = 0;
......@@ -34,24 +61,8 @@ static void CMock_Destroy(void)
{
Mockstanky_Destroy();
}
static void runTest(UnityTestFunction test)
{
if (TEST_PROTECT())
{
CEXCEPTION_T e;
Try {
CMock_Init();
setUp();
test();
CMock_Verify();
} Catch(e) { TEST_ASSERT_EQUAL_HEX32_MESSAGE(CEXCEPTION_NONE, e, "Unhandled Exception!"); }
}
CMock_Destroy();
if (TEST_PROTECT() && !TEST_IS_IGNORED)
{
tearDown();
}
}
//=======Test Reset Option=====
void resetTest()
{
CMock_Verify();
......@@ -62,12 +73,11 @@ void resetTest()
}
//=======MAIN=====
int main(void)
{
Unity.TestFile = "test/testdata/mocksample.c";
UnityBegin();
// RUN_TEST calls runTest
RUN_TEST(test_TheFirstThingToTest, 21);
RUN_TEST(test_TheSecondThingToTest, 43);
......
/* AUTOGENERATED FILE. DO NOT EDIT. */
//=======Test Runner Used To Run Each Test Below=====
#define RUN_TEST(TestFunc, TestLineNum) \
{ \
Unity.CurrentTestName = #TestFunc; \
Unity.CurrentTestLineNumber = TestLineNum; \
Unity.NumberOfTests++; \
if (TEST_PROTECT()) \
{ \
CMock_Init(); \
setUp(); \
TestFunc(); \
CMock_Verify(); \
} \
CMock_Destroy(); \
if (TEST_PROTECT() && !TEST_IS_IGNORED) \
{ \
tearDown(); \
} \
UnityConcludeTest(); \
}
//=======Automagically Detected Files To Include=====
#include "unity.h"
#include "cmock.h"
#include <setjmp.h>
#include <stdio.h>
#include "Mockstanky.h"
char MessageBuffer[50];
//=======External Functions This Runner Calls=====
extern void setUp(void);
extern void tearDown(void);
extern void test_TheFirstThingToTest(void);
extern void test_TheSecondThingToTest(void);
//=======Mock Management=====
static void CMock_Init(void)
{
Mockstanky_Init();
......@@ -25,29 +48,20 @@ static void CMock_Destroy(void)
{
Mockstanky_Destroy();
}
//=======Suite Setup=====
static int suite_setup(void)
{
a_custom_setup();
}
//=======Suite Teardown=====
static int suite_teardown(int num_failures)
{
a_custom_teardown();
}
static void runTest(UnityTestFunction test)
{
if (TEST_PROTECT())
{
CMock_Init();
setUp();
test();
CMock_Verify();
}
CMock_Destroy();
if (TEST_PROTECT() && !TEST_IS_IGNORED)
{
tearDown();
}
}
//=======Test Reset Option=====
void resetTest()
{
CMock_Verify();
......@@ -58,13 +72,12 @@ void resetTest()
}
//=======MAIN=====
int main(void)
{
suite_setup();
Unity.TestFile = "test/testdata/mocksample.c";
UnityBegin();
// RUN_TEST calls runTest
RUN_TEST(test_TheFirstThingToTest, 21);
RUN_TEST(test_TheSecondThingToTest, 43);
......
/* AUTOGENERATED FILE. DO NOT EDIT. */
//=======Test Runner Used To Run Each Test Below=====
#define RUN_TEST(TestFunc, TestLineNum, ...) \
{ \
Unity.CurrentTestName = #TestFunc; \
Unity.CurrentTestLineNumber = TestLineNum; \
Unity.NumberOfTests++; \
if (TEST_PROTECT()) \
{ \
CMock_Init(); \
setUp(); \
TestFunc(__VA_ARGS__); \
CMock_Verify(); \
} \
CMock_Destroy(); \
if (TEST_PROTECT() && !TEST_IS_IGNORED) \
{ \
tearDown(); \
} \
UnityConcludeTest(); \
}
//=======Automagically Detected Files To Include=====
#include "unity.h"
#include "cmock.h"
#include <setjmp.h>
#include <stdio.h>
#include "Mockstanky.h"
//=======External Functions This Runner Calls=====
extern void setUp(void);
extern void tearDown(void);
extern void test_TheFirstThingToTest(void);
extern void test_TheSecondThingToTest(void);
//=======Mock Management=====
static void CMock_Init(void)
{
Mockstanky_Init();
}
static void CMock_Verify(void)
{
Mockstanky_Verify();
}
static void CMock_Destroy(void)
{
Mockstanky_Destroy();
}
//=======Test Reset Option=====
void resetTest()
{
CMock_Verify();
CMock_Destroy();
tearDown();
CMock_Init();
setUp();
}
//=======MAIN=====
int main(void)
{
Unity.TestFile = "test/testdata/mocksample.c";
UnityBegin();
RUN_TEST(test_TheFirstThingToTest, 21);
RUN_TEST(test_TheSecondThingToTest, 43);
return (UnityEnd());
}
/* AUTOGENERATED FILE. DO NOT EDIT. */
//=======Test Runner Used To Run Each Test Below=====
#define RUN_TEST(TestFunc, TestLineNum) \
{ \
Unity.CurrentTestName = #TestFunc; \
Unity.CurrentTestLineNumber = TestLineNum; \
Unity.NumberOfTests++; \
if (TEST_PROTECT()) \
{ \
CEXCEPTION_T e; \
Try { \
CMock_Init(); \
setUp(); \
TestFunc(); \
CMock_Verify(); \
} Catch(e) { TEST_ASSERT_EQUAL_HEX32_MESSAGE(CEXCEPTION_NONE, e, "Unhandled Exception!"); } \
} \
CMock_Destroy(); \
if (TEST_PROTECT() && !TEST_IS_IGNORED) \
{ \
tearDown(); \
} \
UnityConcludeTest(); \
}
//=======Automagically Detected Files To Include=====
#include "unity.h"
#include "cmock.h"
#include "one.h"
......@@ -8,17 +34,18 @@
#include "CException.h"
#include "Mockstanky.h"
char MessageBuffer[50];
int GlobalExpectCount;
int GlobalVerifyOrder;
char* GlobalOrderError;
//=======External Functions This Runner Calls=====
extern void setUp(void);
extern void tearDown(void);
extern void test_TheFirstThingToTest(void);
extern void test_TheSecondThingToTest(void);
//=======Mock Management=====
static void CMock_Init(void)
{
GlobalExpectCount = 0;
......@@ -34,24 +61,8 @@ static void CMock_Destroy(void)
{
Mockstanky_Destroy();
}
static void runTest(UnityTestFunction test)
{
if (TEST_PROTECT())
{
CEXCEPTION_T e;
Try {
CMock_Init();
setUp();
test();
CMock_Verify();
} Catch(e) { TEST_ASSERT_EQUAL_HEX32_MESSAGE(CEXCEPTION_NONE, e, "Unhandled Exception!"); }
}
CMock_Destroy();
if (TEST_PROTECT() && !TEST_IS_IGNORED)
{
tearDown();
}
}
//=======Test Reset Option=====
void resetTest()
{
CMock_Verify();
......@@ -62,12 +73,11 @@ void resetTest()
}
//=======MAIN=====
int main(void)
{
Unity.TestFile = "test/testdata/mocksample.c";
UnityBegin();
// RUN_TEST calls runTest
RUN_TEST(test_TheFirstThingToTest, 21);
RUN_TEST(test_TheSecondThingToTest, 43);
......
/* AUTOGENERATED FILE. DO NOT EDIT. */
//=======Test Runner Used To Run Each Test Below=====
#define RUN_TEST(TestFunc, TestLineNum) \
{ \
Unity.CurrentTestName = #TestFunc; \
Unity.CurrentTestLineNumber = TestLineNum; \
Unity.NumberOfTests++; \
if (TEST_PROTECT()) \
{ \
CMock_Init(); \
setUp(); \
TestFunc(); \
CMock_Verify(); \
} \
CMock_Destroy(); \
if (TEST_PROTECT() && !TEST_IS_IGNORED) \
{ \
tearDown(); \
} \
UnityConcludeTest(); \
}
//=======Automagically Detected Files To Include=====
#include "unity.h"
#include "cmock.h"
#include <setjmp.h>
#include <stdio.h>
#include "Mockstanky.h"
char MessageBuffer[50];
//=======External Functions This Runner Calls=====
extern void setUp(void);
extern void tearDown(void);
extern void test_TheFirstThingToTest(void);
extern void test_TheSecondThingToTest(void);
//=======Mock Management=====
static void CMock_Init(void)
{
Mockstanky_Init();
......@@ -25,29 +48,20 @@ static void CMock_Destroy(void)
{
Mockstanky_Destroy();
}
//=======Suite Setup=====
static int suite_setup(void)
{
a_custom_setup();
}
//=======Suite Teardown=====
static int suite_teardown(int num_failures)
{
a_custom_teardown();
}
static void runTest(UnityTestFunction test)
{
if (TEST_PROTECT())
{
CMock_Init();
setUp();
test();
CMock_Verify();
}
CMock_Destroy();
if (TEST_PROTECT() && !TEST_IS_IGNORED)
{
tearDown();
}
}
//=======Test Reset Option=====
void resetTest()
{
CMock_Verify();
......@@ -58,13 +72,12 @@ void resetTest()
}
//=======MAIN=====
int main(void)
{
suite_setup();
Unity.TestFile = "test/testdata/mocksample.c";
UnityBegin();
// RUN_TEST calls runTest
RUN_TEST(test_TheFirstThingToTest, 21);
RUN_TEST(test_TheSecondThingToTest, 43);
......
/* AUTOGENERATED FILE. DO NOT EDIT. */
//=======Test Runner Used To Run Each Test Below=====
#define RUN_TEST(TestFunc, TestLineNum) \
{ \
Unity.CurrentTestName = #TestFunc; \
Unity.CurrentTestLineNumber = TestLineNum; \
Unity.NumberOfTests++; \
if (TEST_PROTECT()) \
{ \
CMock_Init(); \
setUp(); \
TestFunc(); \
CMock_Verify(); \
} \
CMock_Destroy(); \
if (TEST_PROTECT() && !TEST_IS_IGNORED) \
{ \
tearDown(); \
} \
UnityConcludeTest(); \
}
//=======Automagically Detected Files To Include=====
#include "unity.h"
#include "cmock.h"
#include <setjmp.h>
#include <stdio.h>
#include "Mockstanky.h"
char MessageBuffer[50];
//=======External Functions This Runner Calls=====
extern void setUp(void);
extern void tearDown(void);
extern void test_TheFirstThingToTest(void);
extern void test_TheSecondThingToTest(void);
//=======Mock Management=====
static void CMock_Init(void)
{
Mockstanky_Init();
......@@ -25,25 +48,14 @@ static void CMock_Destroy(void)
{
Mockstanky_Destroy();
}
//=======Suite Setup=====
static int suite_setup(void)
{
a_yaml_setup();
}
static void runTest(UnityTestFunction test)
{
if (TEST_PROTECT())
{
CMock_Init();
setUp();
test();
CMock_Verify();
}
CMock_Destroy();
if (TEST_PROTECT() && !TEST_IS_IGNORED)
{
tearDown();
}
}
//=======Test Reset Option=====
void resetTest()
{
CMock_Verify();
......@@ -54,13 +66,12 @@ void resetTest()
}
//=======MAIN=====
int main(void)
{
suite_setup();
Unity.TestFile = "test/testdata/mocksample.c";
UnityBegin();
// RUN_TEST calls runTest
RUN_TEST(test_TheFirstThingToTest, 21);
RUN_TEST(test_TheSecondThingToTest, 43);
......
/* AUTOGENERATED FILE. DO NOT EDIT. */
//=======Test Runner Used To Run Each Test Below=====
#define RUN_TEST(TestFunc, TestLineNum) \
{ \
Unity.CurrentTestName = #TestFunc; \
Unity.CurrentTestLineNumber = TestLineNum; \
Unity.NumberOfTests++; \
if (TEST_PROTECT()) \
{ \
CEXCEPTION_T e; \
Try { \
setUp(); \
TestFunc(); \
} Catch(e) { TEST_ASSERT_EQUAL_HEX32_MESSAGE(CEXCEPTION_NONE, e, "Unhandled Exception!"); } \
} \
if (TEST_PROTECT() && !TEST_IS_IGNORED) \
{ \
tearDown(); \
} \
UnityConcludeTest(); \
}
//=======Automagically Detected Files To Include=====
#include "unity.h"
#include "one.h"
#include "two.h"
......@@ -6,32 +29,18 @@
#include <stdio.h>
#include "CException.h"
char MessageBuffer[50];
int GlobalExpectCount;
int GlobalVerifyOrder;
char* GlobalOrderError;
//=======External Functions This Runner Calls=====
extern void setUp(void);
extern void tearDown(void);
extern void test_TheFirstThingToTest(void);
extern void test_TheSecondThingToTest(void);
static void runTest(UnityTestFunction test)
{
if (TEST_PROTECT())
{
CEXCEPTION_T e;
Try {
setUp();
test();
} Catch(e) { TEST_ASSERT_EQUAL_HEX32_MESSAGE(CEXCEPTION_NONE, e, "Unhandled Exception!"); }
}
if (TEST_PROTECT() && !TEST_IS_IGNORED)
{
tearDown();
}
}
//=======Test Reset Option=====
void resetTest()
{
tearDown();
......@@ -39,12 +48,11 @@ void resetTest()
}
//=======MAIN=====
int main(void)
{
Unity.TestFile = "test/testdata/testsample.c";
UnityBegin();
// RUN_TEST calls runTest
RUN_TEST(test_TheFirstThingToTest, 21);
RUN_TEST(test_TheSecondThingToTest, 43);
......
/* AUTOGENERATED FILE. DO NOT EDIT. */
//=======Test Runner Used To Run Each Test Below=====
#define RUN_TEST(TestFunc, TestLineNum) \
{ \
Unity.CurrentTestName = #TestFunc; \
Unity.CurrentTestLineNumber = TestLineNum; \
Unity.NumberOfTests++; \
if (TEST_PROTECT()) \
{ \
setUp(); \
TestFunc(); \
} \
if (TEST_PROTECT() && !TEST_IS_IGNORED) \
{ \
tearDown(); \
} \
UnityConcludeTest(); \
}
//=======Automagically Detected Files To Include=====
#include "unity.h"
#include <setjmp.h>
#include <stdio.h>
char MessageBuffer[50];
//=======External Functions This Runner Calls=====
extern void setUp(void);
extern void tearDown(void);
extern void test_TheFirstThingToTest(void);
extern void test_TheSecondThingToTest(void);
//=======Suite Setup=====
static int suite_setup(void)
{
a_custom_setup();
}
//=======Suite Teardown=====
static int suite_teardown(int num_failures)
{
a_custom_teardown();
}
static void runTest(UnityTestFunction test)
{
if (TEST_PROTECT())
{
setUp();
test();
}
if (TEST_PROTECT() && !TEST_IS_IGNORED)
{
tearDown();
}
}
//=======Test Reset Option=====
void resetTest()
{
tearDown();
......@@ -38,13 +50,12 @@ void resetTest()
}
//=======MAIN=====
int main(void)
{
suite_setup();
Unity.TestFile = "test/testdata/testsample.c";
UnityBegin();
// RUN_TEST calls runTest
RUN_TEST(test_TheFirstThingToTest, 21);
RUN_TEST(test_TheSecondThingToTest, 43);
......
/* AUTOGENERATED FILE. DO NOT EDIT. */
//=======Test Runner Used To Run Each Test Below=====
#define RUN_TEST(TestFunc, TestLineNum, ...) \
{ \
Unity.CurrentTestName = #TestFunc; \
Unity.CurrentTestLineNumber = TestLineNum; \
Unity.NumberOfTests++; \
if (TEST_PROTECT()) \
{ \
setUp(); \
TestFunc(__VA_ARGS__); \
} \
if (TEST_PROTECT() && !TEST_IS_IGNORED) \
{ \
tearDown(); \
} \
UnityConcludeTest(); \
}
//=======Automagically Detected Files To Include=====
#include "unity.h"
#include <setjmp.h>
#include <stdio.h>
//=======External Functions This Runner Calls=====
extern void setUp(void);
extern void tearDown(void);
extern void test_TheFirstThingToTest(void);
extern void test_TheSecondThingToTest(void);
//=======Test Reset Option=====
void resetTest()
{
tearDown();
setUp();
}
//=======MAIN=====
int main(void)
{
Unity.TestFile = "test/testdata/testsample.c";
UnityBegin();
RUN_TEST(test_TheFirstThingToTest, 21);
RUN_TEST(test_TheSecondThingToTest, 43);
return (UnityEnd());
}
/* AUTOGENERATED FILE. DO NOT EDIT. */
//=======Test Runner Used To Run Each Test Below=====
#define RUN_TEST(TestFunc, TestLineNum) \
{ \
Unity.CurrentTestName = #TestFunc; \
Unity.CurrentTestLineNumber = TestLineNum; \
Unity.NumberOfTests++; \
if (TEST_PROTECT()) \
{ \
CEXCEPTION_T e; \
Try { \
setUp(); \
TestFunc(); \
} Catch(e) { TEST_ASSERT_EQUAL_HEX32_MESSAGE(CEXCEPTION_NONE, e, "Unhandled Exception!"); } \
} \
if (TEST_PROTECT() && !TEST_IS_IGNORED) \
{ \
tearDown(); \
} \
UnityConcludeTest(); \
}
//=======Automagically Detected Files To Include=====
#include "unity.h"
#include "one.h"
#include "two.h"
......@@ -6,32 +29,18 @@
#include <stdio.h>
#include "CException.h"
char MessageBuffer[50];
int GlobalExpectCount;
int GlobalVerifyOrder;
char* GlobalOrderError;
//=======External Functions This Runner Calls=====
extern void setUp(void);
extern void tearDown(void);
extern void test_TheFirstThingToTest(void);
extern void test_TheSecondThingToTest(void);
static void runTest(UnityTestFunction test)
{
if (TEST_PROTECT())
{
CEXCEPTION_T e;
Try {
setUp();
test();
} Catch(e) { TEST_ASSERT_EQUAL_HEX32_MESSAGE(CEXCEPTION_NONE, e, "Unhandled Exception!"); }
}
if (TEST_PROTECT() && !TEST_IS_IGNORED)
{
tearDown();
}
}
//=======Test Reset Option=====
void resetTest()
{
tearDown();
......@@ -39,12 +48,11 @@ void resetTest()
}
//=======MAIN=====
int main(void)
{
Unity.TestFile = "test/testdata/testsample.c";
UnityBegin();
// RUN_TEST calls runTest
RUN_TEST(test_TheFirstThingToTest, 21);
RUN_TEST(test_TheSecondThingToTest, 43);
......
/* AUTOGENERATED FILE. DO NOT EDIT. */
//=======Test Runner Used To Run Each Test Below=====
#define RUN_TEST(TestFunc, TestLineNum) \
{ \
Unity.CurrentTestName = #TestFunc; \
Unity.CurrentTestLineNumber = TestLineNum; \
Unity.NumberOfTests++; \
if (TEST_PROTECT()) \
{ \
setUp(); \
TestFunc(); \
} \
if (TEST_PROTECT() && !TEST_IS_IGNORED) \
{ \
tearDown(); \
} \
UnityConcludeTest(); \
}
//=======Automagically Detected Files To Include=====
#include "unity.h"
#include <setjmp.h>
#include <stdio.h>
char MessageBuffer[50];
//=======External Functions This Runner Calls=====
extern void setUp(void);
extern void tearDown(void);
extern void test_TheFirstThingToTest(void);
extern void test_TheSecondThingToTest(void);
//=======Suite Setup=====
static int suite_setup(void)
{
a_custom_setup();
}
//=======Suite Teardown=====
static int suite_teardown(int num_failures)
{
a_custom_teardown();
}
static void runTest(UnityTestFunction test)
{
if (TEST_PROTECT())
{
setUp();
test();
}
if (TEST_PROTECT() && !TEST_IS_IGNORED)
{
tearDown();
}
}
//=======Test Reset Option=====
void resetTest()
{
tearDown();
......@@ -38,13 +50,12 @@ void resetTest()
}
//=======MAIN=====
int main(void)
{
suite_setup();
Unity.TestFile = "test/testdata/testsample.c";
UnityBegin();
// RUN_TEST calls runTest
RUN_TEST(test_TheFirstThingToTest, 21);
RUN_TEST(test_TheSecondThingToTest, 43);
......
/* AUTOGENERATED FILE. DO NOT EDIT. */
//=======Test Runner Used To Run Each Test Below=====
#define RUN_TEST(TestFunc, TestLineNum) \
{ \
Unity.CurrentTestName = #TestFunc; \
Unity.CurrentTestLineNumber = TestLineNum; \
Unity.NumberOfTests++; \
if (TEST_PROTECT()) \
{ \
setUp(); \
TestFunc(); \
} \
if (TEST_PROTECT() && !TEST_IS_IGNORED) \
{ \
tearDown(); \
} \
UnityConcludeTest(); \
}
//=======Automagically Detected Files To Include=====
#include "unity.h"
#include <setjmp.h>
#include <stdio.h>
char MessageBuffer[50];
//=======External Functions This Runner Calls=====
extern void setUp(void);
extern void tearDown(void);
extern void test_TheFirstThingToTest(void);
extern void test_TheSecondThingToTest(void);
//=======Suite Setup=====
static int suite_setup(void)
{
a_yaml_setup();
}
static void runTest(UnityTestFunction test)
{
if (TEST_PROTECT())
{
setUp();
test();
}
if (TEST_PROTECT() && !TEST_IS_IGNORED)
{
tearDown();
}
}
//=======Test Reset Option=====
void resetTest()
{
tearDown();
......@@ -34,13 +44,12 @@ void resetTest()
}
//=======MAIN=====
int main(void)
{
suite_setup();
Unity.TestFile = "test/testdata/testsample.c";
UnityBegin();
// RUN_TEST calls runTest
RUN_TEST(test_TheFirstThingToTest, 21);
RUN_TEST(test_TheSecondThingToTest, 43);
......
......@@ -6,11 +6,11 @@
ruby_version = RUBY_VERSION.split('.')
if (ruby_version[1].to_i == 9) and (ruby_version[2].to_i > 1)
require 'gems'
require 'rubygems'
gem 'test-unit'
end
require 'test/unit'
require 'auto/generate_test_runner.rb'
require './auto/generate_test_runner.rb'
TEST_FILE = 'test/testdata/testsample.c'
TEST_MOCK = 'test/testdata/mocksample.c'
......@@ -79,4 +79,16 @@ class TestGenerateTestRunner < Test::Unit::TestCase
verify_output_equal('mock_' + subtest)
end
def test_ShouldGenerateARunnerThatUsesParameterizedTests
sets = { 'param' => { :plugins => [:ignore], :use_param_tests => true }
}
sets.each_pair do |subtest, options|
UnityTestRunnerGenerator.new(options).run(TEST_FILE, OUT_FILE + subtest + '.c')
verify_output_equal(subtest)
UnityTestRunnerGenerator.new(options).run(TEST_MOCK, OUT_FILE + 'mock_' + subtest + '.c')
verify_output_equal('mock_' + subtest)
end
end
end
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册