2011-01-14 18:09:26 +00:00
|
|
|
//
|
|
|
|
|
// Copyright 2011 Ettus Research LLC
|
2018-02-19 23:30:32 +00:00
|
|
|
// Copyright 2018 Ettus Research, a National Instruments Company
|
2011-01-14 18:09:26 +00:00
|
|
|
//
|
2018-02-19 23:30:32 +00:00
|
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
2011-01-14 18:09:26 +00:00
|
|
|
//
|
|
|
|
|
|
|
|
|
|
#include <uhd/utils/static.hpp>
|
|
|
|
|
#include <iostream>
|
2020-03-02 23:25:13 +00:00
|
|
|
#include <stdexcept>
|
|
|
|
|
_uhd_static_fixture::_uhd_static_fixture(void (*fcn)(void), const char* name)
|
|
|
|
|
{
|
|
|
|
|
try {
|
2011-01-14 18:09:26 +00:00
|
|
|
fcn();
|
2020-03-02 23:25:13 +00:00
|
|
|
} catch (const std::exception& e) {
|
2011-01-14 18:09:26 +00:00
|
|
|
std::cerr << "Exception in static block " << name << std::endl;
|
|
|
|
|
std::cerr << " " << e.what() << std::endl;
|
2020-03-02 23:25:13 +00:00
|
|
|
} catch (...) {
|
2011-01-14 18:09:26 +00:00
|
|
|
std::cerr << "Exception in static block " << name << std::endl;
|
|
|
|
|
}
|
|
|
|
|
}
|