mirror of
https://github.com/ThrowTheSwitch/Unity.git
synced 2025-10-17 12:23:13 +08:00
Merge branch 'feature/cmd_line_args'
This commit is contained in:
@ -22,13 +22,16 @@ class UnityTestRunnerGenerator
|
||||
|
||||
def self.default_options
|
||||
{
|
||||
:includes => [],
|
||||
:plugins => [],
|
||||
:framework => :unity,
|
||||
:test_prefix => "test|spec|should",
|
||||
:setup_name => "setUp",
|
||||
:teardown_name => "tearDown",
|
||||
:main_name => "main",
|
||||
:includes => [],
|
||||
:plugins => [],
|
||||
:framework => :unity,
|
||||
:test_prefix => "test|spec|should",
|
||||
:setup_name => "setUp",
|
||||
:teardown_name => "tearDown",
|
||||
:main_name => "main", #set to :auto to automatically generate each time
|
||||
:main_export_decl => "",
|
||||
:cmdline_args => false,
|
||||
:use_param_tests => false,
|
||||
}
|
||||
end
|
||||
|
||||
@ -233,7 +236,7 @@ class UnityTestRunnerGenerator
|
||||
def create_suite_setup_and_teardown(output)
|
||||
unless (@options[:suite_setup].nil?)
|
||||
output.puts("\n/*=======Suite Setup=====*/")
|
||||
output.puts("static int suite_setup(void)")
|
||||
output.puts("static void suite_setup(void)")
|
||||
output.puts("{")
|
||||
output.puts(@options[:suite_setup])
|
||||
output.puts("}")
|
||||
@ -257,6 +260,7 @@ class UnityTestRunnerGenerator
|
||||
output.puts("{ \\")
|
||||
output.puts(" Unity.CurrentTestName = #TestFunc#{va_args2.empty? ? '' : " \"(\" ##{va_args2} \")\""}; \\")
|
||||
output.puts(" Unity.CurrentTestLineNumber = TestLineNum; \\")
|
||||
output.puts(" if (UnityTestMatches()) { \\") if (@options[:cmdline_args])
|
||||
output.puts(" Unity.NumberOfTests++; \\")
|
||||
output.puts(" CMock_Init(); \\") unless (used_mocks.empty?)
|
||||
output.puts(" UNITY_CLR_DETAILS(); \\") unless (used_mocks.empty?)
|
||||
@ -275,6 +279,7 @@ class UnityTestRunnerGenerator
|
||||
output.puts(" } \\")
|
||||
output.puts(" CMock_Destroy(); \\") unless (used_mocks.empty?)
|
||||
output.puts(" UnityConcludeTest(); \\")
|
||||
output.puts(" } \\") if (@options[:cmdline_args])
|
||||
output.puts("}\n")
|
||||
end
|
||||
|
||||
@ -293,11 +298,46 @@ class UnityTestRunnerGenerator
|
||||
|
||||
def create_main(output, filename, tests, used_mocks)
|
||||
output.puts("\n\n/*=======MAIN=====*/")
|
||||
if (@options[:main_name] != "main")
|
||||
output.puts("int #{@options[:main_name]}(void);")
|
||||
main_name = (@options[:main_name].to_sym == :auto) ? "main_#{filename.gsub('.c','')}" : "#{@options[:main_name]}"
|
||||
if (@options[:cmdline_args])
|
||||
if (main_name != "main")
|
||||
output.puts("#{@options[:main_export_decl]} int #{main_name}(int argc, char** argv);")
|
||||
end
|
||||
output.puts("#{@options[:main_export_decl]} int #{main_name}(int argc, char** argv)")
|
||||
output.puts("{")
|
||||
output.puts(" int parse_status = UnityParseOptions(argc, argv);")
|
||||
output.puts(" if (parse_status != 0)")
|
||||
output.puts(" {")
|
||||
output.puts(" if (parse_status < 0)")
|
||||
output.puts(" {")
|
||||
output.puts(" UnityPrint(\"#{filename.gsub('.c','')}.\");")
|
||||
output.puts(" UNITY_PRINT_EOL();")
|
||||
if (@options[:use_param_tests])
|
||||
tests.each do |test|
|
||||
if ((test[:args].nil?) or (test[:args].empty?))
|
||||
output.puts(" UnityPrint(\" #{test[:test]}(RUN_TEST_NO_ARGS)\");")
|
||||
output.puts(" UNITY_PRINT_EOL();")
|
||||
else
|
||||
test[:args].each do |args|
|
||||
output.puts(" UnityPrint(\" #{test[:test]}(#{args})\");")
|
||||
output.puts(" UNITY_PRINT_EOL();")
|
||||
end
|
||||
end
|
||||
end
|
||||
else
|
||||
tests.each { |test| output.puts(" UnityPrint(\" #{test[:test]}\");\n UNITY_PRINT_EOL();")}
|
||||
end
|
||||
output.puts(" return 0;")
|
||||
output.puts(" }")
|
||||
output.puts(" return parse_status;")
|
||||
output.puts(" }")
|
||||
else
|
||||
if (main_name != "main")
|
||||
output.puts("#{@options[:main_export_decl]} int #{main_name}(void);")
|
||||
end
|
||||
output.puts("int #{main_name}(void)")
|
||||
output.puts("{")
|
||||
end
|
||||
output.puts("int #{@options[:main_name]}(void)")
|
||||
output.puts("{")
|
||||
output.puts(" suite_setup();") unless @options[:suite_setup].nil?
|
||||
output.puts(" UnityBegin(\"#{filename.gsub(/\\/,'\\\\\\')}\");")
|
||||
if (@options[:use_param_tests])
|
||||
|
175
src/unity.c
175
src/unity.c
@ -1300,4 +1300,179 @@ int UnityEnd(void)
|
||||
return (int)(Unity.TestFailures);
|
||||
}
|
||||
|
||||
/*-----------------------------------------------
|
||||
* Command Line Argument Support
|
||||
*-----------------------------------------------*/
|
||||
#ifdef UNITY_USE_COMMAND_LINE_ARGS
|
||||
|
||||
char* UnityOptionIncludeNamed = NULL;
|
||||
char* UnityOptionExcludeNamed = NULL;
|
||||
int UnityVerbosity = 1;
|
||||
|
||||
int UnityParseOptions(int argc, char** argv)
|
||||
{
|
||||
UnityOptionIncludeNamed = NULL;
|
||||
UnityOptionExcludeNamed = NULL;
|
||||
|
||||
for (int i = 1; i < argc; i++)
|
||||
{
|
||||
if (argv[i][0] == '-')
|
||||
{
|
||||
switch(argv[i][1])
|
||||
{
|
||||
case 'l': /* list tests */
|
||||
return -1;
|
||||
case 'n': /* include tests with name including this string */
|
||||
case 'f': /* an alias for -n */
|
||||
if (argv[i][2] == '=')
|
||||
UnityOptionIncludeNamed = &argv[i][3];
|
||||
else if (++i < argc)
|
||||
UnityOptionIncludeNamed = argv[i];
|
||||
else
|
||||
{
|
||||
UnityPrint("ERROR: No Test String to Include Matches For");
|
||||
UNITY_PRINT_EOL();
|
||||
return 1;
|
||||
}
|
||||
break;
|
||||
case 'q': /* quiet */
|
||||
UnityVerbosity = 0;
|
||||
break;
|
||||
case 'v': /* verbose */
|
||||
UnityVerbosity = 2;
|
||||
break;
|
||||
case 'x': /* exclude tests with name including this string */
|
||||
if (argv[i][2] == '=')
|
||||
UnityOptionExcludeNamed = &argv[i][3];
|
||||
else if (++i < argc)
|
||||
UnityOptionExcludeNamed = argv[i];
|
||||
else
|
||||
{
|
||||
UnityPrint("ERROR: No Test String to Exclude Matches For");
|
||||
UNITY_PRINT_EOL();
|
||||
return 1;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
UnityPrint("ERROR: Unknown Option ");
|
||||
UNITY_OUTPUT_CHAR(argv[i][1]);
|
||||
UNITY_PRINT_EOL();
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int IsStringInBiggerString(const char* longstring, const char* shortstring)
|
||||
{
|
||||
char* lptr = (char*)longstring;
|
||||
char* sptr = (char*)shortstring;
|
||||
char* lnext = lptr;
|
||||
|
||||
if (*sptr == '*')
|
||||
return 1;
|
||||
|
||||
while (*lptr)
|
||||
{
|
||||
lnext = lptr + 1;
|
||||
|
||||
/* If they current bytes match, go on to the next bytes */
|
||||
while (*lptr && *sptr && (*lptr == *sptr))
|
||||
{
|
||||
lptr++;
|
||||
sptr++;
|
||||
|
||||
/* We're done if we match the entire string or up to a wildcard */
|
||||
if (*sptr == '*')
|
||||
return 1;
|
||||
if (*sptr == ',')
|
||||
return 1;
|
||||
if (*sptr == '"')
|
||||
return 1;
|
||||
if (*sptr == '\'')
|
||||
return 1;
|
||||
if (*sptr == ':')
|
||||
return 2;
|
||||
if (*sptr == 0)
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Otherwise we start in the long pointer 1 character further and try again */
|
||||
lptr = lnext;
|
||||
sptr = (char*)shortstring;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int UnityStringArgumentMatches(const char* str)
|
||||
{
|
||||
int retval;
|
||||
const char* ptr1;
|
||||
const char* ptr2;
|
||||
const char* ptrf;
|
||||
|
||||
//Go through the options and get the substrings for matching one at a time
|
||||
ptr1 = str;
|
||||
while (ptr1[0] != 0)
|
||||
{
|
||||
if ((ptr1[0] == '"') || (ptr1[0] == '\''))
|
||||
ptr1++;
|
||||
|
||||
//look for the start of the next partial
|
||||
ptr2 = ptr1;
|
||||
ptrf = 0;
|
||||
do {
|
||||
ptr2++;
|
||||
if ((ptr2[0] == ':') && (ptr2[1] != 0) && (ptr2[0] != '\'') && (ptr2[0] != '"') && (ptr2[0] != ','))
|
||||
ptrf = &ptr2[1];
|
||||
} while ((ptr2[0] != 0) && (ptr2[0] != '\'') && (ptr2[0] != '"') && (ptr2[0] != ','));
|
||||
while ((ptr2[0] != 0) && ((ptr2[0] == ':') || (ptr2[0] == '\'') || (ptr2[0] == '"') || (ptr2[0] == ',')))
|
||||
ptr2++;
|
||||
|
||||
//done if complete filename match
|
||||
retval = IsStringInBiggerString(Unity.TestFile, ptr1);
|
||||
if (retval == 1)
|
||||
return retval;
|
||||
|
||||
//done if testname match after filename partial match
|
||||
if ((retval == 2) && (ptrf != 0))
|
||||
{
|
||||
if (IsStringInBiggerString(Unity.CurrentTestName, ptrf))
|
||||
return 1;
|
||||
}
|
||||
|
||||
//done if complete testname match
|
||||
if (IsStringInBiggerString(Unity.CurrentTestName, ptr1) == 1)
|
||||
return 1;
|
||||
|
||||
ptr1 = ptr2;
|
||||
}
|
||||
|
||||
//we couldn't find a match for any substrings
|
||||
return 0;
|
||||
}
|
||||
|
||||
int UnityTestMatches(void)
|
||||
{
|
||||
/* Check if this test name matches the included test pattern */
|
||||
int retval;
|
||||
if (UnityOptionIncludeNamed)
|
||||
{
|
||||
retval = UnityStringArgumentMatches(UnityOptionIncludeNamed);
|
||||
}
|
||||
else
|
||||
retval = 1;
|
||||
|
||||
/* Check if this test name matches the excluded test pattern */
|
||||
if (UnityOptionExcludeNamed)
|
||||
{
|
||||
if (UnityStringArgumentMatches(UnityOptionExcludeNamed))
|
||||
retval = 0;
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
#endif /* UNITY_USE_COMMAND_LINE_ARGS */
|
||||
/*-----------------------------------------------*/
|
||||
|
@ -60,6 +60,9 @@ void tearDown(void);
|
||||
* Parameterized Tests
|
||||
* - you'll want to create a define of TEST_CASE(...) which basically evaluates to nothing
|
||||
|
||||
* Tests with Arguments
|
||||
* - you'll want to define UNITY_USE_COMMAND_LINE_ARGS if you have the test runner passing arguments to Unity
|
||||
|
||||
*-------------------------------------------------------
|
||||
* Basic Fail and Ignore
|
||||
*-------------------------------------------------------*/
|
||||
|
@ -640,6 +640,15 @@ extern const char UnityStrErr64[];
|
||||
|
||||
#define UNITY_UNUSED(x) (void)(sizeof(x))
|
||||
|
||||
/*-----------------------------------------------
|
||||
* Command Line Argument Support
|
||||
*-----------------------------------------------*/
|
||||
|
||||
#ifdef UNITY_USE_COMMAND_LINE_ARGS
|
||||
int UnityParseOptions(int argc, char** argv);
|
||||
int UnityTestMatches(void);
|
||||
#endif
|
||||
|
||||
/*-------------------------------------------------------
|
||||
* Basic Fail and Ignore
|
||||
*-------------------------------------------------------*/
|
||||
|
@ -5,6 +5,7 @@
|
||||
# ==========================================
|
||||
|
||||
UNITY_ROOT = File.expand_path(File.dirname(__FILE__)) + '/'
|
||||
$verbose = false
|
||||
|
||||
require 'rake'
|
||||
require 'rake/clean'
|
||||
@ -58,3 +59,7 @@ end
|
||||
task :no_color do
|
||||
$colour_output = false
|
||||
end
|
||||
|
||||
task :verbose do
|
||||
$verbose = true
|
||||
end
|
||||
|
@ -92,12 +92,12 @@ module RakefileHelpers
|
||||
end
|
||||
end
|
||||
|
||||
def build_compiler_fields
|
||||
def build_compiler_fields(inject_defines)
|
||||
command = tackit($cfg['compiler']['path'])
|
||||
if $cfg['compiler']['defines']['items'].nil?
|
||||
defines = ''
|
||||
else
|
||||
defines = squash($cfg['compiler']['defines']['prefix'], $cfg['compiler']['defines']['items'] + ['UNITY_OUTPUT_CHAR=putcharSpy'])
|
||||
defines = squash($cfg['compiler']['defines']['prefix'], $cfg['compiler']['defines']['items'] + ['UNITY_OUTPUT_CHAR=putcharSpy'] + inject_defines)
|
||||
end
|
||||
options = squash('', $cfg['compiler']['options'])
|
||||
includes = squash($cfg['compiler']['includes']['prefix'], $cfg['compiler']['includes']['items'])
|
||||
@ -106,7 +106,8 @@ module RakefileHelpers
|
||||
end
|
||||
|
||||
def compile(file, defines=[])
|
||||
compiler = build_compiler_fields
|
||||
compiler = build_compiler_fields(defines)
|
||||
defines =
|
||||
cmd_str = "#{compiler[:command]}#{compiler[:defines]}#{compiler[:options]}#{compiler[:includes]} #{file} " +
|
||||
"#{$cfg['compiler']['object_files']['prefix']}#{$cfg['compiler']['object_files']['destination']}"
|
||||
obj_file = "#{File.basename(file, C_EXTENSION)}#{$cfg['compiler']['object_files']['extension']}"
|
||||
@ -160,11 +161,11 @@ module RakefileHelpers
|
||||
return {:command => command, :pre_support => pre_support, :post_support => post_support}
|
||||
end
|
||||
|
||||
def execute(command_string, verbose=true)
|
||||
report command_string
|
||||
def execute(command_string, ok_to_fail=false)
|
||||
report command_string if $verbose
|
||||
output = `#{command_string}`.chomp
|
||||
report(output) if (verbose && !output.nil? && (output.length > 0))
|
||||
if $?.exitstatus != 0
|
||||
report(output) if ($verbose && !output.nil? && (output.length > 0))
|
||||
if (($?.exitstatus != 0) && !ok_to_fail)
|
||||
raise "Command failed. (Returned #{$?.exitstatus})"
|
||||
end
|
||||
return output
|
||||
@ -246,6 +247,7 @@ module RakefileHelpers
|
||||
if output.match(/OK$/m).nil?
|
||||
test_results += '.testfail'
|
||||
else
|
||||
report output if (!$verbose) #verbose already prints this line, as does a failure
|
||||
test_results += '.testpass'
|
||||
end
|
||||
File.open(test_results, 'w') { |f| f.print output }
|
||||
|
@ -53,6 +53,7 @@ compiler:
|
||||
items:
|
||||
- 'src/'
|
||||
- '../src/'
|
||||
- 'testdata/'
|
||||
- *unit_tests_path
|
||||
defines:
|
||||
prefix: '-D'
|
||||
|
@ -53,6 +53,7 @@ compiler:
|
||||
items:
|
||||
- 'src/'
|
||||
- '../src/'
|
||||
- 'testdata/'
|
||||
- *unit_tests_path
|
||||
defines:
|
||||
prefix: '-D'
|
||||
|
@ -15,6 +15,7 @@ compiler:
|
||||
items:
|
||||
- 'src/'
|
||||
- '../src/'
|
||||
- 'testdata/'
|
||||
- *unit_tests_path
|
||||
defines:
|
||||
prefix: '-D'
|
||||
|
@ -15,6 +15,7 @@ compiler:
|
||||
items:
|
||||
- 'src/'
|
||||
- '../src/'
|
||||
- 'testdata/'
|
||||
- *unit_tests_path
|
||||
defines:
|
||||
prefix: '-D'
|
||||
|
@ -15,6 +15,7 @@ compiler:
|
||||
items:
|
||||
- 'src/'
|
||||
- '../src/'
|
||||
- 'testdata/'
|
||||
- *unit_tests_path
|
||||
defines:
|
||||
prefix: '-D'
|
||||
|
@ -15,6 +15,7 @@ compiler:
|
||||
items:
|
||||
- 'src/'
|
||||
- '../src/'
|
||||
- 'testdata/'
|
||||
- *unit_tests_path
|
||||
defines:
|
||||
prefix: '-D'
|
||||
|
@ -28,6 +28,7 @@ compiler:
|
||||
items:
|
||||
- 'src/'
|
||||
- '../src/'
|
||||
- 'testdata/'
|
||||
- *unit_tests_path
|
||||
defines:
|
||||
prefix: '-D'
|
||||
|
@ -15,6 +15,7 @@ compiler:
|
||||
items:
|
||||
- 'src/'
|
||||
- '../src/'
|
||||
- 'testdata/'
|
||||
- *unit_tests_path
|
||||
defines:
|
||||
prefix: '-D'
|
||||
|
@ -32,6 +32,7 @@ compiler:
|
||||
- [*tools_root, 'arm\inc\']
|
||||
- 'src\'
|
||||
- '..\src\'
|
||||
- 'testdata/'
|
||||
- *unit_tests_path
|
||||
- 'vendor\unity\src\'
|
||||
defines:
|
||||
|
@ -31,6 +31,7 @@ compiler:
|
||||
- [*tools_root, 'arm\inc\']
|
||||
- 'src\'
|
||||
- '..\src\'
|
||||
- 'testdata/'
|
||||
- *unit_tests_path
|
||||
- 'vendor\unity\src\'
|
||||
- 'iar\iar_v5\incIAR\'
|
||||
|
@ -31,6 +31,7 @@ compiler:
|
||||
- [*tools_root, 'arm\inc\']
|
||||
- 'src\'
|
||||
- '..\src\'
|
||||
- 'testdata/'
|
||||
- *unit_tests_path
|
||||
- 'vendor\unity\src\'
|
||||
- 'iar\iar_v5\incIAR\'
|
||||
|
@ -35,6 +35,7 @@ compiler:
|
||||
- [*tools_root, 'arm\inc\']
|
||||
- 'src\'
|
||||
- '..\src\'
|
||||
- 'testdata/'
|
||||
- *unit_tests_path
|
||||
- 'vendor\unity\src\'
|
||||
- 'iar\iar_v5\incIAR\'
|
||||
|
@ -33,6 +33,7 @@ compiler:
|
||||
- [*tools_root, 'arm\inc\']
|
||||
- 'src\'
|
||||
- '..\src\'
|
||||
- 'testdata/'
|
||||
- *unit_tests_path
|
||||
- 'vendor\unity\src\'
|
||||
- 'iar\iar_v5\incIAR\'
|
||||
|
@ -34,6 +34,7 @@ compiler:
|
||||
- [*core_lib, 'dlib']
|
||||
- 'src\'
|
||||
- '../src/'
|
||||
- 'testdata/'
|
||||
- *unit_tests_path
|
||||
- 'vendor\unity\src'
|
||||
defines:
|
||||
|
@ -34,6 +34,7 @@ compiler:
|
||||
- [*tools_root, 'sh\inc\c']
|
||||
- 'src\'
|
||||
- '..\src\'
|
||||
- 'testdata/'
|
||||
- *unit_tests_path
|
||||
- 'vendor\unity\src\'
|
||||
defines:
|
||||
|
11
test/testdata/CException.h
vendored
Normal file
11
test/testdata/CException.h
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
#ifndef CEXCEPTION_H
|
||||
#define CEXCEPTION_H
|
||||
|
||||
#define CEXCEPTION_BEING_USED 1
|
||||
|
||||
#define CEXCEPTION_NONE 0
|
||||
#define CEXCEPTION_T int e = 1; (void)
|
||||
#define Try if (e)
|
||||
#define Catch(a) if (!a)
|
||||
|
||||
#endif //CEXCEPTION_H
|
8
test/testdata/Defs.h
vendored
Normal file
8
test/testdata/Defs.h
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
#ifndef DEF_H
|
||||
#define DEF_H
|
||||
|
||||
#define EXTERN_DECL
|
||||
|
||||
extern int CounterSuiteSetup;
|
||||
|
||||
#endif //DEF_H
|
14
test/testdata/cmock.h
vendored
Normal file
14
test/testdata/cmock.h
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
#ifndef CMOCK_H
|
||||
#define CMOCK_H
|
||||
|
||||
int CMockMemFreeFinalCounter = 0;
|
||||
int mockMock_Init_Counter = 0;
|
||||
int mockMock_Verify_Counter = 0;
|
||||
int mockMock_Destroy_Counter = 0;
|
||||
|
||||
void CMock_Guts_MemFreeFinal(void) { CMockMemFreeFinalCounter++; }
|
||||
void mockMock_Init(void) { mockMock_Init_Counter++; }
|
||||
void mockMock_Verify(void) { mockMock_Verify_Counter++; }
|
||||
void mockMock_Destroy(void) { mockMock_Destroy_Counter++; }
|
||||
|
||||
#endif //CMOCK_H
|
13
test/testdata/mockMock.h
vendored
Normal file
13
test/testdata/mockMock.h
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
#ifndef MOCK_MOCK_H
|
||||
#define MOCK_MOCK_H
|
||||
|
||||
extern int mockMock_Init_Counter;
|
||||
extern int mockMock_Verify_Counter;
|
||||
extern int mockMock_Destroy_Counter;
|
||||
extern int CMockMemFreeFinalCounter;
|
||||
|
||||
void mockMock_Init(void);
|
||||
void mockMock_Verify(void);
|
||||
void mockMock_Destroy(void);
|
||||
|
||||
#endif //MOCK_MOCK_H
|
51
test/testdata/mocksample.c
vendored
51
test/testdata/mocksample.c
vendored
@ -1,51 +0,0 @@
|
||||
// This is just a sample test file to be used to test the generator script
|
||||
#ifndef TEST_SAMPLE_H
|
||||
#define TEST_SAMPLE_H
|
||||
|
||||
#include <setjmp.h>
|
||||
#include "unity.h"
|
||||
#include "funky.h"
|
||||
#include "Mockstanky.h"
|
||||
|
||||
void setUp(void)
|
||||
{
|
||||
CustomSetupStuff();
|
||||
}
|
||||
|
||||
void tearDown(void)
|
||||
{
|
||||
CustomTeardownStuff
|
||||
}
|
||||
|
||||
//Yup, nice comment
|
||||
void test_TheFirstThingToTest(void)
|
||||
{
|
||||
TEST_ASSERT(1);
|
||||
|
||||
TEST_ASSERT_TRUE(1);
|
||||
}
|
||||
|
||||
/*
|
||||
void test_ShouldBeIgnored(void)
|
||||
{
|
||||
DoesStuff();
|
||||
}
|
||||
*/
|
||||
|
||||
//void test_ShouldAlsoNotBeTested(void)
|
||||
//{
|
||||
// Call_An_Expect();
|
||||
//
|
||||
// CallAFunction();
|
||||
// test_CallAFunctionThatLooksLikeATest();
|
||||
//}
|
||||
|
||||
void test_TheSecondThingToTest(void)
|
||||
{
|
||||
Call_An_Expect();
|
||||
|
||||
CallAFunction();
|
||||
test_CallAFunctionThatLooksLikeATest();
|
||||
}
|
||||
|
||||
#endif //TEST_SAMPLE_H
|
9
test/testdata/sample.yml
vendored
9
test/testdata/sample.yml
vendored
@ -1,9 +0,0 @@
|
||||
:unity:
|
||||
:includes:
|
||||
- two.h
|
||||
- three.h
|
||||
- <four.h>
|
||||
:plugins:
|
||||
- :cexception
|
||||
:suite_setup: |
|
||||
a_yaml_setup();
|
183
test/testdata/testRunnerGenerator.c
vendored
Normal file
183
test/testdata/testRunnerGenerator.c
vendored
Normal file
@ -0,0 +1,183 @@
|
||||
/* This Test File Is Used To Verify Many Combinations Of Using the Generate Test Runner Script */
|
||||
|
||||
#include <stdio.h>
|
||||
#include "unity.h"
|
||||
#include "Defs.h"
|
||||
|
||||
#ifdef USE_CEXCEPTION
|
||||
#include "CException.h"
|
||||
#endif
|
||||
|
||||
/* Notes about prefixes:
|
||||
test - normal default prefix. these are "always run" tests for this procedure
|
||||
spec - normal default prefix. required to run default setup/teardown calls.
|
||||
should - normal default prefix.
|
||||
qwiktest - custom prefix for when tests skip all setup/teardown calls.
|
||||
custtest - custom prefix for when tests use custom setup/teardown calls.
|
||||
paratest - custom prefix for when we want to verify parameterized tests.
|
||||
extest - custom prefix only used during cexception
|
||||
suitetest- custom prefix for when we want to use custom suite setup/teardown
|
||||
*/
|
||||
|
||||
/* Support for Meta Test Rig */
|
||||
#define TEST_CASE(a)
|
||||
void putcharSpy(int c) { (void)putchar(c);} // include passthrough for linking tests
|
||||
|
||||
/* Global Variables Used During These Tests */
|
||||
int CounterSetup = 0;
|
||||
int CounterTeardown = 0;
|
||||
int CounterSuiteSetup = 0;
|
||||
|
||||
void setUp(void)
|
||||
{
|
||||
CounterSetup = 1;
|
||||
}
|
||||
|
||||
void tearDown(void)
|
||||
{
|
||||
CounterTeardown = 1;
|
||||
}
|
||||
|
||||
void custom_setup(void)
|
||||
{
|
||||
CounterSetup = 2;
|
||||
}
|
||||
|
||||
void custom_teardown(void)
|
||||
{
|
||||
CounterTeardown = 2;
|
||||
}
|
||||
|
||||
/*
|
||||
void test_OldSchoolCommentsShouldBeIgnored(void)
|
||||
{
|
||||
TEST_ASSERT_FAIL("Old-School Comments Should Be Ignored");
|
||||
}
|
||||
*/
|
||||
|
||||
void test_ThisTestAlwaysPasses(void)
|
||||
{
|
||||
TEST_PASS();
|
||||
}
|
||||
|
||||
void test_ThisTestAlwaysFails(void)
|
||||
{
|
||||
TEST_FAIL_MESSAGE("This Test Should Fail");
|
||||
}
|
||||
|
||||
void test_ThisTestAlwaysIgnored(void)
|
||||
{
|
||||
TEST_IGNORE_MESSAGE("This Test Should Be Ignored");
|
||||
}
|
||||
|
||||
void qwiktest_ThisTestPassesWhenNoSetupRan(void)
|
||||
{
|
||||
TEST_ASSERT_EQUAL_MESSAGE(0, CounterSetup, "Setup Was Unexpectedly Run");
|
||||
}
|
||||
|
||||
void qwiktest_ThisTestPassesWhenNoTeardownRan(void)
|
||||
{
|
||||
TEST_ASSERT_EQUAL_MESSAGE(0, CounterTeardown, "Teardown Was Unexpectedly Run");
|
||||
}
|
||||
|
||||
void spec_ThisTestPassesWhenNormalSuiteSetupAndTeardownRan(void)
|
||||
{
|
||||
TEST_ASSERT_EQUAL_MESSAGE(0, CounterSuiteSetup, "Suite Setup Was Unexpectedly Run");
|
||||
}
|
||||
|
||||
void spec_ThisTestPassesWhenNormalSetupRan(void)
|
||||
{
|
||||
TEST_ASSERT_EQUAL_MESSAGE(1, CounterSetup, "Normal Setup Wasn't Run");
|
||||
}
|
||||
|
||||
void spec_ThisTestPassesWhenNormalTeardownRan(void)
|
||||
{
|
||||
TEST_ASSERT_EQUAL_MESSAGE(1, CounterTeardown, "Normal Teardown Wasn't Run");
|
||||
}
|
||||
|
||||
void custtest_ThisTestPassesWhenCustomSetupRan(void)
|
||||
{
|
||||
TEST_ASSERT_EQUAL_MESSAGE(2, CounterSetup, "Custom Setup Wasn't Run");
|
||||
}
|
||||
|
||||
void custtest_ThisTestPassesWhenCustomTeardownRan(void)
|
||||
{
|
||||
TEST_ASSERT_EQUAL_MESSAGE(2, CounterTeardown, "Custom Teardown Wasn't Run");
|
||||
}
|
||||
|
||||
//void test_NewStyleCommentsShouldBeIgnored(void)
|
||||
//{
|
||||
// TEST_ASSERT_FAIL("New Style Comments Should Be Ignored");
|
||||
//}
|
||||
|
||||
void test_NotBeConfusedByLongComplicatedStrings(void)
|
||||
{
|
||||
const char* crazyString = "GET / HTTP/1.1\r\nHost: 127.0.0.1:8081\r\nConnection: keep-alive\r\nCache-Control: no-cache\r\nUser-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36\r\nPostman-Token: 768c7149-c3fb-f704-71a2-63918d9195b2\r\nAccept: */*\r\nAccept-Encoding: gzip, deflate, sdch\r\nAccept-Language: en-GB,en-US;q=0.8,en;q=0.6\r\n\r\n";
|
||||
|
||||
TEST_ASSERT_EQUAL_STRING_MESSAGE(crazyString, crazyString, "These Strings Are The Same");
|
||||
}
|
||||
|
||||
void test_NotDisappearJustBecauseTheTestBeforeAndAfterHaveCrazyStrings(void)
|
||||
{
|
||||
TEST_ASSERT_TRUE_MESSAGE(1, "1 Should be True");
|
||||
}
|
||||
|
||||
void test_StillNotBeConfusedByLongComplicatedStrings(void)
|
||||
{
|
||||
const char* crazyString = "GET / HTTP/1.1\r\nHost: 127.0.0.1:8081\r\nConnection: keep-alive\r\nCache-Control: no-cache\r\nUser-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36\r\nPostman-Token: 768c7149-c3fb-f704-71a2-63918d9195b2\r\nAccept: */*\r\nAccept-Encoding: gzip, deflate, sdch\r\nAccept-Language: en-GB,en-US;q=0.8,en;q=0.6\r\n\r\n";
|
||||
|
||||
TEST_ASSERT_EQUAL_STRING_MESSAGE(crazyString, crazyString, "These Strings Are Still The Same");
|
||||
}
|
||||
|
||||
void should_RunTestsStartingWithShouldByDefault(void)
|
||||
{
|
||||
TEST_ASSERT_TRUE_MESSAGE(1, "1 Should be True");
|
||||
}
|
||||
|
||||
TEST_CASE(25)
|
||||
TEST_CASE(125)
|
||||
TEST_CASE(5)
|
||||
void paratest_ShouldHandleParameterizedTests(int Num)
|
||||
{
|
||||
TEST_ASSERT_EQUAL_MESSAGE(0, (Num % 5), "All The Values Are Divisible By 5");
|
||||
}
|
||||
|
||||
TEST_CASE(7)
|
||||
void paratest_ShouldHandleParameterizedTests2(int Num)
|
||||
{
|
||||
TEST_ASSERT_EQUAL_MESSAGE(7, Num, "The Only Call To This Passes");
|
||||
}
|
||||
|
||||
void paratest_ShouldHandleNonParameterizedTestsWhenParameterizationValid(void)
|
||||
{
|
||||
TEST_PASS();
|
||||
}
|
||||
|
||||
TEST_CASE(17)
|
||||
void paratest_ShouldHandleParameterizedTestsThatFail(int Num)
|
||||
{
|
||||
TEST_ASSERT_EQUAL_MESSAGE(3, Num, "This call should fail");
|
||||
}
|
||||
|
||||
#ifdef USE_CEXCEPTION
|
||||
void extest_ShouldHandleCExceptionInTest(void)
|
||||
{
|
||||
TEST_ASSERT_EQUAL_MESSAGE(1, CEXCEPTION_BEING_USED, "Should be pulling in CException");
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef USE_ANOTHER_MAIN
|
||||
int custom_main(void);
|
||||
|
||||
int main(void)
|
||||
{
|
||||
return custom_main();
|
||||
}
|
||||
#endif
|
||||
|
||||
void suitetest_ThisTestPassesWhenCustomSuiteSetupAndTeardownRan(void)
|
||||
{
|
||||
TEST_ASSERT_EQUAL_MESSAGE(1, CounterSuiteSetup, "Suite Setup Should Have Run");
|
||||
}
|
||||
|
||||
|
65
test/testdata/testRunnerGeneratorSmall.c
vendored
Normal file
65
test/testdata/testRunnerGeneratorSmall.c
vendored
Normal file
@ -0,0 +1,65 @@
|
||||
/* This Test File Is Used To Verify Many Combinations Of Using the Generate Test Runner Script */
|
||||
|
||||
#include <stdio.h>
|
||||
#include "unity.h"
|
||||
#include "Defs.h"
|
||||
|
||||
/* Notes about prefixes:
|
||||
test - normal default prefix. these are "always run" tests for this procedure
|
||||
spec - normal default prefix. required to run default setup/teardown calls.
|
||||
*/
|
||||
|
||||
/* Support for Meta Test Rig */
|
||||
#define TEST_CASE(a)
|
||||
void putcharSpy(int c) { (void)putchar(c);} // include passthrough for linking tests
|
||||
|
||||
/* Global Variables Used During These Tests */
|
||||
int CounterSetup = 0;
|
||||
int CounterTeardown = 0;
|
||||
int CounterSuiteSetup = 0;
|
||||
|
||||
void setUp(void)
|
||||
{
|
||||
CounterSetup = 1;
|
||||
}
|
||||
|
||||
void tearDown(void)
|
||||
{
|
||||
CounterTeardown = 1;
|
||||
}
|
||||
|
||||
void custom_setup(void)
|
||||
{
|
||||
CounterSetup = 2;
|
||||
}
|
||||
|
||||
void custom_teardown(void)
|
||||
{
|
||||
CounterTeardown = 2;
|
||||
}
|
||||
|
||||
void test_ThisTestAlwaysPasses(void)
|
||||
{
|
||||
TEST_PASS();
|
||||
}
|
||||
|
||||
void test_ThisTestAlwaysFails(void)
|
||||
{
|
||||
TEST_FAIL_MESSAGE("This Test Should Fail");
|
||||
}
|
||||
|
||||
void test_ThisTestAlwaysIgnored(void)
|
||||
{
|
||||
TEST_IGNORE_MESSAGE("This Test Should Be Ignored");
|
||||
}
|
||||
|
||||
void spec_ThisTestPassesWhenNormalSetupRan(void)
|
||||
{
|
||||
TEST_ASSERT_EQUAL_MESSAGE(1, CounterSetup, "Normal Setup Wasn't Run");
|
||||
}
|
||||
|
||||
void spec_ThisTestPassesWhenNormalTeardownRan(void)
|
||||
{
|
||||
TEST_ASSERT_EQUAL_MESSAGE(1, CounterTeardown, "Normal Teardown Wasn't Run");
|
||||
}
|
||||
|
192
test/testdata/testRunnerGeneratorWithMocks.c
vendored
Normal file
192
test/testdata/testRunnerGeneratorWithMocks.c
vendored
Normal file
@ -0,0 +1,192 @@
|
||||
/* This Test File Is Used To Verify Many Combinations Of Using the Generate Test Runner Script */
|
||||
|
||||
#include <stdio.h>
|
||||
#include "unity.h"
|
||||
#include "Defs.h"
|
||||
#include "mockMock.h"
|
||||
|
||||
#ifdef USE_CEXCEPTION
|
||||
#include "CException.h"
|
||||
#endif
|
||||
|
||||
/* Notes about prefixes:
|
||||
test - normal default prefix. these are "always run" tests for this procedure
|
||||
spec - normal default prefix. required to run default setup/teardown calls.
|
||||
should - normal default prefix.
|
||||
qwiktest - custom prefix for when tests skip all setup/teardown calls.
|
||||
custtest - custom prefix for when tests use custom setup/teardown calls.
|
||||
paratest - custom prefix for when we want to verify parameterized tests.
|
||||
extest - custom prefix only used during cexception
|
||||
suitetest- custom prefix for when we want to use custom suite setup/teardown
|
||||
*/
|
||||
|
||||
/* Support for Meta Test Rig */
|
||||
#define TEST_CASE(a)
|
||||
void putcharSpy(int c) { (void)putchar(c);} // include passthrough for linking tests
|
||||
|
||||
/* Global Variables Used During These Tests */
|
||||
int CounterSetup = 0;
|
||||
int CounterTeardown = 0;
|
||||
int CounterSuiteSetup = 0;
|
||||
|
||||
void setUp(void)
|
||||
{
|
||||
CounterSetup = 1;
|
||||
}
|
||||
|
||||
void tearDown(void)
|
||||
{
|
||||
CounterTeardown = 1;
|
||||
}
|
||||
|
||||
void custom_setup(void)
|
||||
{
|
||||
CounterSetup = 2;
|
||||
}
|
||||
|
||||
void custom_teardown(void)
|
||||
{
|
||||
CounterTeardown = 2;
|
||||
}
|
||||
|
||||
/*
|
||||
void test_OldSchoolCommentsShouldBeIgnored(void)
|
||||
{
|
||||
TEST_ASSERT_FAIL("Old-School Comments Should Be Ignored");
|
||||
}
|
||||
*/
|
||||
|
||||
void test_ThisTestAlwaysPasses(void)
|
||||
{
|
||||
TEST_PASS();
|
||||
}
|
||||
|
||||
void test_ThisTestAlwaysFails(void)
|
||||
{
|
||||
TEST_FAIL_MESSAGE("This Test Should Fail");
|
||||
}
|
||||
|
||||
void test_ThisTestAlwaysIgnored(void)
|
||||
{
|
||||
TEST_IGNORE_MESSAGE("This Test Should Be Ignored");
|
||||
}
|
||||
|
||||
void qwiktest_ThisTestPassesWhenNoSetupRan(void)
|
||||
{
|
||||
TEST_ASSERT_EQUAL_MESSAGE(0, CounterSetup, "Setup Was Unexpectedly Run");
|
||||
}
|
||||
|
||||
void qwiktest_ThisTestPassesWhenNoTeardownRan(void)
|
||||
{
|
||||
TEST_ASSERT_EQUAL_MESSAGE(0, CounterTeardown, "Teardown Was Unexpectedly Run");
|
||||
}
|
||||
|
||||
void spec_ThisTestPassesWhenNormalSuiteSetupAndTeardownRan(void)
|
||||
{
|
||||
TEST_ASSERT_EQUAL_MESSAGE(0, CounterSuiteSetup, "Suite Setup Was Unexpectedly Run");
|
||||
}
|
||||
|
||||
void spec_ThisTestPassesWhenNormalSetupRan(void)
|
||||
{
|
||||
TEST_ASSERT_EQUAL_MESSAGE(1, CounterSetup, "Normal Setup Wasn't Run");
|
||||
}
|
||||
|
||||
void spec_ThisTestPassesWhenNormalTeardownRan(void)
|
||||
{
|
||||
TEST_ASSERT_EQUAL_MESSAGE(1, CounterTeardown, "Normal Teardown Wasn't Run");
|
||||
}
|
||||
|
||||
void custtest_ThisTestPassesWhenCustomSetupRan(void)
|
||||
{
|
||||
TEST_ASSERT_EQUAL_MESSAGE(2, CounterSetup, "Custom Setup Wasn't Run");
|
||||
}
|
||||
|
||||
void custtest_ThisTestPassesWhenCustomTeardownRan(void)
|
||||
{
|
||||
TEST_ASSERT_EQUAL_MESSAGE(2, CounterTeardown, "Custom Teardown Wasn't Run");
|
||||
}
|
||||
|
||||
//void test_NewStyleCommentsShouldBeIgnored(void)
|
||||
//{
|
||||
// TEST_ASSERT_FAIL("New Style Comments Should Be Ignored");
|
||||
//}
|
||||
|
||||
void test_NotBeConfusedByLongComplicatedStrings(void)
|
||||
{
|
||||
const char* crazyString = "GET / HTTP/1.1\r\nHost: 127.0.0.1:8081\r\nConnection: keep-alive\r\nCache-Control: no-cache\r\nUser-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36\r\nPostman-Token: 768c7149-c3fb-f704-71a2-63918d9195b2\r\nAccept: */*\r\nAccept-Encoding: gzip, deflate, sdch\r\nAccept-Language: en-GB,en-US;q=0.8,en;q=0.6\r\n\r\n";
|
||||
|
||||
TEST_ASSERT_EQUAL_STRING_MESSAGE(crazyString, crazyString, "These Strings Are The Same");
|
||||
}
|
||||
|
||||
void test_NotDisappearJustBecauseTheTestBeforeAndAfterHaveCrazyStrings(void)
|
||||
{
|
||||
TEST_ASSERT_TRUE_MESSAGE(1, "1 Should be True");
|
||||
}
|
||||
|
||||
void test_StillNotBeConfusedByLongComplicatedStrings(void)
|
||||
{
|
||||
const char* crazyString = "GET / HTTP/1.1\r\nHost: 127.0.0.1:8081\r\nConnection: keep-alive\r\nCache-Control: no-cache\r\nUser-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36\r\nPostman-Token: 768c7149-c3fb-f704-71a2-63918d9195b2\r\nAccept: */*\r\nAccept-Encoding: gzip, deflate, sdch\r\nAccept-Language: en-GB,en-US;q=0.8,en;q=0.6\r\n\r\n";
|
||||
|
||||
TEST_ASSERT_EQUAL_STRING_MESSAGE(crazyString, crazyString, "These Strings Are Still The Same");
|
||||
}
|
||||
|
||||
void should_RunTestsStartingWithShouldByDefault(void)
|
||||
{
|
||||
TEST_ASSERT_TRUE_MESSAGE(1, "1 Should be True");
|
||||
}
|
||||
|
||||
TEST_CASE(25)
|
||||
TEST_CASE(125)
|
||||
TEST_CASE(5)
|
||||
void paratest_ShouldHandleParameterizedTests(int Num)
|
||||
{
|
||||
TEST_ASSERT_EQUAL_MESSAGE(0, (Num % 5), "All The Values Are Divisible By 5");
|
||||
}
|
||||
|
||||
TEST_CASE(7)
|
||||
void paratest_ShouldHandleParameterizedTests2(int Num)
|
||||
{
|
||||
TEST_ASSERT_EQUAL_MESSAGE(7, Num, "The Only Call To This Passes");
|
||||
}
|
||||
|
||||
void paratest_ShouldHandleNonParameterizedTestsWhenParameterizationValid(void)
|
||||
{
|
||||
TEST_PASS();
|
||||
}
|
||||
|
||||
TEST_CASE(17)
|
||||
void paratest_ShouldHandleParameterizedTestsThatFail(int Num)
|
||||
{
|
||||
TEST_ASSERT_EQUAL_MESSAGE(3, Num, "This call should fail");
|
||||
}
|
||||
|
||||
#ifdef USE_CEXCEPTION
|
||||
void extest_ShouldHandleCExceptionInTest(void)
|
||||
{
|
||||
TEST_ASSERT_EQUAL_MESSAGE(1, CEXCEPTION_BEING_USED, "Should be pulling in CException");
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef USE_ANOTHER_MAIN
|
||||
int custom_main(void);
|
||||
|
||||
int main(void)
|
||||
{
|
||||
return custom_main();
|
||||
}
|
||||
#endif
|
||||
|
||||
void suitetest_ThisTestPassesWhenCustomSuiteSetupAndTeardownRan(void)
|
||||
{
|
||||
TEST_ASSERT_EQUAL_MESSAGE(1, CounterSuiteSetup, "Suite Setup Should Have Run");
|
||||
}
|
||||
|
||||
void test_ShouldCallMockInitAndVerifyFunctionsForEachTest(void)
|
||||
{
|
||||
int passes = (int)(Unity.NumberOfTests - Unity.TestFailures - Unity.TestIgnores);
|
||||
TEST_ASSERT_EQUAL_MESSAGE(Unity.NumberOfTests, mockMock_Init_Counter, "Mock Init Should Be Called Once Per Test Started");
|
||||
TEST_ASSERT_EQUAL_MESSAGE(passes, mockMock_Verify_Counter, "Mock Verify Should Be Called Once Per Test Passed");
|
||||
TEST_ASSERT_EQUAL_MESSAGE(Unity.NumberOfTests - 1, mockMock_Destroy_Counter, "Mock Destroy Should Be Called Once Per Test Completed");
|
||||
TEST_ASSERT_EQUAL_MESSAGE(0, CMockMemFreeFinalCounter, "Mock MemFreeFinal Should Not Be Called Until End");
|
||||
}
|
||||
|
68
test/testdata/testsample.c
vendored
68
test/testdata/testsample.c
vendored
@ -1,68 +0,0 @@
|
||||
// This is just a sample test file to be used to test the generator script
|
||||
#ifndef TEST_SAMPLE_H
|
||||
#define TEST_SAMPLE_H
|
||||
|
||||
#include <setjmp.h>
|
||||
#include "unity.h"
|
||||
#include "funky.h"
|
||||
#include "stanky.h"
|
||||
|
||||
void setUp(void)
|
||||
{
|
||||
CustomSetupStuff();
|
||||
}
|
||||
|
||||
void tearDown(void)
|
||||
{
|
||||
CustomTeardownStuff
|
||||
}
|
||||
|
||||
//Yup, nice comment
|
||||
void test_TheFirstThingToTest(void)
|
||||
{
|
||||
TEST_ASSERT(1);
|
||||
|
||||
TEST_ASSERT_TRUE(1);
|
||||
}
|
||||
|
||||
/*
|
||||
void test_ShouldBeIgnored(void)
|
||||
{
|
||||
DoesStuff();
|
||||
}
|
||||
*/
|
||||
|
||||
//void test_ShouldAlsoNotBeTested(void)
|
||||
//{
|
||||
// Call_An_Expect();
|
||||
//
|
||||
// CallAFunction();
|
||||
// test_CallAFunctionThatLooksLikeATest();
|
||||
//}
|
||||
|
||||
void test_TheSecondThingToTest(void)
|
||||
{
|
||||
uint8_t* crazyString = "GET / HTTP/1.1\r\nHost: 127.0.0.1:8081\r\nConnection: keep-alive\r\nCache-Control: no-cache\r\nUser-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36\r\nPostman-Token: 768c7149-c3fb-f704-71a2-63918d9195b2\r\nAccept: */*\r\nAccept-Encoding: gzip, deflate, sdch\r\nAccept-Language: en-GB,en-US;q=0.8,en;q=0.6\r\n\r\n";
|
||||
|
||||
Call_An_Expect();
|
||||
|
||||
CallAFunction();
|
||||
test_CallAFunctionThatLooksLikeATest();
|
||||
}
|
||||
|
||||
void test_TheThirdThingToTest(void)
|
||||
{
|
||||
CallAFunction();
|
||||
}
|
||||
|
||||
void test_TheFourthThingToTest(void)
|
||||
{
|
||||
uint8_t* anotherString = "GET / HTTP/1.1\r\nHost: 127.0.0.1:8081\r\nConnection: keep-alive\r\nCache-Control: no-cache\r\nUser-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36\r\nPostman-Token: 768c7149-c3fb-f704-71a2-63918d9195b2\r\nAccept: */*\r\nAccept-Encoding: gzip, deflate, sdch\r\nAccept-Language: en-GB,en-US;q=0.8,en;q=0.6\r\n\r\n";
|
||||
|
||||
Call_An_Expect();
|
||||
|
||||
CallAFunction();
|
||||
test_CallAFunctionThatLooksLikeATest();
|
||||
}
|
||||
|
||||
#endif //TEST_SAMPLE_H
|
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user