[libcxx] r275754 - Add checkpoint diagnostics to help diagnose buildbot failures.
Eric Fiselier via cfe-commits
cfe-commits at lists.llvm.org
Sun Jul 17 20:00:10 PDT 2016
Author: ericwf
Date: Sun Jul 17 22:00:09 2016
New Revision: 275754
URL: http://llvm.org/viewvc/llvm-project?rev=275754&view=rev
Log:
Add checkpoint diagnostics to help diagnose buildbot failures.
Modified:
libcxx/trunk/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/types.pass.cpp
libcxx/trunk/test/support/assert_checkpoint.h
Modified: libcxx/trunk/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/types.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/types.pass.cpp?rev=275754&r1=275753&r2=275754&view=diff
==============================================================================
--- libcxx/trunk/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/types.pass.cpp (original)
+++ libcxx/trunk/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/types.pass.cpp Sun Jul 17 22:00:09 2016
@@ -28,10 +28,12 @@
#include <cassert>
#include "platform_support.h" // locale name macros
+#include "assert_checkpoint.h"
int main()
{
{
+ CHECKPOINT("constructing en-US.UTF-8");
std::locale l(LOCALE_en_US_UTF_8);
{
assert(std::has_facet<std::ctype_byname<char> >(l));
@@ -45,6 +47,7 @@ int main()
}
}
{
+ CHECKPOINT("constructing default locale");
std::locale l("");
{
assert(std::has_facet<std::ctype_byname<char> >(l));
@@ -58,6 +61,7 @@ int main()
}
}
{
+ CHECKPOINT("constructing C locale");
std::locale l("C");
{
assert(std::has_facet<std::ctype_byname<char> >(l));
Modified: libcxx/trunk/test/support/assert_checkpoint.h
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/support/assert_checkpoint.h?rev=275754&r1=275753&r2=275754&view=diff
==============================================================================
--- libcxx/trunk/test/support/assert_checkpoint.h (original)
+++ libcxx/trunk/test/support/assert_checkpoint.h Sun Jul 17 22:00:09 2016
@@ -11,6 +11,11 @@ struct Checkpoint {
int line;
const char* msg;
+ Checkpoint() : file(nullptr), func(nullptr), line(-1), msg(nullptr) {}
+ Checkpoint(const char* xfile, const char* xfunc, int xline, const char* xmsg)
+ : file(xfile), func(xfunc), line(xline), msg(xmsg)
+ {}
+
template <class Stream>
void print(Stream& s) const {
if (!file) {
@@ -30,7 +35,7 @@ inline Checkpoint& globalCheckpoint() {
}
inline void clearCheckpoint() {
- globalCheckpoint() = {};
+ globalCheckpoint() = Checkpoint();
}
#if defined(__GNUC__)
@@ -39,7 +44,7 @@ inline void clearCheckpoint() {
#define CHECKPOINT_FUNCTION_NAME __func__
#endif
-#define CHECKPOINT(msg) globalCheckpoint() = Checkpoint{__FILE__, CHECKPOINT_FUNCTION_NAME, __LINE__, msg}
+#define CHECKPOINT(msg) globalCheckpoint() = Checkpoint(__FILE__, CHECKPOINT_FUNCTION_NAME, __LINE__, msg);
inline void checkpointSignalHandler(int signal) {
if (signal == SIGABRT) {
More information about the cfe-commits
mailing list