| 1 |
// Copyright(C) 1999-2020 National Technology & Engineering Solutions |
| 2 |
// of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with |
| 3 |
// NTESS, the U.S. Government retains certain rights in this software. |
| 4 |
// |
| 5 |
// See packages/seacas/LICENSE for details |
| 6 |
|
| 7 |
#pragma once |
| 8 |
|
| 9 |
#include "gtest/gtest.h" |
| 10 |
#include <catalyst/Iocatalyst_CatalystLogging.h> |
| 11 |
|
| 12 |
class LoggingTest : public ::testing::Test |
| 13 |
{ |
| 14 |
protected: |
| 15 |
Iocatalyst::CatalystLogging log; |
| 16 |
Ioss::PropertyManager props; |
| 17 |
|
| 18 |
~LoggingTest() { remove(log.getLogFileName().c_str()); } |
| 19 |
|
| 20 |
void checkTestOutputFileExists(const char *fileName) { EXPECT_TRUE(isFileExists(fileName)); } |
| 21 |
|
| 22 |
bool isFileExists(const char *fileName) |
| 23 |
{ |
| 24 |
FILE *fp = fopen(fileName, "r"); |
| 25 |
bool outputFileExists = false; |
| 26 |
if (fp != NULL) { |
| 27 |
outputFileExists = true; |
| 28 |
fclose(fp); |
| 29 |
} |
| 30 |
return outputFileExists; |
| 31 |
} |
| 32 |
}; |