tests/file_main.cc
author Alpar Juttner <alpar@cs.elte.hu>
Sun, 11 Dec 2011 18:43:33 +0100
changeset 13 0ab493e5250e
parent 11 cf6519daa7fa
permissions -rw-r--r--
Add build id field to running time logs

Configurable by BENCHMARK_BUILD_ID cmake variable,
which defaults to the last component of the build directory.
     1 /* -*- mode: C++; indent-tabs-mode: nil; -*-
     2  *
     3  * This file is a part of LEMON, a generic C++ optimization library.
     4  *
     5  * Copyright (C) 2003-2011
     6  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
     7  * (Egervary Research Group on Combinatorial Optimization, EGRES).
     8  *
     9  * Permission to use, modify and distribute this software is granted
    10  * provided that this copyright notice appears in all copies. For
    11  * precise terms see the accompanying LICENSE file.
    12  *
    13  * This software is provided "AS IS" with no warranty of any kind,
    14  * express or implied, and with no claim as to its suitability for any
    15  * purpose.
    16  *
    17  */
    18 
    19 #include <benchmark_tools.h>
    20 #include <istream>
    21 #include <lemon/error.h>
    22 
    23 using namespace lemon;
    24 
    25 std::string instance_name;
    26 
    27 int testMain(std::istream &input);
    28 
    29 int main(int argc, char **argv)
    30 {
    31   if(argc!=2) exit(1);
    32 
    33   std::ifstream input;
    34   input.open((DATADIR_PATH+"/"+argv[1]).c_str());
    35   
    36   instance_name = argv[1];
    37 
    38   Timer ti;
    39   testMain(input);
    40   logTime("total",ti);
    41 }