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