Allow tests to suppress deprecation warnings
This prevents certain tests from failing comparisons with blessed output files.
This commit is contained in:
parent
56d481785c
commit
2483e39ae5
7 changed files with 19 additions and 2 deletions
|
|
@ -180,6 +180,9 @@ void error(const std::string& msg);
|
|||
//! @copydoc Application::warn_deprecated
|
||||
void warn_deprecated(const std::string& method, const std::string& extra="");
|
||||
|
||||
//! @copydoc Application::suppress_deprecation_warnings
|
||||
void suppress_deprecation_warnings();
|
||||
|
||||
//! @copydoc Application::Messages::setLogger
|
||||
void setLogger(Logger* logwriter);
|
||||
|
||||
|
|
|
|||
|
|
@ -321,6 +321,7 @@ Application::Application() :
|
|||
stop_on_error(false),
|
||||
options(),
|
||||
xmlfiles(),
|
||||
m_suppress_deprecation_warnings(false),
|
||||
pMessenger()
|
||||
{
|
||||
#if !defined( THREAD_SAFE_CANTERA )
|
||||
|
|
@ -373,7 +374,7 @@ void Application::ApplicationDestroy()
|
|||
void Application::warn_deprecated(const std::string& method,
|
||||
const std::string& extra)
|
||||
{
|
||||
if (warnings.count(method)) {
|
||||
if (m_suppress_deprecation_warnings || warnings.count(method)) {
|
||||
return;
|
||||
}
|
||||
warnings.insert(method);
|
||||
|
|
|
|||
|
|
@ -446,6 +446,10 @@ public:
|
|||
//! invocation of the application.
|
||||
void warn_deprecated(const std::string& method, const std::string& extra="");
|
||||
|
||||
void suppress_deprecation_warnings() {
|
||||
m_suppress_deprecation_warnings = true;
|
||||
}
|
||||
|
||||
//! @copydoc Messages::setLogger
|
||||
void setLogger(Logger* logwriter) {
|
||||
pMessenger->setLogger(logwriter);
|
||||
|
|
@ -549,6 +553,8 @@ protected:
|
|||
//! Vector of deprecation warnings that have been emitted (to suppress duplicates)
|
||||
std::set<std::string> warnings;
|
||||
|
||||
bool m_suppress_deprecation_warnings;
|
||||
|
||||
//! Current pointer to the logwriter
|
||||
//Logger* logwriter;
|
||||
#ifdef WITH_HTML_LOGS
|
||||
|
|
|
|||
|
|
@ -77,6 +77,11 @@ void warn_deprecated(const std::string& method, const std::string& extra)
|
|||
app()->warn_deprecated(method, extra);
|
||||
}
|
||||
|
||||
void suppress_deprecation_warnings()
|
||||
{
|
||||
app()->suppress_deprecation_warnings();
|
||||
}
|
||||
|
||||
// **************** HTML Logging ****************
|
||||
|
||||
#ifdef WITH_HTML_LOGS
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ int main(int argc, char** argv)
|
|||
ChemEquil_print_lvl = 0;
|
||||
#endif
|
||||
try {
|
||||
|
||||
suppress_deprecation_warnings();
|
||||
IdealGasPhase* gas = new IdealGasMix("air_below6000K.xml","air_below6000K");
|
||||
|
||||
vector_fp IndVar2(6, 0.0);
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ using namespace Cantera;
|
|||
|
||||
void testProblem()
|
||||
{
|
||||
suppress_deprecation_warnings();
|
||||
double T = 273.15 + 352.0;
|
||||
VCSnonideal::vcs_timing_print_lvl = 0;
|
||||
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ int main(int argc, char** argv)
|
|||
#ifdef _MSC_VER
|
||||
_set_output_format(_TWO_DIGIT_EXPONENT);
|
||||
#endif
|
||||
suppress_deprecation_warnings();
|
||||
// int solver = 2;
|
||||
int numSucc = 0;
|
||||
int numFail = 0;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue