37 #ifndef GTEST_SRC_GTEST_INTERNAL_INL_H_ 38 #define GTEST_SRC_GTEST_INTERNAL_INL_H_ 42 #if !GTEST_IMPLEMENTATION_ 44 # error "gtest-internal-inl.h is part of Google Test's internal implementation." 45 # error "It must not be included except by Google Test itself." 46 #endif // GTEST_IMPLEMENTATION_ 59 #include "gtest/internal/gtest-port.h" 61 #if GTEST_CAN_STREAM_RESULTS_ 62 # include <arpa/inet.h> 68 #endif // GTEST_OS_WINDOWS 70 #include "gtest/gtest.h" 71 #include "gtest/gtest-spi.h" 80 GTEST_DECLARE_bool_(death_test_use_fork);
86 GTEST_API_
extern const TypeId kTestTypeIdInGoogleTest;
89 const char kAlsoRunDisabledTestsFlag[] =
"also_run_disabled_tests";
90 const char kBreakOnFailureFlag[] =
"break_on_failure";
91 const char kCatchExceptionsFlag[] =
"catch_exceptions";
92 const char kColorFlag[] =
"color";
93 const char kFilterFlag[] =
"filter";
94 const char kListTestsFlag[] =
"list_tests";
95 const char kOutputFlag[] =
"output";
96 const char kPrintTimeFlag[] =
"print_time";
97 const char kRandomSeedFlag[] =
"random_seed";
98 const char kRepeatFlag[] =
"repeat";
99 const char kShuffleFlag[] =
"shuffle";
100 const char kStackTraceDepthFlag[] =
"stack_trace_depth";
101 const char kStreamResultToFlag[] =
"stream_result_to";
102 const char kThrowOnFailureFlag[] =
"throw_on_failure";
105 const int kMaxRandomSeed = 99999;
109 GTEST_API_
extern bool g_help_flag;
112 GTEST_API_ TimeInMillis GetTimeInMillis();
115 GTEST_API_
bool ShouldUseColor(
bool stdout_is_tty);
118 GTEST_API_ std::string FormatTimeInMillisAsSeconds(TimeInMillis ms);
124 GTEST_API_ std::string FormatEpochTimeInMillisAsIso8601(TimeInMillis ms);
130 GTEST_API_
bool ParseInt32Flag(
131 const char* str,
const char* flag, Int32* value);
135 inline int GetRandomSeedFromFlag(Int32 random_seed_flag) {
136 const unsigned int raw_seed = (random_seed_flag == 0) ?
137 static_cast<unsigned int>(GetTimeInMillis()) :
138 static_cast<unsigned int>(random_seed_flag);
142 const int normalized_seed =
143 static_cast<int>((raw_seed - 1U) %
144 static_cast<unsigned int>(kMaxRandomSeed)) + 1;
145 return normalized_seed;
151 inline int GetNextRandomSeed(
int seed) {
152 GTEST_CHECK_(1 <= seed && seed <= kMaxRandomSeed)
153 <<
"Invalid random seed " << seed <<
" - must be in [1, " 154 << kMaxRandomSeed <<
"].";
155 const int next_seed = seed + 1;
156 return (next_seed > kMaxRandomSeed) ? 1 : next_seed;
161 class GTestFlagSaver {
165 also_run_disabled_tests_ = GTEST_FLAG(also_run_disabled_tests);
166 break_on_failure_ = GTEST_FLAG(break_on_failure);
167 catch_exceptions_ = GTEST_FLAG(catch_exceptions);
168 color_ = GTEST_FLAG(color);
169 death_test_style_ = GTEST_FLAG(death_test_style);
170 death_test_use_fork_ = GTEST_FLAG(death_test_use_fork);
171 filter_ = GTEST_FLAG(filter);
172 internal_run_death_test_ = GTEST_FLAG(internal_run_death_test);
173 list_tests_ = GTEST_FLAG(list_tests);
174 output_ = GTEST_FLAG(output);
175 print_time_ = GTEST_FLAG(print_time);
176 random_seed_ = GTEST_FLAG(random_seed);
177 repeat_ = GTEST_FLAG(repeat);
178 shuffle_ = GTEST_FLAG(shuffle);
179 stack_trace_depth_ = GTEST_FLAG(stack_trace_depth);
180 stream_result_to_ = GTEST_FLAG(stream_result_to);
181 throw_on_failure_ = GTEST_FLAG(throw_on_failure);
186 GTEST_FLAG(also_run_disabled_tests) = also_run_disabled_tests_;
187 GTEST_FLAG(break_on_failure) = break_on_failure_;
188 GTEST_FLAG(catch_exceptions) = catch_exceptions_;
189 GTEST_FLAG(color) = color_;
190 GTEST_FLAG(death_test_style) = death_test_style_;
191 GTEST_FLAG(death_test_use_fork) = death_test_use_fork_;
192 GTEST_FLAG(filter) = filter_;
193 GTEST_FLAG(internal_run_death_test) = internal_run_death_test_;
194 GTEST_FLAG(list_tests) = list_tests_;
195 GTEST_FLAG(output) = output_;
196 GTEST_FLAG(print_time) = print_time_;
197 GTEST_FLAG(random_seed) = random_seed_;
198 GTEST_FLAG(repeat) = repeat_;
199 GTEST_FLAG(shuffle) = shuffle_;
200 GTEST_FLAG(stack_trace_depth) = stack_trace_depth_;
201 GTEST_FLAG(stream_result_to) = stream_result_to_;
202 GTEST_FLAG(throw_on_failure) = throw_on_failure_;
207 bool also_run_disabled_tests_;
208 bool break_on_failure_;
209 bool catch_exceptions_;
211 std::string death_test_style_;
212 bool death_test_use_fork_;
214 std::string internal_run_death_test_;
218 internal::Int32 random_seed_;
219 internal::Int32 repeat_;
221 internal::Int32 stack_trace_depth_;
222 std::string stream_result_to_;
223 bool throw_on_failure_;
224 } GTEST_ATTRIBUTE_UNUSED_;
232 GTEST_API_ std::string CodePointToUtf8(UInt32 code_point);
247 GTEST_API_ std::string WideStringToUtf8(
const wchar_t* str,
int num_chars);
253 void WriteToShardStatusFileIfNeeded();
261 GTEST_API_
bool ShouldShard(
const char* total_shards_str,
262 const char* shard_index_str,
263 bool in_subprocess_for_death_test);
268 GTEST_API_ Int32 Int32FromEnvOrDie(
const char* env_var, Int32 default_val);
274 GTEST_API_
bool ShouldRunTestOnShard(
275 int total_shards,
int shard_index,
int test_id);
281 template <
class Container,
typename Predicate>
282 inline int CountIf(
const Container& c, Predicate predicate) {
286 for (
typename Container::const_iterator it = c.begin(); it != c.end(); ++it) {
294 template <
class Container,
typename Functor>
295 void ForEach(
const Container& c,
Functor functor) {
296 std::for_each(c.begin(), c.end(), functor);
301 template <
typename E>
302 inline E GetElementOr(
const std::vector<E>& v,
int i, E default_value) {
303 return (i < 0 || i >= static_cast<int>(v.size())) ? default_value : v[i];
310 template <
typename E>
311 void ShuffleRange(internal::Random* random,
int begin,
int end,
313 const int size =
static_cast<int>(v->size());
314 GTEST_CHECK_(0 <= begin && begin <= size)
315 <<
"Invalid shuffle range start " << begin <<
": must be in range [0, " 317 GTEST_CHECK_(begin <= end && end <= size)
318 <<
"Invalid shuffle range finish " << end <<
": must be in range [" 319 << begin <<
", " << size <<
"].";
323 for (
int range_width = end - begin; range_width >= 2; range_width--) {
324 const int last_in_range = begin + range_width - 1;
325 const int selected = begin + random->Generate(range_width);
326 std::swap((*v)[selected], (*v)[last_in_range]);
331 template <
typename E>
332 inline void Shuffle(internal::Random* random, std::vector<E>* v) {
333 ShuffleRange(random, 0, static_cast<int>(v->size()), v);
338 template <
typename T>
339 static void Delete(
T* x) {
346 class TestPropertyKeyIs {
351 explicit TestPropertyKeyIs(
const std::string& key) : key_(key) {}
354 bool operator()(
const TestProperty& test_property)
const {
355 return test_property.key() == key_;
372 class GTEST_API_ UnitTestOptions {
377 static std::string GetOutputFormat();
382 static std::string GetAbsolutePathToOutputFile();
391 static bool PatternMatchesString(
const char *pattern,
const char *str);
395 static bool FilterMatchesTest(
const std::string &test_case_name,
396 const std::string &test_name);
404 static int GTestShouldProcessSEH(DWORD exception_code);
405 #endif // GTEST_OS_WINDOWS 409 static bool MatchesFilter(
const std::string& name,
const char* filter);
414 GTEST_API_ FilePath GetCurrentExecutableName();
417 class OsStackTraceGetterInterface {
419 OsStackTraceGetterInterface() {}
420 virtual ~OsStackTraceGetterInterface() {}
428 virtual string CurrentStackTrace(
int max_depth,
int skip_count) = 0;
433 virtual void UponLeavingGTest() = 0;
436 GTEST_DISALLOW_COPY_AND_ASSIGN_(OsStackTraceGetterInterface);
440 class OsStackTraceGetter :
public OsStackTraceGetterInterface {
442 OsStackTraceGetter() : caller_frame_(NULL) {}
444 virtual string CurrentStackTrace(
int max_depth,
int skip_count)
445 GTEST_LOCK_EXCLUDED_(mutex_);
447 virtual void UponLeavingGTest() GTEST_LOCK_EXCLUDED_(mutex_);
451 static const
char* const kElidedFramesMarker;
462 GTEST_DISALLOW_COPY_AND_ASSIGN_(OsStackTraceGetter);
474 class DefaultGlobalTestPartResultReporter
475 :
public TestPartResultReporterInterface {
477 explicit DefaultGlobalTestPartResultReporter(UnitTestImpl* unit_test);
480 virtual void ReportTestPartResult(
const TestPartResult& result);
483 UnitTestImpl*
const unit_test_;
485 GTEST_DISALLOW_COPY_AND_ASSIGN_(DefaultGlobalTestPartResultReporter);
490 class DefaultPerThreadTestPartResultReporter
491 :
public TestPartResultReporterInterface {
493 explicit DefaultPerThreadTestPartResultReporter(UnitTestImpl* unit_test);
496 virtual void ReportTestPartResult(
const TestPartResult& result);
499 UnitTestImpl*
const unit_test_;
501 GTEST_DISALLOW_COPY_AND_ASSIGN_(DefaultPerThreadTestPartResultReporter);
508 class GTEST_API_ UnitTestImpl {
510 explicit UnitTestImpl(UnitTest* parent);
511 virtual ~UnitTestImpl();
521 TestPartResultReporterInterface* GetGlobalTestPartResultReporter();
524 void SetGlobalTestPartResultReporter(
525 TestPartResultReporterInterface* reporter);
528 TestPartResultReporterInterface* GetTestPartResultReporterForCurrentThread();
531 void SetTestPartResultReporterForCurrentThread(
532 TestPartResultReporterInterface* reporter);
535 int successful_test_case_count()
const;
538 int failed_test_case_count()
const;
541 int total_test_case_count()
const;
545 int test_case_to_run_count()
const;
548 int successful_test_count()
const;
551 int failed_test_count()
const;
554 int reportable_disabled_test_count()
const;
557 int disabled_test_count()
const;
560 int reportable_test_count()
const;
563 int total_test_count()
const;
566 int test_to_run_count()
const;
570 TimeInMillis start_timestamp()
const {
return start_timestamp_; }
573 TimeInMillis elapsed_time()
const {
return elapsed_time_; }
576 bool Passed()
const {
return !Failed(); }
580 bool Failed()
const {
581 return failed_test_case_count() > 0 || ad_hoc_test_result()->Failed();
586 const TestCase* GetTestCase(
int i)
const {
587 const int index = GetElementOr(test_case_indices_, i, -1);
588 return index < 0 ? NULL : test_cases_[i];
593 TestCase* GetMutableTestCase(
int i) {
594 const int index = GetElementOr(test_case_indices_, i, -1);
595 return index < 0 ? NULL : test_cases_[index];
599 TestEventListeners* listeners() {
return &listeners_; }
603 TestResult* current_test_result();
606 const TestResult* ad_hoc_test_result()
const {
return &ad_hoc_test_result_; }
613 void set_os_stack_trace_getter(OsStackTraceGetterInterface* getter);
618 OsStackTraceGetterInterface* os_stack_trace_getter();
630 std::string CurrentOsStackTraceExceptTop(
int skip_count) GTEST_NO_INLINE_;
642 TestCase* GetTestCase(
const char* test_case_name,
643 const char* type_param,
644 Test::SetUpTestCaseFunc set_up_tc,
645 Test::TearDownTestCaseFunc tear_down_tc);
654 void AddTestInfo(Test::SetUpTestCaseFunc set_up_tc,
655 Test::TearDownTestCaseFunc tear_down_tc,
656 TestInfo* test_info) {
664 if (original_working_dir_.IsEmpty()) {
665 original_working_dir_.Set(FilePath::GetCurrentDir());
666 GTEST_CHECK_(!original_working_dir_.IsEmpty())
667 <<
"Failed to get the current working directory.";
670 GetTestCase(test_info->test_case_name(),
671 test_info->type_param(),
673 tear_down_tc)->AddTestInfo(test_info);
676 #if GTEST_HAS_PARAM_TEST 679 internal::ParameterizedTestCaseRegistry& parameterized_test_registry() {
680 return parameterized_test_registry_;
682 #endif // GTEST_HAS_PARAM_TEST 685 void set_current_test_case(TestCase* a_current_test_case) {
686 current_test_case_ = a_current_test_case;
692 void set_current_test_info(TestInfo* a_current_test_info) {
693 current_test_info_ = a_current_test_info;
702 void RegisterParameterizedTests();
711 void ClearNonAdHocTestResult() {
712 ForEach(test_cases_, TestCase::ClearTestCaseResult);
716 void ClearAdHocTestResult() {
717 ad_hoc_test_result_.Clear();
724 void RecordProperty(
const TestProperty& test_property);
726 enum ReactionToSharding {
727 HONOR_SHARDING_PROTOCOL,
728 IGNORE_SHARDING_PROTOCOL
737 int FilterTests(ReactionToSharding shard_tests);
740 void ListTestsMatchingFilter();
742 const TestCase* current_test_case()
const {
return current_test_case_; }
743 TestInfo* current_test_info() {
return current_test_info_; }
744 const TestInfo* current_test_info()
const {
return current_test_info_; }
748 std::vector<Environment*>& environments() {
return environments_; }
751 std::vector<TraceInfo>& gtest_trace_stack() {
752 return *(gtest_trace_stack_.pointer());
754 const std::vector<TraceInfo>& gtest_trace_stack()
const {
755 return gtest_trace_stack_.get();
758 #if GTEST_HAS_DEATH_TEST 759 void InitDeathTestSubprocessControlInfo() {
760 internal_run_death_test_flag_.reset(ParseInternalRunDeathTestFlag());
766 const InternalRunDeathTestFlag* internal_run_death_test_flag()
const {
767 return internal_run_death_test_flag_.get();
771 internal::DeathTestFactory* death_test_factory() {
772 return death_test_factory_.get();
775 void SuppressTestEventsIfInSubprocess();
777 friend class ReplaceDeathTestFactory;
778 #endif // GTEST_HAS_DEATH_TEST 782 void ConfigureXmlOutput();
784 #if GTEST_CAN_STREAM_RESULTS_ 787 void ConfigureStreamingOutput();
795 void PostFlagParsingInit();
798 int random_seed()
const {
return random_seed_; }
801 internal::Random* random() {
return &random_; }
808 void UnshuffleTests();
812 bool catch_exceptions()
const {
return catch_exceptions_; }
815 friend class ::testing::UnitTest;
819 void set_catch_exceptions(
bool value) { catch_exceptions_ = value; }
822 UnitTest*
const parent_;
826 internal::FilePath original_working_dir_;
829 DefaultGlobalTestPartResultReporter default_global_test_part_result_reporter_;
830 DefaultPerThreadTestPartResultReporter
831 default_per_thread_test_part_result_reporter_;
834 TestPartResultReporterInterface* global_test_part_result_repoter_;
837 internal::Mutex global_test_part_result_reporter_mutex_;
840 internal::ThreadLocal<TestPartResultReporterInterface*>
841 per_thread_test_part_result_reporter_;
845 std::vector<Environment*> environments_;
849 std::vector<TestCase*> test_cases_;
855 std::vector<int> test_case_indices_;
857 #if GTEST_HAS_PARAM_TEST 860 internal::ParameterizedTestCaseRegistry parameterized_test_registry_;
863 bool parameterized_tests_registered_;
864 #endif // GTEST_HAS_PARAM_TEST 867 int last_death_test_case_;
873 TestCase* current_test_case_;
879 TestInfo* current_test_info_;
889 TestResult ad_hoc_test_result_;
893 TestEventListeners listeners_;
899 OsStackTraceGetterInterface* os_stack_trace_getter_;
902 bool post_flag_parse_init_performed_;
908 internal::Random random_;
912 TimeInMillis start_timestamp_;
915 TimeInMillis elapsed_time_;
917 #if GTEST_HAS_DEATH_TEST 920 internal::scoped_ptr<InternalRunDeathTestFlag> internal_run_death_test_flag_;
921 internal::scoped_ptr<internal::DeathTestFactory> death_test_factory_;
922 #endif // GTEST_HAS_DEATH_TEST 925 internal::ThreadLocal<std::vector<TraceInfo> > gtest_trace_stack_;
929 bool catch_exceptions_;
931 GTEST_DISALLOW_COPY_AND_ASSIGN_(UnitTestImpl);
936 inline UnitTestImpl* GetUnitTestImpl() {
937 return UnitTest::GetInstance()->impl();
940 #if GTEST_USES_SIMPLE_RE 944 GTEST_API_
bool IsInSet(
char ch,
const char* str);
945 GTEST_API_
bool IsAsciiDigit(
char ch);
946 GTEST_API_
bool IsAsciiPunct(
char ch);
947 GTEST_API_
bool IsRepeat(
char ch);
948 GTEST_API_
bool IsAsciiWhiteSpace(
char ch);
949 GTEST_API_
bool IsAsciiWordChar(
char ch);
950 GTEST_API_
bool IsValidEscape(
char ch);
951 GTEST_API_
bool AtomMatchesChar(
bool escaped,
char pattern,
char ch);
952 GTEST_API_
bool ValidateRegex(
const char* regex);
953 GTEST_API_
bool MatchRegexAtHead(
const char* regex,
const char* str);
954 GTEST_API_
bool MatchRepetitionAndRegexAtHead(
955 bool escaped,
char ch,
char repeat,
const char* regex,
const char* str);
956 GTEST_API_
bool MatchRegexAnywhere(
const char* regex,
const char* str);
958 #endif // GTEST_USES_SIMPLE_RE 962 GTEST_API_
void ParseGoogleTestFlagsOnly(
int* argc,
char** argv);
963 GTEST_API_
void ParseGoogleTestFlagsOnly(
int* argc,
wchar_t** argv);
965 #if GTEST_HAS_DEATH_TEST 969 GTEST_API_ std::string GetLastErrnoDescription();
971 # if GTEST_OS_WINDOWS 975 AutoHandle() : handle_(INVALID_HANDLE_VALUE) {}
976 explicit AutoHandle(HANDLE handle) : handle_(handle) {}
978 ~AutoHandle() { Reset(); }
980 HANDLE Get()
const {
return handle_; }
981 void Reset() { Reset(INVALID_HANDLE_VALUE); }
982 void Reset(HANDLE handle) {
983 if (handle != handle_) {
984 if (handle_ != INVALID_HANDLE_VALUE)
985 ::CloseHandle(handle_);
993 GTEST_DISALLOW_COPY_AND_ASSIGN_(AutoHandle);
995 # endif // GTEST_OS_WINDOWS 1001 template <
typename Integer>
1002 bool ParseNaturalNumber(const ::std::string& str, Integer* number) {
1006 if (str.empty() || !IsDigit(str[0])) {
1015 # if GTEST_OS_WINDOWS && !defined(__GNUC__) 1018 typedef unsigned __int64 BiggestConvertible;
1019 const BiggestConvertible parsed = _strtoui64(str.c_str(), &end, 10);
1023 typedef unsigned long long BiggestConvertible;
1024 const BiggestConvertible parsed = strtoull(str.c_str(), &end, 10);
1026 # endif // GTEST_OS_WINDOWS && !defined(__GNUC__) 1028 const bool parse_success = *end ==
'\0' && errno == 0;
1032 GTEST_CHECK_(
sizeof(Integer) <=
sizeof(parsed));
1034 const Integer result =
static_cast<Integer
>(parsed);
1035 if (parse_success && static_cast<BiggestConvertible>(result) == parsed) {
1041 #endif // GTEST_HAS_DEATH_TEST 1049 class TestResultAccessor {
1051 static void RecordProperty(TestResult* test_result,
1052 const std::string& xml_element,
1053 const TestProperty& property) {
1054 test_result->RecordProperty(xml_element, property);
1057 static void ClearTestPartResults(TestResult* test_result) {
1058 test_result->ClearTestPartResults();
1061 static const std::vector<testing::TestPartResult>& test_part_results(
1062 const TestResult& test_result) {
1063 return test_result.test_part_results();
1067 #if GTEST_CAN_STREAM_RESULTS_ 1070 class StreamingListener :
public EmptyTestEventListener {
1073 class AbstractSocketWriter {
1075 virtual ~AbstractSocketWriter() {}
1078 virtual void Send(
const string& message) = 0;
1081 virtual void CloseConnection() {}
1084 void SendLn(
const string& message) {
1085 Send(message +
"\n");
1090 class SocketWriter :
public AbstractSocketWriter {
1092 SocketWriter(
const string& host,
const string& port)
1093 : sockfd_(-1), host_name_(host), port_num_(port) {
1097 virtual ~SocketWriter() {
1103 virtual void Send(
const string& message) {
1104 GTEST_CHECK_(sockfd_ != -1)
1105 <<
"Send() can be called only when there is a connection.";
1107 const int len =
static_cast<int>(message.length());
1108 if (write(sockfd_, message.c_str(), len) != len) {
1110 <<
"stream_result_to: failed to stream to " 1111 << host_name_ <<
":" << port_num_;
1117 void MakeConnection();
1120 void CloseConnection() {
1121 GTEST_CHECK_(sockfd_ != -1)
1122 <<
"CloseConnection() can be called only when there is a connection.";
1129 const string host_name_;
1130 const string port_num_;
1132 GTEST_DISALLOW_COPY_AND_ASSIGN_(SocketWriter);
1136 static string UrlEncode(
const char* str);
1138 StreamingListener(
const string& host,
const string& port)
1139 : socket_writer_(new SocketWriter(host, port)) { Start(); }
1141 explicit StreamingListener(AbstractSocketWriter* socket_writer)
1142 : socket_writer_(socket_writer) { Start(); }
1144 void OnTestProgramStart(
const UnitTest& ) {
1145 SendLn(
"event=TestProgramStart");
1148 void OnTestProgramEnd(
const UnitTest& unit_test) {
1151 SendLn(
"event=TestProgramEnd&passed=" + FormatBool(unit_test.Passed()));
1154 socket_writer_->CloseConnection();
1157 void OnTestIterationStart(
const UnitTest& ,
int iteration) {
1158 SendLn(
"event=TestIterationStart&iteration=" +
1159 StreamableToString(iteration));
1162 void OnTestIterationEnd(
const UnitTest& unit_test,
int ) {
1163 SendLn(
"event=TestIterationEnd&passed=" +
1164 FormatBool(unit_test.Passed()) +
"&elapsed_time=" +
1165 StreamableToString(unit_test.elapsed_time()) +
"ms");
1168 void OnTestCaseStart(
const TestCase& test_case) {
1169 SendLn(std::string(
"event=TestCaseStart&name=") + test_case.name());
1172 void OnTestCaseEnd(
const TestCase& test_case) {
1173 SendLn(
"event=TestCaseEnd&passed=" + FormatBool(test_case.Passed())
1174 +
"&elapsed_time=" + StreamableToString(test_case.elapsed_time())
1178 void OnTestStart(
const TestInfo& test_info) {
1179 SendLn(std::string(
"event=TestStart&name=") + test_info.name());
1182 void OnTestEnd(
const TestInfo& test_info) {
1183 SendLn(
"event=TestEnd&passed=" +
1184 FormatBool((test_info.result())->Passed()) +
1186 StreamableToString((test_info.result())->elapsed_time()) +
"ms");
1189 void OnTestPartResult(
const TestPartResult& test_part_result) {
1190 const char* file_name = test_part_result.file_name();
1191 if (file_name == NULL)
1193 SendLn(
"event=TestPartResult&file=" + UrlEncode(file_name) +
1194 "&line=" + StreamableToString(test_part_result.line_number()) +
1195 "&message=" + UrlEncode(test_part_result.message()));
1200 void SendLn(
const string& message) { socket_writer_->SendLn(message); }
1204 void Start() { SendLn(
"gtest_streaming_protocol_version=1.0"); }
1206 string FormatBool(
bool value) {
return value ?
"1" :
"0"; }
1208 const scoped_ptr<AbstractSocketWriter> socket_writer_;
1210 GTEST_DISALLOW_COPY_AND_ASSIGN_(StreamingListener);
1213 #endif // GTEST_CAN_STREAM_RESULTS_ 1218 #endif // GTEST_SRC_GTEST_INTERNAL_INL_H_ Definition: NonLinearOptimization.cpp:107
Definition: gtest-all.cc:113
detail::size< coerce_list< Ts... >> size
Get the size of a list (number of elements.)
Definition: Size.h:56
find_first< key_types< Derived >, Key > index
Gets the index of the key in a key list for a given type-keyed container.
Definition: TypeKeyed.h:67
A small structure to hold a non zero as a triplet (i,j,value).
Definition: SparseUtil.h:148
Definition: BandTriangularSolver.h:13