2
* Copyright © 2012, 2013 Canonical Ltd.
4
* This program is free software: you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License version 3 as
6
* published by the Free Software Foundation.
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details.
13
* You should have received a copy of the GNU General Public License
14
* along with this program. If not, see <http://www.gnu.org/licenses/>.
16
* Authored by: Alan Griffiths <alan@octopull.co.uk>
19
#include "mir_test_framework/display_server_test_fixture.h"
20
#include "mir_test_framework/testing_server_configuration.h"
21
#include "mir_test_framework/in_process_server.h"
22
#include "mir_test_framework/using_stub_client_platform.h"
24
#include "mir_toolkit/mir_client_library.h"
26
#include <gmock/gmock.h>
27
#include <gtest/gtest.h>
32
namespace mf = mir::frontend;
34
// We need some tests to prove that errors are reported by the
35
// display server test fixture. But don't want them to fail in
37
TEST_F(BespokeDisplayServerTestFixture, DISABLED_failing_server_side_test)
39
struct Server : TestingServerConfiguration
43
using namespace testing;
44
FAIL() << "Proving a test can fail";
48
launch_server_process(fail);
51
TEST_F(BespokeDisplayServerTestFixture, DISABLED_failing_without_server)
55
TEST_F(DefaultDisplayServerTestFixture, demonstrate_multiple_clients)
57
struct Client : TestingClientConfiguration
61
SCOPED_TRACE("Demo Client");
65
for(int i = 0; i != 10; ++i)
67
launch_client_process(demo);
73
struct DemoInProcessServer : mir_test_framework::InProcessServer
75
virtual mir::DefaultServerConfiguration& server_config() { return server_config_; }
77
mir_test_framework::StubbedServerConfiguration server_config_;
78
mir_test_framework::UsingStubClientPlatform using_stub_client_platform;
82
TEST_F(DemoInProcessServer, client_can_connect)
84
auto const connection = mir_connect_sync(new_connection().c_str(), __PRETTY_FUNCTION__);
85
EXPECT_TRUE(mir_connection_is_valid(connection));
87
mir_connection_release(connection);