aboutsummaryrefslogtreecommitdiffstats
path: root/vespalib/src/vespa/vespalib/testkit/test_state_guard.h
blob: 034cc3b76dbb469d0d7aaab59e5db8b0ed43e223 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#pragma once

#include "test_master.h"

namespace vespalib {

#ifndef IAM_DOXYGEN
struct TestStateGuard {
    TestStateGuard(const char *file, uint32_t line, const char *msg) {
        TestMaster::master.pushState(file, line, msg);
    }
    ~TestStateGuard() { TestMaster::master.popState(); }
};
#endif

} // namespace vespalib