Export of internal Abseil changes

--
c385118b3ef0528d150bfe7aeeb63e77f9e463cd by Matt Calabrese <calabrese@google.com>:

Internal-only Archetype generation for testing generic code with user-defined types of various properties.

PiperOrigin-RevId: 283833099

--
4ccf340d3b295aa5b796ee5c97128b61d38899ea by Derek Mauro <dmauro@google.com>:

Fixes the flags parse_test.
Windows doesn't like consecutive path separators.

PiperOrigin-RevId: 283614649

--
5df6d83acb1e49cd1da785cfaf7551f05149f3c9 by Andy Getzendanner <durandal@google.com>:

ABSL_INTERNAL_LOG: forward complete __FILE__ to internal_log_function; not just basename.

PiperOrigin-RevId: 283406080
GitOrigin-RevId: c385118b3ef0528d150bfe7aeeb63e77f9e463cd
Change-Id: Ib0782354691a73fc40185c3262cfd507085b3393
This commit is contained in:
Abseil Team 2019-12-04 14:13:43 -08:00 committed by Mark Barolak
parent a4b757b5d4
commit d659fe54b3
10 changed files with 3112 additions and 43 deletions

View file

@ -22,6 +22,7 @@
#include "absl/base/internal/raw_logging.h"
#include "absl/base/internal/scoped_set_env.h"
#include "absl/flags/flag.h"
#include "absl/strings/match.h"
#include "absl/strings/str_cat.h"
#include "absl/strings/substitute.h"
#include "absl/types/span.h"
@ -92,8 +93,11 @@ const std::string& GetTestTempDir() {
auto len = GetTempPathA(MAX_PATH, temp_path_buffer);
if (len < MAX_PATH && len != 0) {
std::string temp_dir_name = absl::StrCat(
temp_path_buffer, "\\parse_test.", GetCurrentProcessId());
std::string temp_dir_name = temp_path_buffer;
if (!absl::EndsWith(temp_dir_name, "\\")) {
temp_dir_name.push_back('\\');
}
absl::StrAppend(&temp_dir_name, "parse_test.", GetCurrentProcessId());
if (CreateDirectoryA(temp_dir_name.c_str(), nullptr)) {
*res = temp_dir_name;
}
@ -104,11 +108,11 @@ const std::string& GetTestTempDir() {
*res = unique_name;
}
#endif
}
if (res->empty()) {
ABSL_INTERNAL_LOG(FATAL,
"Failed to make temporary directory for data files");
}
if (res->empty()) {
ABSL_INTERNAL_LOG(FATAL,
"Failed to make temporary directory for data files");
}
#ifdef _WIN32