# HG changeset patch # User alpar # Date 1095249050 0 # Node ID 8c44b64dd436cfb933b325753ce52c0c5f306826 # Parent baf0b6e40211bc8e585790e22cc28e577f6eb5f8 Better handling of the input files of the tests. diff -r baf0b6e40211 -r 8c44b64dd436 src/test/Makefile.am --- a/src/test/Makefile.am Wed Sep 15 10:34:12 2004 +0000 +++ b/src/test/Makefile.am Wed Sep 15 11:50:50 2004 +0000 @@ -1,8 +1,6 @@ AM_CPPFLAGS = -I$(top_srcdir)/src -#dist_noinst_DATA = preflow_graph -EXTRA_DIST = preflow_graph.inp -CLEANFILES = preflow_graph.out +EXTRA_DIST = preflow_graph.inp #input file for preflow_test.cc noinst_HEADERS = test_tools.h graph_test.h @@ -23,10 +21,6 @@ unionfind_test \ xy_test -SUFFIXES = .inp .out -.inp.out: - -cp $< $@ - TESTS = $(check_PROGRAMS) XFAIL_TESTS = test_tools_fail @@ -40,7 +34,6 @@ minlengthpaths_test_SOURCES = minlengthpaths_test.cc path_test_SOURCES = path_test.cc preflow_test_SOURCES = preflow_test.cc -preflow_test_DEPENDENCIES = preflow_graph.out time_measure_test_SOURCES = time_measure_test.cc test_tools_fail_SOURCES = test_tools_fail.cc test_tools_pass_SOURCES = test_tools_pass.cc diff -r baf0b6e40211 -r 8c44b64dd436 src/test/preflow_test.cc --- a/src/test/preflow_test.cc Wed Sep 15 10:34:12 2004 +0000 +++ b/src/test/preflow_test.cc Wed Sep 15 11:50:50 2004 +0000 @@ -5,6 +5,9 @@ #include #include #include + +#include + using namespace hugo; void check_Preflow() @@ -66,7 +69,17 @@ typedef Preflow PType; - std::ifstream file("preflow_graph.out"); + char *f_name; + + f_name=new char[strlen(getenv("srcdir"))+50]; + strcpy(f_name,getenv("srcdir")); + strcat(f_name,"/preflow_graph.inp"); + + std::ifstream file(f_name); + + check(file,"Input file '" << f_name << "' not found."); + + delete [] f_name; Graph G; Node s, t;