forked from KhronosGroup/SYCL-CTS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_base.cpp
36 lines (30 loc) · 935 Bytes
/
test_base.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/*******************************************************************************
//
// SYCL 2020 Conformance Test Suite
//
// Provide implementation of test_base class functions
//
*******************************************************************************/
#include "test_base.h"
#include <sycl/sycl.hpp>
#include "../tests/common/macros.h"
#include "logger.h"
#include "sycl_exceptions.h"
// conformance test suite namespace
namespace sycl_cts {
namespace util {
void test_base::run_test(class logger &log) {
try {
if (this->setup(log))
this->run(log);
} catch (const sycl::exception &e) {
log_exception(log, e);
auto errorMsg = "a SYCL exception was caught: " + std::string(e.what());
FAIL(log, errorMsg);
} catch (const std::exception &e) {
auto errorMsg = "an exception was caught: " + std::string(e.what());
FAIL(log, errorMsg);
}
}
} // namespace util
} // namespace sycl_cts