File: service_test_utils.h

package info (click to toggle)
robotraconteur 1.2.7-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 101,380 kB
  • sloc: cpp: 1,149,268; cs: 87,653; java: 58,127; python: 26,897; ansic: 356; sh: 152; makefile: 90; xml: 51
file content (53 lines) | stat: -rw-r--r-- 1,235 bytes parent folder | download
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#include "array_compare.h"

#include <RobotRaconteur/RobotRaconteurNode.h>
#include <RobotRaconteur/NodeSetup.h>

#pragma once

namespace RobotRaconteur
{
namespace test
{

class GTestThreadLocalListener : public testing::EmptyTestEventListener
{
  public:
    GTestThreadLocalListener();
    virtual void OnTestPartResult(const testing::TestPartResult& test_part_result);
    uint32_t FailureCount();
    std::string FailuresMessage();
    virtual ~GTestThreadLocalListener();

    boost::thread::id thread_id;
    uint32_t failure_count;
    std::string failures_msg;
};

class ThrowIfFailures
{
  public:
    ThrowIfFailures();
    uint32_t FailureCount();
    std::string FailuresMessage();
    void Throw();
    virtual ~ThrowIfFailures();

    RR_SHARED_PTR<GTestThreadLocalListener> gtest_listener;
};

class TestServerNodeConfig
{
  public:
    TestServerNodeConfig(const std::string& nodename);
    std::string GetServiceURL(const std::string& service_name);
    void Shutdown();
    virtual ~TestServerNodeConfig();

    RR_SHARED_PTR<RobotRaconteur::ServerNodeSetup> server;
    RR_SHARED_PTR<RobotRaconteur::RobotRaconteurNode> node;
    std::string node_endpoint_url;
};

} // namespace test
} // namespace RobotRaconteur