From be7434e584a8aa0507907c5d0456f192fe4153f2 Mon Sep 17 00:00:00 2001 From: Joris van Rantwijk Date: Sat, 5 Apr 2025 11:44:21 +0200 Subject: [PATCH] Specify path of weighted_matching.dat via Jamfile --- test/Jamfile.v2 | 4 +++- test/weighted_matching_test.cpp | 7 +++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index b2e29dd0..ae1858b2 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -19,6 +19,8 @@ path-constant CYCLE_RATIO_INPUT_FILE : ./cycle_ratio_s382.90.dot ; path-constant METIS_INPUT_FILE : ./weighted_graph.gr ; +path-constant WEIGHTED_MATCHING_INPUT_FILE : ./weighted_matching.dat ; + alias graph_test_regular : # test_graphs will eventually defined a framework for testing the structure # and implementation of graph data structures and adaptors. @@ -113,7 +115,7 @@ alias graph_test_regular : [ run cuthill_mckee_ordering.cpp ] [ run king_ordering.cpp ] [ run matching_test.cpp ] - [ run weighted_matching_test.cpp ] + [ run weighted_matching_test.cpp : $(WEIGHTED_MATCHING_INPUT_FILE) ] [ run weighted_matching_test2.cpp ] [ run max_flow_test.cpp ] [ run boykov_kolmogorov_max_flow_test.cpp ] diff --git a/test/weighted_matching_test.cpp b/test/weighted_matching_test.cpp index 30042c55..57b1f804 100644 --- a/test/weighted_matching_test.cpp +++ b/test/weighted_matching_test.cpp @@ -136,9 +136,12 @@ Graph make_graph(typename graph_traits< Graph >::vertices_size_type num_v, return g; } -int main(int, char*[]) +int main(int argc, char* argv[]) { - std::ifstream in_file("weighted_matching.dat"); + const char* filename = "weighted_matching.dat"; + if (argc > 1) + filename = argv[1]; + std::ifstream in_file(filename); BOOST_TEST(in_file.good()); std::string line; while (std::getline(in_file, line))