Better handling of the input files of the tests.
authoralpar
Wed, 15 Sep 2004 11:50:50 +0000
changeset 8558c44b64dd436
parent 854 baf0b6e40211
child 856 e9d73b8e3ab6
Better handling of the input files of the tests.
src/test/Makefile.am
src/test/preflow_test.cc
     1.1 --- a/src/test/Makefile.am	Wed Sep 15 10:34:12 2004 +0000
     1.2 +++ b/src/test/Makefile.am	Wed Sep 15 11:50:50 2004 +0000
     1.3 @@ -1,8 +1,6 @@
     1.4  AM_CPPFLAGS = -I$(top_srcdir)/src
     1.5  
     1.6 -#dist_noinst_DATA = preflow_graph
     1.7 -EXTRA_DIST = preflow_graph.inp
     1.8 -CLEANFILES = preflow_graph.out
     1.9 +EXTRA_DIST = preflow_graph.inp #input file for preflow_test.cc
    1.10  
    1.11  noinst_HEADERS = test_tools.h graph_test.h
    1.12  
    1.13 @@ -23,10 +21,6 @@
    1.14  	unionfind_test \
    1.15  	xy_test
    1.16  
    1.17 -SUFFIXES = .inp .out
    1.18 -.inp.out:
    1.19 -	-cp $< $@
    1.20 -
    1.21  TESTS = $(check_PROGRAMS)
    1.22  XFAIL_TESTS = test_tools_fail
    1.23  
    1.24 @@ -40,7 +34,6 @@
    1.25  minlengthpaths_test_SOURCES = minlengthpaths_test.cc
    1.26  path_test_SOURCES = path_test.cc
    1.27  preflow_test_SOURCES = preflow_test.cc
    1.28 -preflow_test_DEPENDENCIES = preflow_graph.out
    1.29  time_measure_test_SOURCES = time_measure_test.cc
    1.30  test_tools_fail_SOURCES = test_tools_fail.cc
    1.31  test_tools_pass_SOURCES = test_tools_pass.cc
     2.1 --- a/src/test/preflow_test.cc	Wed Sep 15 10:34:12 2004 +0000
     2.2 +++ b/src/test/preflow_test.cc	Wed Sep 15 11:50:50 2004 +0000
     2.3 @@ -5,6 +5,9 @@
     2.4  #include <hugo/preflow.h>
     2.5  #include <hugo/skeletons/graph.h>
     2.6  #include <hugo/skeletons/maps.h>
     2.7 +
     2.8 +#include <string.h>
     2.9 +
    2.10  using namespace hugo;
    2.11  
    2.12  void check_Preflow() 
    2.13 @@ -66,7 +69,17 @@
    2.14  
    2.15    typedef Preflow<Graph, int> PType;
    2.16  
    2.17 -  std::ifstream file("preflow_graph.out");
    2.18 +  char *f_name;
    2.19 +  
    2.20 +  f_name=new char[strlen(getenv("srcdir"))+50];
    2.21 +  strcpy(f_name,getenv("srcdir"));
    2.22 +  strcat(f_name,"/preflow_graph.inp");
    2.23 +  
    2.24 +  std::ifstream file(f_name);
    2.25 +  
    2.26 +  check(file,"Input file '" << f_name << "' not found.");
    2.27 +  
    2.28 +  delete [] f_name;
    2.29    
    2.30    Graph G;
    2.31    Node s, t;