summaryrefslogtreecommitdiffstats
path: root/ios/UnitTest/UnitTest/ViewController.mm
blob: fa002f107f27436fdf9f270425ae192e3b158682 (plain)
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
 * This file is part of the LibreOffice project.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */

#include <cassert>
#include <iostream>

#include <sal/config.h>

#include <cppuhelper/exc_hlp.hxx>
#include <com/sun/star/ucb/InteractiveAugmentedIOException.hpp>
#include <com/sun/star/uno/Any.hxx>

#include <cppunit/CompilerOutputter.h>
#include <cppunit/TestResult.h>
#include <cppunit/TestResultCollector.h>
#include <cppunit/TestRunner.h>
#include <cppunit/TextTestProgressListener.h>

#import <LibreOfficeKit/LibreOfficeKit.hxx>

extern "C" {
#import <native-code.h>
}

#include <premac.h>
#import <CoreGraphics/CoreGraphics.h>
#import "ViewController.h"
#include <postmac.h>

@interface ViewController ()

@end

#define CPPUNIT_PLUGIN_EXPORTED_NAME CppuMisc
#include "../../../cppuhelper/qa/misc/test_misc.cxx"

#undef CPPUNIT_PLUGIN_EXPORTED_NAME
#define CPPUNIT_PLUGIN_EXPORTED_NAME CppuUnourl
#include "../../../cppuhelper/qa/unourl/cppu_unourl.cxx"

#define main tilebench_main
#include "../../../libreofficekit/qa/tilebench/tilebench.cxx"

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    // First run some normal cppunit tests

    CppUnit::TestResult result;

    CppUnit::TextTestProgressListener logger;
    result.addListener(&logger);

    CppUnit::TestResultCollector collector;
    result.addListener(&collector);

    CppUnit::TestRunner runner;
    runner.addTest(CppUnit::TestFactoryRegistry::getRegistry().makeTest());
    runner.run(result);

    CppUnit::CompilerOutputter outputter(&collector, std::cerr);
    outputter.write();

    // Then some more specific stuff
    tilebench_main(0, nullptr);
}

@end