File: Main.cpp

package info (click to toggle)
pentobi 26.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,068 kB
  • sloc: cpp: 25,986; javascript: 897; xml: 57; makefile: 13; sh: 11
file content (28 lines) | stat: -rw-r--r-- 945 bytes parent folder | download | duplicates (4)
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
//-----------------------------------------------------------------------------
/** @file libboardgame_test/Main.cpp
    @author Markus Enzenberger
    @copyright GNU General Public License version 3 or later */
//-----------------------------------------------------------------------------

#include "libboardgame_base/Log.h"
#include "libboardgame_test/Test.h"

using namespace libboardgame_test;

//-----------------------------------------------------------------------------

/** Main function that runs all tests (if no arguments) or only the tests
    given as arguments. */
int main(int argc, char* argv[])
{
    libboardgame_base::LogInitializer log_initializer;
    if (argc < 2)
        return run_all_tests() ? 0 : 1;
    int result = 0;
    for (int i = 1; i < argc; ++i)
        if (! run_test(argv[i]))
            result = 1;
    return result;
}

//-----------------------------------------------------------------------------