Skip to content

Commit

Permalink
Work around VS refusal to initialize a string
Browse files Browse the repository at this point in the history
  • Loading branch information
nat-goodspeed committed Jun 28, 2024
1 parent 0cc7436 commit 982ea7f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions indra/test/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -550,15 +550,15 @@ int main(int argc, char **argv)
// specific test we want to monitor, and some viewer integration tests are
// quite verbose. In addition to noticing plain LOGTEST= (for all tests),
// also notice LOGTEST_progname= (for a specific test).
std::string basename{ fsyspath(argv[0]).stem() };
std::string basename(fsyspath(argv[0]).stem());
// don't make user set LOGTEST_INTEGRATION_TEST_progname or (worse)
// LOGTEST_PROJECT_foo_TEST_bar -- only LOGTEST_progname or LOGTEST_bar
auto _TEST_ = basename.find("_TEST_");
if (_TEST_ != std::string::npos)
{
basename.erase(0, _TEST_+6);
}
std::string LOGTEST_prog_key{ "LOGTEST_" + basename };
std::string LOGTEST_prog_key("LOGTEST_" + basename);
const char* LOGTEST_prog = getenv(LOGTEST_prog_key.c_str());
// std::cout << LOGTEST_prog_key << "='" << (LOGTEST_prog? LOGTEST_prog : "") << "'" << std::endl;
if (LOGTEST_prog && *LOGTEST_prog)
Expand Down

0 comments on commit 982ea7f

Please sign in to comment.