File: liblas_test_suite.cpp

package info (click to toggle)
liblas 1.2.1-5
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 3,672 kB
  • sloc: cpp: 10,473; sh: 9,594; ansic: 3,427; makefile: 130
file content (53 lines) | stat: -rw-r--r-- 1,084 bytes parent folder | download | duplicates (2)
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
// $Id$
//
// (C) Copyright Mateusz Loskot 2008, mateusz@loskot.net
// Distributed under the BSD License
// (See accompanying file LICENSE.txt or copy at
// http://www.opensource.org/licenses/bsd-license.php)
//
#include <tut/tut.hpp>
#include <tut/tut_reporter.hpp>
#include <iostream>
#include <string>

namespace tut
{
    test_runner_singleton runner;

    // full path to trunk/test/data
    std::string g_test_data_path;
}

int main(int argc, char* argv[])
{
    if (1 == argc)
    {
        tut::g_test_data_path = "../data"; // default path
    }
    else if (2 == argc)
    {
        tut::g_test_data_path = argv[1];
    }
    else
    {
        std::cout << "Usage: liblas_test <test data path>\n";
        return 1;
    }

    std::cout << "libLAS Test Suite:\n==================";

    tut::reporter reporter;
    tut::runner.get().set_callback(&reporter);

    try
    {
        tut::runner.get().run_tests();
    }
    catch (std::exception const& e)
    {
        std::cerr << "TUT raised exception: " << e.what() << std::endl;
        return 1;
    }

    return 0;
}