MCPcopy Create free account
hub / github.com/OpenZWave/open-zwave / WriteToShardStatusFileIfNeeded

Function WriteToShardStatusFileIfNeeded

cpp/test/src/gtest.cc:4692–4706  ·  view source on GitHub ↗

Reads the GTEST_SHARD_STATUS_FILE environment variable, and creates the file if the variable is present. If a file already exists at this location, this function will write over it. If the variable is present, but the file cannot be created, prints an error and exits.

Source from the content-addressed store, hash-verified

4690// function will write over it. If the variable is present, but the file cannot
4691// be created, prints an error and exits.
4692void WriteToShardStatusFileIfNeeded() {
4693 const char* const test_shard_file = posix::GetEnv(kTestShardStatusFile);
4694 if (test_shard_file != NULL) {
4695 FILE* const file = posix::FOpen(test_shard_file, "w");
4696 if (file == NULL) {
4697 ColoredPrintf(COLOR_RED,
4698 "Could not write to the test shard status file \"%s\" "
4699 "specified by the %s environment variable.\n",
4700 test_shard_file, kTestShardStatusFile);
4701 fflush(stdout);
4702 exit(EXIT_FAILURE);
4703 }
4704 fclose(file);
4705 }
4706}
4707
4708// Checks whether sharding is enabled by examining the relevant
4709// environment variable values. If the variables are present,

Callers 1

RunAllTestsMethod · 0.85

Calls 3

GetEnvFunction · 0.85
FOpenFunction · 0.85
ColoredPrintfFunction · 0.85

Tested by

no test coverage detected