提交 e18ed266 authored 作者: José Luis Millán's avatar José Luis Millán

Unit test environment for worker code

fctx library is being used

https://github.com/imb/fctx
上级 54c96d42
...@@ -160,4 +160,15 @@ bool Logger::HasDebugLevel() ...@@ -160,4 +160,15 @@ bool Logger::HasDebugLevel()
MS_ABORT("failed assertion `%s': " desc, #condition, ##__VA_ARGS__); \ MS_ABORT("failed assertion `%s': " desc, #condition, ##__VA_ARGS__); \
} }
#ifdef MS_LOG_STD
#undef MS_TRACE
#define MS_TRACE MS_TRACE_STD
#undef MS_DEBUG
#define MS_DEBUG MS_DEBUG_STD
#undef MS_WARN
#define MS_WARN MS_DEBUG_STD
#undef MS_ERROR
#define MS_ERROR MS_ERROR_STD
#endif
#endif #endif
{ {
'targets': 'target_defaults': {
[ 'type': 'executable',
{ 'dependencies':
'target_name': 'mediasoup-worker', [
'type': 'executable', 'deps/jsoncpp/jsoncpp.gyp:jsoncpp',
'dependencies': 'deps/netstring/netstring.gyp:netstring',
[ 'deps/libuv/uv.gyp:libuv',
'deps/jsoncpp/jsoncpp.gyp:jsoncpp', 'deps/openssl/openssl.gyp:openssl',
'deps/netstring/netstring.gyp:netstring', 'deps/libsrtp/libsrtp.gyp:libsrtp'
'deps/libuv/uv.gyp:libuv', ],
'deps/openssl/openssl.gyp:openssl', 'sources':
'deps/libsrtp/libsrtp.gyp:libsrtp' [
], # C++ source files
'sources': 'src/DepLibSRTP.cpp',
[ 'src/DepLibUV.cpp',
# C++ source files 'src/DepOpenSSL.cpp',
'src/DepLibSRTP.cpp', 'src/DepUsrSCTP.cpp',
'src/DepLibUV.cpp', 'src/Logger.cpp',
'src/DepOpenSSL.cpp', 'src/Loop.cpp',
'src/DepUsrSCTP.cpp', 'src/Settings.cpp',
'src/Logger.cpp', 'src/Channel/Notifier.cpp',
'src/Loop.cpp', 'src/Channel/Request.cpp',
'src/Settings.cpp', 'src/Channel/UnixStreamSocket.cpp',
'src/main.cpp', 'src/RTC/DtlsTransport.cpp',
'src/Channel/Notifier.cpp', 'src/RTC/IceCandidate.cpp',
'src/Channel/Request.cpp', 'src/RTC/IceServer.cpp',
'src/Channel/UnixStreamSocket.cpp', 'src/RTC/Peer.cpp',
'src/RTC/DtlsTransport.cpp', 'src/RTC/Room.cpp',
'src/RTC/IceCandidate.cpp', 'src/RTC/RtpListener.cpp',
'src/RTC/IceServer.cpp', 'src/RTC/RtpPacket.cpp',
'src/RTC/Peer.cpp', 'src/RTC/RtpReceiver.cpp',
'src/RTC/Room.cpp', 'src/RTC/RtpSender.cpp',
'src/RTC/RtpListener.cpp', 'src/RTC/RtpStream.cpp',
'src/RTC/RtpPacket.cpp', 'src/RTC/SrtpSession.cpp',
'src/RTC/RtpReceiver.cpp', 'src/RTC/StunMessage.cpp',
'src/RTC/RtpSender.cpp', 'src/RTC/TcpConnection.cpp',
'src/RTC/RtpStream.cpp', 'src/RTC/TcpServer.cpp',
'src/RTC/SrtpSession.cpp', 'src/RTC/Transport.cpp',
'src/RTC/StunMessage.cpp', 'src/RTC/TransportTuple.cpp',
'src/RTC/TcpConnection.cpp', 'src/RTC/UdpSocket.cpp',
'src/RTC/TcpServer.cpp', 'src/RTC/RtpDictionaries/Media.cpp',
'src/RTC/Transport.cpp', 'src/RTC/RtpDictionaries/Parameters.cpp',
'src/RTC/TransportTuple.cpp', 'src/RTC/RtpDictionaries/RtcpFeedback.cpp',
'src/RTC/UdpSocket.cpp', 'src/RTC/RtpDictionaries/RtcpParameters.cpp',
'src/RTC/RtpDictionaries/Media.cpp', 'src/RTC/RtpDictionaries/RtpCapabilities.cpp',
'src/RTC/RtpDictionaries/Parameters.cpp', 'src/RTC/RtpDictionaries/RtpCodecMime.cpp',
'src/RTC/RtpDictionaries/RtcpFeedback.cpp', 'src/RTC/RtpDictionaries/RtpCodecParameters.cpp',
'src/RTC/RtpDictionaries/RtcpParameters.cpp', 'src/RTC/RtpDictionaries/RtpEncodingParameters.cpp',
'src/RTC/RtpDictionaries/RtpCapabilities.cpp', 'src/RTC/RtpDictionaries/RtpFecParameters.cpp',
'src/RTC/RtpDictionaries/RtpCodecMime.cpp', 'src/RTC/RtpDictionaries/RtpHeaderExtension.cpp',
'src/RTC/RtpDictionaries/RtpCodecParameters.cpp', 'src/RTC/RtpDictionaries/RtpHeaderExtensionParameters.cpp',
'src/RTC/RtpDictionaries/RtpEncodingParameters.cpp', 'src/RTC/RtpDictionaries/RtpParameters.cpp',
'src/RTC/RtpDictionaries/RtpFecParameters.cpp', 'src/RTC/RtpDictionaries/RtpRtxParameters.cpp',
'src/RTC/RtpDictionaries/RtpHeaderExtension.cpp', 'src/RTC/RTCP/Packet.cpp',
'src/RTC/RtpDictionaries/RtpHeaderExtensionParameters.cpp', 'src/RTC/RTCP/CompoundPacket.cpp',
'src/RTC/RtpDictionaries/RtpParameters.cpp', 'src/RTC/RTCP/SenderReport.cpp',
'src/RTC/RtpDictionaries/RtpRtxParameters.cpp', 'src/RTC/RTCP/ReceiverReport.cpp',
'src/RTC/RTCP/Packet.cpp', 'src/RTC/RTCP/Sdes.cpp',
'src/RTC/RTCP/CompoundPacket.cpp', 'src/RTC/RTCP/Bye.cpp',
'src/RTC/RTCP/SenderReport.cpp', 'src/RTC/RTCP/Feedback.cpp',
'src/RTC/RTCP/ReceiverReport.cpp', 'src/RTC/RTCP/FeedbackPs.cpp',
'src/RTC/RTCP/Sdes.cpp', 'src/RTC/RTCP/FeedbackRtp.cpp',
'src/RTC/RTCP/Bye.cpp', 'src/RTC/RTCP/FeedbackRtpNack.cpp',
'src/RTC/RTCP/Feedback.cpp', 'src/RTC/RTCP/FeedbackRtpTmmb.cpp',
'src/RTC/RTCP/FeedbackPs.cpp', 'src/RTC/RTCP/FeedbackRtpSrReq.cpp',
'src/RTC/RTCP/FeedbackRtp.cpp', 'src/RTC/RTCP/FeedbackRtpTllei.cpp',
'src/RTC/RTCP/FeedbackRtpNack.cpp', 'src/RTC/RTCP/FeedbackRtpEcn.cpp',
'src/RTC/RTCP/FeedbackRtpTmmb.cpp', 'src/RTC/RTCP/FeedbackPsPli.cpp',
'src/RTC/RTCP/FeedbackRtpSrReq.cpp', 'src/RTC/RTCP/FeedbackPsSli.cpp',
'src/RTC/RTCP/FeedbackRtpTllei.cpp', 'src/RTC/RTCP/FeedbackPsRpsi.cpp',
'src/RTC/RTCP/FeedbackRtpEcn.cpp', 'src/RTC/RTCP/FeedbackPsFir.cpp',
'src/RTC/RTCP/FeedbackPsPli.cpp', 'src/RTC/RTCP/FeedbackPsTst.cpp',
'src/RTC/RTCP/FeedbackPsSli.cpp', 'src/RTC/RTCP/FeedbackPsVbcm.cpp',
'src/RTC/RTCP/FeedbackPsRpsi.cpp', 'src/RTC/RTCP/FeedbackPsLei.cpp',
'src/RTC/RTCP/FeedbackPsFir.cpp', 'src/RTC/RTCP/FeedbackPsAfb.cpp',
'src/RTC/RTCP/FeedbackPsTst.cpp', 'src/Utils/Crypto.cpp',
'src/RTC/RTCP/FeedbackPsVbcm.cpp', 'src/Utils/File.cpp',
'src/RTC/RTCP/FeedbackPsLei.cpp', 'src/Utils/IP.cpp',
'src/RTC/RTCP/FeedbackPsAfb.cpp', 'src/handles/SignalsHandler.cpp',
'src/Utils/Crypto.cpp', 'src/handles/TcpConnection.cpp',
'src/Utils/File.cpp', 'src/handles/TcpServer.cpp',
'src/Utils/IP.cpp', 'src/handles/Timer.cpp',
'src/handles/SignalsHandler.cpp', 'src/handles/UdpSocket.cpp',
'src/handles/TcpConnection.cpp', 'src/handles/UnixStreamSocket.cpp',
'src/handles/TcpServer.cpp', # C++ include files
'src/handles/Timer.cpp', 'include/DepLibSRTP.h',
'src/handles/UdpSocket.cpp', 'include/DepLibUV.h',
'src/handles/UnixStreamSocket.cpp', 'include/DepOpenSSL.h',
# C++ include files 'include/DepUsrSCTP.h',
'include/DepLibSRTP.h', 'include/LogLevel.h',
'include/DepLibUV.h', 'include/Logger.h',
'include/DepOpenSSL.h', 'include/Loop.h',
'include/DepUsrSCTP.h', 'include/MediaSoupError.h',
'include/LogLevel.h', 'include/Settings.h',
'include/Logger.h', 'include/Utils.h',
'include/Loop.h', 'include/common.h',
'include/MediaSoupError.h', 'include/Channel/Notifier.h',
'include/Settings.h', 'include/Channel/Request.h',
'include/Utils.h', 'include/Channel/UnixStreamSocket.h',
'include/common.h', 'include/RTC/DtlsTransport.h',
'include/Channel/Notifier.h', 'include/RTC/IceCandidate.h',
'include/Channel/Request.h', 'include/RTC/IceServer.h',
'include/Channel/UnixStreamSocket.h', 'include/RTC/Parameters.h',
'include/RTC/DtlsTransport.h', 'include/RTC/Peer.h',
'include/RTC/IceCandidate.h', 'include/RTC/Room.h',
'include/RTC/IceServer.h', 'include/RTC/RtpDictionaries.h',
'include/RTC/Parameters.h', 'include/RTC/RtpListener.h',
'include/RTC/Peer.h', 'include/RTC/RtpPacket.h',
'include/RTC/Room.h', 'include/RTC/RtpReceiver.h',
'include/RTC/RtpDictionaries.h', 'include/RTC/RtpSender.h',
'include/RTC/RtpListener.h', 'include/RTC/RtpStream.h',
'include/RTC/RtpPacket.h', 'include/RTC/SrtpSession.h',
'include/RTC/RtpReceiver.h', 'include/RTC/StunMessage.h',
'include/RTC/RtpSender.h', 'include/RTC/TcpConnection.h',
'include/RTC/RtpStream.h', 'include/RTC/TcpServer.h',
'include/RTC/SrtpSession.h', 'include/RTC/Transport.h',
'include/RTC/StunMessage.h', 'include/RTC/TransportTuple.h',
'include/RTC/TcpConnection.h', 'include/RTC/UdpSocket.h',
'include/RTC/TcpServer.h', 'include/RTC/RTCP/Packet.h',
'include/RTC/Transport.h', 'include/RTC/RTCP/CompoundPacket.h',
'include/RTC/TransportTuple.h', 'include/RTC/RTCP/SenderReport.h',
'include/RTC/UdpSocket.h', 'include/RTC/RTCP/ReceiverReport.h',
'include/RTC/RTCP/Packet.h', 'include/RTC/RTCP/Sdes.h',
'include/RTC/RTCP/CompoundPacket.h', 'include/RTC/RTCP/Bye.h',
'include/RTC/RTCP/SenderReport.h', 'include/RTC/RTCP/Feedback.h',
'include/RTC/RTCP/ReceiverReport.h', 'include/RTC/RTCP/FeedbackItem.h',
'include/RTC/RTCP/Sdes.h', 'include/RTC/RTCP/FeedbackPs.h',
'include/RTC/RTCP/Bye.h', 'include/RTC/RTCP/FeedbackRtp.h',
'include/RTC/RTCP/Feedback.h', 'include/RTC/RTCP/FeedbackRtpNack.h',
'include/RTC/RTCP/FeedbackItem.h', 'include/RTC/RTCP/FeedbackRtpTmmb.h',
'include/RTC/RTCP/FeedbackPs.h', 'include/RTC/RTCP/FeedbackRtpSrReq.h',
'include/RTC/RTCP/FeedbackRtp.h', 'include/RTC/RTCP/FeedbackRtpTllei.h',
'include/RTC/RTCP/FeedbackRtpNack.h', 'include/RTC/RTCP/FeedbackRtpEcn.h',
'include/RTC/RTCP/FeedbackRtpTmmb.h', 'include/RTC/RTCP/FeedbackPsPli.h',
'include/RTC/RTCP/FeedbackRtpSrReq.h', 'include/RTC/RTCP/FeedbackPsSli.h',
'include/RTC/RTCP/FeedbackRtpTllei.h', 'include/RTC/RTCP/FeedbackPsRpsi.h',
'include/RTC/RTCP/FeedbackRtpEcn.h', 'include/RTC/RTCP/FeedbackPsFir.h',
'include/RTC/RTCP/FeedbackPsPli.h', 'include/RTC/RTCP/FeedbackPsTst.h',
'include/RTC/RTCP/FeedbackPsSli.h', 'include/RTC/RTCP/FeedbackPsVbcm.h',
'include/RTC/RTCP/FeedbackPsRpsi.h', 'include/RTC/RTCP/FeedbackPsLei.h',
'include/RTC/RTCP/FeedbackPsFir.h', 'include/RTC/RTCP/FeedbackPsAfb.h',
'include/RTC/RTCP/FeedbackPsTst.h', 'include/handles/SignalsHandler.h',
'include/RTC/RTCP/FeedbackPsVbcm.h', 'include/handles/TcpConnection.h',
'include/RTC/RTCP/FeedbackPsLei.h', 'include/handles/TcpServer.h',
'include/RTC/RTCP/FeedbackPsAfb.h', 'include/handles/Timer.h',
'include/handles/SignalsHandler.h', 'include/handles/UdpSocket.h',
'include/handles/TcpConnection.h', 'include/handles/UnixStreamSocket.h'
'include/handles/TcpServer.h', ],
'include/handles/Timer.h', 'include_dirs':
'include/handles/UdpSocket.h', [
'include/handles/UnixStreamSocket.h' 'include'
], ],
'include_dirs': 'conditions':
[ [
'include' # FIPS
], [ 'openssl_fips != ""', {
'conditions': 'defines': [ 'BUD_FIPS_ENABLED=1' ]
[ }],
# FIPS
[ 'openssl_fips != ""', {
'defines': [ 'BUD_FIPS_ENABLED=1' ]
}],
# Endianness # Endianness
[ 'node_byteorder=="big"', { [ 'node_byteorder=="big"', {
# Define Big Endian # Define Big Endian
'defines': ['MS_BIG_ENDIAN'] 'defines': ['MS_BIG_ENDIAN']
}, { }, {
# Define Little Endian # Define Little Endian
'defines': ['MS_LITTLE_ENDIAN'] 'defines': ['MS_LITTLE_ENDIAN']
}], }],
# Platform-specifics # Platform-specifics
[ 'OS == "mac" and mediasoup_asan == "true"', { [ 'OS == "mac" and mediasoup_asan == "true"', {
'xcode_settings': 'xcode_settings':
{ {
'OTHER_CFLAGS': [ '-fsanitize=address' ], 'OTHER_CFLAGS': [ '-fsanitize=address' ],
'OTHER_LDFLAGS': [ '-fsanitize=address' ] 'OTHER_LDFLAGS': [ '-fsanitize=address' ]
} }
}], }],
[ 'OS == "linux"', { [ 'OS == "linux"', {
'defines': 'defines':
[ [
'_POSIX_C_SOURCE=200112', '_POSIX_C_SOURCE=200112',
'_GNU_SOURCE' '_GNU_SOURCE'
] ]
}], }],
[ 'OS == "linux" and mediasoup_asan == "true"', { [ 'OS == "linux" and mediasoup_asan == "true"', {
'cflags': [ '-fsanitize=address' ], 'cflags': [ '-fsanitize=address' ],
'ldflags': [ '-fsanitize=address' ] 'ldflags': [ '-fsanitize=address' ]
}], }],
[ 'OS in "linux freebsd"', { [ 'OS in "linux freebsd"', {
'ldflags': 'ldflags':
[ [
'-Wl,--whole-archive <(libopenssl) -Wl,--no-whole-archive' '-Wl,--whole-archive <(libopenssl) -Wl,--no-whole-archive'
] ]
}], }],
[ 'OS in "freebsd"', { [ 'OS in "freebsd"', {
'ldflags': [ '-Wl,--export-dynamic' ] 'ldflags': [ '-Wl,--export-dynamic' ]
}], }],
[ 'OS != "win"', { [ 'OS != "win"', {
'cflags': [ '-std=c++11', '-Wall', '-Wextra', '-Wno-unused-parameter' ] 'cflags': [ '-std=c++11', '-Wall', '-Wextra', '-Wno-unused-parameter' ]
}], }],
[ 'OS == "mac"', { [ 'OS == "mac"', {
'xcode_settings': 'xcode_settings':
{ {
'WARNING_CFLAGS': [ '-Wall', '-Wextra', '-Wno-unused-parameter' ], 'WARNING_CFLAGS': [ '-Wall', '-Wextra', '-Wno-unused-parameter' ],
'OTHER_CPLUSPLUSFLAGS' : [ '-std=c++11' ] 'OTHER_CPLUSPLUSFLAGS' : [ '-std=c++11' ]
} }
}] }]
]
},
'targets':
[
{
'target_name': 'mediasoup-worker',
'sources':
[
# C++ source files
'src/main.cpp'
]
},
{
'target_name': 'mediasoup-worker-test',
'defines': ['MS_LOG_STD'],
'sources':
[
# C++ source files
'test/tests.cpp',
'test/test_a.cpp',
'test/test-rtcp.cpp',
# C++ include files
'test/fct.h'
] ]
} }
] ]
......
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论