Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
M
mediasoup
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
聂卓夫
mediasoup
Commits
4e3c9081
提交
4e3c9081
authored
4月 09, 2019
作者:
Iñaki Baz Castillo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Include worker/test/include/catch.hpp
上级
411df6c4
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
83 行增加
和
21 行删除
+83
-21
catch.hpp
worker/test/include/catch.hpp
+83
-21
没有找到文件。
worker/test/include/catch.hpp
浏览文件 @
4e3c9081
/*
/*
* Catch v2.7.
0
* Catch v2.7.
1
* Generated: 2019-0
3-07 21:34:30.252164
* Generated: 2019-0
4-05 18:22:37.720122
* ----------------------------------------------------------
* ----------------------------------------------------------
* This file has been merged from multiple headers. Please don't edit it directly
* This file has been merged from multiple headers. Please don't edit it directly
* Copyright (c) 2019 Two Blue Cubes Ltd. All rights reserved.
* Copyright (c) 2019 Two Blue Cubes Ltd. All rights reserved.
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
#define CATCH_VERSION_MAJOR 2
#define CATCH_VERSION_MAJOR 2
#define CATCH_VERSION_MINOR 7
#define CATCH_VERSION_MINOR 7
#define CATCH_VERSION_PATCH
0
#define CATCH_VERSION_PATCH
1
#ifdef __clang__
#ifdef __clang__
# pragma clang system_header
# pragma clang system_header
...
@@ -3686,7 +3686,11 @@ namespace Generators {
...
@@ -3686,7 +3686,11 @@ namespace Generators {
}
// namespace Catch
}
// namespace Catch
#define GENERATE( ... ) \
#define GENERATE( ... ) \
Catch::Generators::generate( CATCH_INTERNAL_LINEINFO, []{ using namespace Catch::Generators; return makeGenerators( __VA_ARGS__ ); } )
Catch::Generators::generate( CATCH_INTERNAL_LINEINFO, [ ]{ using namespace Catch::Generators; return makeGenerators( __VA_ARGS__ ); } )
#define GENERATE_COPY( ... ) \
Catch::Generators::generate( CATCH_INTERNAL_LINEINFO, [=]{ using namespace Catch::Generators; return makeGenerators( __VA_ARGS__ ); } )
#define GENERATE_REF( ... ) \
Catch::Generators::generate( CATCH_INTERNAL_LINEINFO, [&]{ using namespace Catch::Generators; return makeGenerators( __VA_ARGS__ ); } )
// end catch_generators.hpp
// end catch_generators.hpp
// start catch_generators_generic.hpp
// start catch_generators_generic.hpp
...
@@ -3849,16 +3853,28 @@ namespace Generators {
...
@@ -3849,16 +3853,28 @@ namespace Generators {
}
}
};
};
template
<
typename
T
,
typename
U
,
typename
Func
>
#if defined(__cpp_lib_is_invocable) && __cpp_lib_is_invocable >= 201703
// std::result_of is deprecated in C++17 and removed in C++20. Hence, it is
// replaced with std::invoke_result here. Also *_t format is preferred over
// typename *::type format.
template
<
typename
Func
,
typename
U
>
using
MapFunctionReturnType
=
std
::
remove_reference_t
<
std
::
remove_cv_t
<
std
::
invoke_result_t
<
Func
,
U
>>>
;
#else
template
<
typename
Func
,
typename
U
>
using
MapFunctionReturnType
=
typename
std
::
remove_reference
<
typename
std
::
remove_cv
<
typename
std
::
result_of
<
Func
(
U
)
>::
type
>::
type
>::
type
;
#endif
template
<
typename
Func
,
typename
U
,
typename
T
=
MapFunctionReturnType
<
Func
,
U
>>
GeneratorWrapper
<
T
>
map
(
Func
&&
function
,
GeneratorWrapper
<
U
>&&
generator
)
{
GeneratorWrapper
<
T
>
map
(
Func
&&
function
,
GeneratorWrapper
<
U
>&&
generator
)
{
return
GeneratorWrapper
<
T
>
(
return
GeneratorWrapper
<
T
>
(
pf
::
make_unique
<
MapGenerator
<
T
,
U
,
Func
>>
(
std
::
forward
<
Func
>
(
function
),
std
::
move
(
generator
))
pf
::
make_unique
<
MapGenerator
<
T
,
U
,
Func
>>
(
std
::
forward
<
Func
>
(
function
),
std
::
move
(
generator
))
);
);
}
}
template
<
typename
T
,
typename
Func
>
GeneratorWrapper
<
T
>
map
(
Func
&&
function
,
GeneratorWrapper
<
T
>&&
generator
)
{
template
<
typename
T
,
typename
U
,
typename
Func
>
GeneratorWrapper
<
T
>
map
(
Func
&&
function
,
GeneratorWrapper
<
U
>&&
generator
)
{
return
GeneratorWrapper
<
T
>
(
return
GeneratorWrapper
<
T
>
(
pf
::
make_unique
<
MapGenerator
<
T
,
T
,
Func
>>
(
std
::
forward
<
Func
>
(
function
),
std
::
move
(
generator
))
pf
::
make_unique
<
MapGenerator
<
T
,
U
,
Func
>>
(
std
::
forward
<
Func
>
(
function
),
std
::
move
(
generator
))
);
);
}
}
...
@@ -4022,6 +4038,7 @@ namespace Catch {
...
@@ -4022,6 +4038,7 @@ namespace Catch {
virtual
ShowDurations
::
OrNot
showDurations
()
const
=
0
;
virtual
ShowDurations
::
OrNot
showDurations
()
const
=
0
;
virtual
TestSpec
const
&
testSpec
()
const
=
0
;
virtual
TestSpec
const
&
testSpec
()
const
=
0
;
virtual
bool
hasTestFilters
()
const
=
0
;
virtual
bool
hasTestFilters
()
const
=
0
;
virtual
std
::
vector
<
std
::
string
>
const
&
getTestsOrTags
()
const
=
0
;
virtual
RunTests
::
InWhatOrder
runOrder
()
const
=
0
;
virtual
RunTests
::
InWhatOrder
runOrder
()
const
=
0
;
virtual
unsigned
int
rngSeed
()
const
=
0
;
virtual
unsigned
int
rngSeed
()
const
=
0
;
virtual
int
benchmarkResolutionMultiple
()
const
=
0
;
virtual
int
benchmarkResolutionMultiple
()
const
=
0
;
...
@@ -4352,7 +4369,7 @@ namespace Catch {
...
@@ -4352,7 +4369,7 @@ namespace Catch {
arcSafeRelease
(
m_substr
);
arcSafeRelease
(
m_substr
);
}
}
bool
match
(
NSString
*
arg
)
const
override
{
bool
match
(
NSString
*
const
&
str
)
const
override
{
return
false
;
return
false
;
}
}
...
@@ -4362,7 +4379,7 @@ namespace Catch {
...
@@ -4362,7 +4379,7 @@ namespace Catch {
struct
Equals
:
StringHolder
{
struct
Equals
:
StringHolder
{
Equals
(
NSString
*
substr
)
:
StringHolder
(
substr
){}
Equals
(
NSString
*
substr
)
:
StringHolder
(
substr
){}
bool
match
(
NSString
*
str
)
const
override
{
bool
match
(
NSString
*
const
&
str
)
const
override
{
return
(
str
!=
nil
||
m_substr
==
nil
)
&&
return
(
str
!=
nil
||
m_substr
==
nil
)
&&
[
str
isEqualToString
:
m_substr
];
[
str
isEqualToString
:
m_substr
];
}
}
...
@@ -4375,7 +4392,7 @@ namespace Catch {
...
@@ -4375,7 +4392,7 @@ namespace Catch {
struct
Contains
:
StringHolder
{
struct
Contains
:
StringHolder
{
Contains
(
NSString
*
substr
)
:
StringHolder
(
substr
){}
Contains
(
NSString
*
substr
)
:
StringHolder
(
substr
){}
bool
match
(
NSString
*
str
)
const
{
bool
match
(
NSString
*
const
&
str
)
const
override
{
return
(
str
!=
nil
||
m_substr
==
nil
)
&&
return
(
str
!=
nil
||
m_substr
==
nil
)
&&
[
str
rangeOfString
:
m_substr
].
location
!=
NSNotFound
;
[
str
rangeOfString
:
m_substr
].
location
!=
NSNotFound
;
}
}
...
@@ -4388,7 +4405,7 @@ namespace Catch {
...
@@ -4388,7 +4405,7 @@ namespace Catch {
struct
StartsWith
:
StringHolder
{
struct
StartsWith
:
StringHolder
{
StartsWith
(
NSString
*
substr
)
:
StringHolder
(
substr
){}
StartsWith
(
NSString
*
substr
)
:
StringHolder
(
substr
){}
bool
match
(
NSString
*
str
)
const
override
{
bool
match
(
NSString
*
const
&
str
)
const
override
{
return
(
str
!=
nil
||
m_substr
==
nil
)
&&
return
(
str
!=
nil
||
m_substr
==
nil
)
&&
[
str
rangeOfString
:
m_substr
].
location
==
0
;
[
str
rangeOfString
:
m_substr
].
location
==
0
;
}
}
...
@@ -4400,7 +4417,7 @@ namespace Catch {
...
@@ -4400,7 +4417,7 @@ namespace Catch {
struct
EndsWith
:
StringHolder
{
struct
EndsWith
:
StringHolder
{
EndsWith
(
NSString
*
substr
)
:
StringHolder
(
substr
){}
EndsWith
(
NSString
*
substr
)
:
StringHolder
(
substr
){}
bool
match
(
NSString
*
str
)
const
override
{
bool
match
(
NSString
*
const
&
str
)
const
override
{
return
(
str
!=
nil
||
m_substr
==
nil
)
&&
return
(
str
!=
nil
||
m_substr
==
nil
)
&&
[
str
rangeOfString
:
m_substr
].
location
==
[
str
length
]
-
[
m_substr
length
];
[
str
rangeOfString
:
m_substr
].
location
==
[
str
length
]
-
[
m_substr
length
];
}
}
...
@@ -4708,7 +4725,7 @@ namespace Catch {
...
@@ -4708,7 +4725,7 @@ namespace Catch {
std
::
string
getProcessName
()
const
;
std
::
string
getProcessName
()
const
;
std
::
string
const
&
getReporterName
()
const
;
std
::
string
const
&
getReporterName
()
const
;
std
::
vector
<
std
::
string
>
const
&
getTestsOrTags
()
const
;
std
::
vector
<
std
::
string
>
const
&
getTestsOrTags
()
const
override
;
std
::
vector
<
std
::
string
>
const
&
getSectionsToRun
()
const
override
;
std
::
vector
<
std
::
string
>
const
&
getSectionsToRun
()
const
override
;
virtual
TestSpec
const
&
testSpec
()
const
override
;
virtual
TestSpec
const
&
testSpec
()
const
override
;
...
@@ -5082,6 +5099,8 @@ namespace Catch {
...
@@ -5082,6 +5099,8 @@ namespace Catch {
// Returns double formatted as %.3f (format expected on output)
// Returns double formatted as %.3f (format expected on output)
std
::
string
getFormattedDuration
(
double
duration
);
std
::
string
getFormattedDuration
(
double
duration
);
std
::
string
serializeFilters
(
std
::
vector
<
std
::
string
>
const
&
container
);
template
<
typename
DerivedT
>
template
<
typename
DerivedT
>
struct
StreamingReporterBase
:
IStreamingReporter
{
struct
StreamingReporterBase
:
IStreamingReporter
{
...
@@ -5109,6 +5128,7 @@ namespace Catch {
...
@@ -5109,6 +5128,7 @@ namespace Catch {
void
testRunStarting
(
TestRunInfo
const
&
_testRunInfo
)
override
{
void
testRunStarting
(
TestRunInfo
const
&
_testRunInfo
)
override
{
currentTestRunInfo
=
_testRunInfo
;
currentTestRunInfo
=
_testRunInfo
;
}
}
void
testGroupStarting
(
GroupInfo
const
&
_groupInfo
)
override
{
void
testGroupStarting
(
GroupInfo
const
&
_groupInfo
)
override
{
currentGroupInfo
=
_groupInfo
;
currentGroupInfo
=
_groupInfo
;
}
}
...
@@ -5521,7 +5541,7 @@ namespace Catch {
...
@@ -5521,7 +5541,7 @@ namespace Catch {
void
testCaseEnded
(
TestCaseStats
const
&
_testCaseStats
)
override
;
void
testCaseEnded
(
TestCaseStats
const
&
_testCaseStats
)
override
;
void
testGroupEnded
(
TestGroupStats
const
&
_testGroupStats
)
override
;
void
testGroupEnded
(
TestGroupStats
const
&
_testGroupStats
)
override
;
void
testRunEnded
(
TestRunStats
const
&
_testRunStats
)
override
;
void
testRunEnded
(
TestRunStats
const
&
_testRunStats
)
override
;
void
testRunStarting
(
TestRunInfo
const
&
_testRunInfo
)
override
;
private
:
private
:
void
lazyPrint
();
void
lazyPrint
();
...
@@ -5543,6 +5563,7 @@ namespace Catch {
...
@@ -5543,6 +5563,7 @@ namespace Catch {
void
printTotalsDivider
(
Totals
const
&
totals
);
void
printTotalsDivider
(
Totals
const
&
totals
);
void
printSummaryDivider
();
void
printSummaryDivider
();
void
printTestFilters
();
private
:
private
:
bool
m_headerPrinted
=
false
;
bool
m_headerPrinted
=
false
;
...
@@ -8660,10 +8681,10 @@ namespace Catch {
...
@@ -8660,10 +8681,10 @@ namespace Catch {
// Windows can easily distinguish between SO and SigSegV,
// Windows can easily distinguish between SO and SigSegV,
// but SigInt, SigTerm, etc are handled differently.
// but SigInt, SigTerm, etc are handled differently.
static
SignalDefs
signalDefs
[]
=
{
static
SignalDefs
signalDefs
[]
=
{
{
EXCEPTION_ILLEGAL_INSTRUCTION
,
"SIGILL - Illegal instruction signal"
},
{
static_cast
<
DWORD
>
(
EXCEPTION_ILLEGAL_INSTRUCTION
)
,
"SIGILL - Illegal instruction signal"
},
{
EXCEPTION_STACK_OVERFLOW
,
"SIGSEGV - Stack overflow"
},
{
static_cast
<
DWORD
>
(
EXCEPTION_STACK_OVERFLOW
)
,
"SIGSEGV - Stack overflow"
},
{
EXCEPTION_ACCESS_VIOLATION
,
"SIGSEGV - Segmentation violation signal"
},
{
static_cast
<
DWORD
>
(
EXCEPTION_ACCESS_VIOLATION
)
,
"SIGSEGV - Segmentation violation signal"
},
{
EXCEPTION_INT_DIVIDE_BY_ZERO
,
"Divide by zero error"
},
{
static_cast
<
DWORD
>
(
EXCEPTION_INT_DIVIDE_BY_ZERO
)
,
"Divide by zero error"
},
};
};
LONG
CALLBACK
FatalConditionHandler
::
handleVectoredException
(
PEXCEPTION_POINTERS
ExceptionInfo
)
{
LONG
CALLBACK
FatalConditionHandler
::
handleVectoredException
(
PEXCEPTION_POINTERS
ExceptionInfo
)
{
...
@@ -11657,6 +11678,12 @@ namespace Catch {
...
@@ -11657,6 +11678,12 @@ namespace Catch {
else
if
(
prop
==
TestCaseInfo
::
None
)
else
if
(
prop
==
TestCaseInfo
::
None
)
enforceNotReservedTag
(
tag
,
_lineInfo
);
enforceNotReservedTag
(
tag
,
_lineInfo
);
// Merged hide tags like `[.approvals]` should be added as
// `[.][approvals]`. The `[.]` is added at later point, so
// we only strip the prefix
if
(
startsWith
(
tag
,
'.'
)
&&
tag
.
size
()
>
1
)
{
tag
.
erase
(
0
,
1
);
}
tags
.
push_back
(
tag
);
tags
.
push_back
(
tag
);
tag
.
clear
();
tag
.
clear
();
inTag
=
false
;
inTag
=
false
;
...
@@ -12665,7 +12692,7 @@ namespace Catch {
...
@@ -12665,7 +12692,7 @@ namespace Catch {
}
}
Version
const
&
libraryVersion
()
{
Version
const
&
libraryVersion
()
{
static
Version
version
(
2
,
7
,
0
,
""
,
0
);
static
Version
version
(
2
,
7
,
1
,
""
,
0
);
return
version
;
return
version
;
}
}
...
@@ -13022,6 +13049,21 @@ namespace Catch {
...
@@ -13022,6 +13049,21 @@ namespace Catch {
return
std
::
string
(
buffer
);
return
std
::
string
(
buffer
);
}
}
std
::
string
serializeFilters
(
std
::
vector
<
std
::
string
>
const
&
container
)
{
ReusableStringStream
oss
;
bool
first
=
true
;
for
(
auto
&&
filter
:
container
)
{
if
(
!
first
)
oss
<<
' '
;
else
first
=
false
;
oss
<<
filter
;
}
return
oss
.
str
();
}
TestEventListenerBase
::
TestEventListenerBase
(
ReporterConfig
const
&
_config
)
TestEventListenerBase
::
TestEventListenerBase
(
ReporterConfig
const
&
_config
)
:
StreamingReporterBase
(
_config
)
{}
:
StreamingReporterBase
(
_config
)
{}
...
@@ -13746,6 +13788,10 @@ void ConsoleReporter::testRunEnded(TestRunStats const& _testRunStats) {
...
@@ -13746,6 +13788,10 @@ void ConsoleReporter::testRunEnded(TestRunStats const& _testRunStats) {
stream
<<
std
::
endl
;
stream
<<
std
::
endl
;
StreamingReporterBase
::
testRunEnded
(
_testRunStats
);
StreamingReporterBase
::
testRunEnded
(
_testRunStats
);
}
}
void
ConsoleReporter
::
testRunStarting
(
TestRunInfo
const
&
_testInfo
)
{
StreamingReporterBase
::
testRunStarting
(
_testInfo
);
printTestFilters
();
}
void
ConsoleReporter
::
lazyPrint
()
{
void
ConsoleReporter
::
lazyPrint
()
{
...
@@ -13927,6 +13973,11 @@ void ConsoleReporter::printSummaryDivider() {
...
@@ -13927,6 +13973,11 @@ void ConsoleReporter::printSummaryDivider() {
stream
<<
getLineOfChars
<
'-'
>
()
<<
'\n'
;
stream
<<
getLineOfChars
<
'-'
>
()
<<
'\n'
;
}
}
void
ConsoleReporter
::
printTestFilters
()
{
if
(
m_config
->
testSpec
().
hasFilters
())
stream
<<
Colour
(
Colour
::
BrightYellow
)
<<
"Filters: "
<<
serializeFilters
(
m_config
->
getTestsOrTags
()
)
<<
'\n'
;
}
CATCH_REGISTER_REPORTER
(
"console"
,
ConsoleReporter
)
CATCH_REGISTER_REPORTER
(
"console"
,
ConsoleReporter
)
}
// end namespace Catch
}
// end namespace Catch
...
@@ -14000,8 +14051,17 @@ namespace Catch {
...
@@ -14000,8 +14051,17 @@ namespace Catch {
void
JunitReporter
::
testRunStarting
(
TestRunInfo
const
&
runInfo
)
{
void
JunitReporter
::
testRunStarting
(
TestRunInfo
const
&
runInfo
)
{
CumulativeReporterBase
::
testRunStarting
(
runInfo
);
CumulativeReporterBase
::
testRunStarting
(
runInfo
);
xml
.
startElement
(
"testsuites"
);
xml
.
startElement
(
"testsuites"
);
if
(
m_config
->
hasTestFilters
()
||
m_config
->
rngSeed
()
!=
0
)
xml
.
startElement
(
"properties"
);
if
(
m_config
->
hasTestFilters
()
)
{
xml
.
scopedElement
(
"property"
)
.
writeAttribute
(
"name"
,
"filters"
)
.
writeAttribute
(
"value"
,
serializeFilters
(
m_config
->
getTestsOrTags
()
)
);
}
if
(
m_config
->
rngSeed
()
!=
0
)
{
if
(
m_config
->
rngSeed
()
!=
0
)
{
xml
.
startElement
(
"properties"
);
xml
.
scopedElement
(
"property"
)
xml
.
scopedElement
(
"property"
)
.
writeAttribute
(
"name"
,
"random-seed"
)
.
writeAttribute
(
"name"
,
"random-seed"
)
.
writeAttribute
(
"value"
,
m_config
->
rngSeed
()
);
.
writeAttribute
(
"value"
,
m_config
->
rngSeed
()
);
...
@@ -14357,6 +14417,8 @@ namespace Catch {
...
@@ -14357,6 +14417,8 @@ namespace Catch {
m_xml
.
startElement
(
"Catch"
);
m_xml
.
startElement
(
"Catch"
);
if
(
!
m_config
->
name
().
empty
()
)
if
(
!
m_config
->
name
().
empty
()
)
m_xml
.
writeAttribute
(
"name"
,
m_config
->
name
()
);
m_xml
.
writeAttribute
(
"name"
,
m_config
->
name
()
);
if
(
m_config
->
testSpec
().
hasFilters
())
m_xml
.
writeAttribute
(
"filters"
,
serializeFilters
(
m_config
->
getTestsOrTags
()
)
);
if
(
m_config
->
rngSeed
()
!=
0
)
if
(
m_config
->
rngSeed
()
!=
0
)
m_xml
.
scopedElement
(
"Randomness"
)
m_xml
.
scopedElement
(
"Randomness"
)
.
writeAttribute
(
"seed"
,
m_config
->
rngSeed
()
);
.
writeAttribute
(
"seed"
,
m_config
->
rngSeed
()
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论