Fix up paths to .dot files so they can be used in the tests.

This commit is contained in:
jzmaddock 2018-12-17 18:57:50 +00:00
parent 0048ae1b7e
commit cec1b39f43
23 changed files with 93 additions and 81 deletions

View File

@ -4,8 +4,12 @@
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
import ../../config/checks/config : requires ;
import modules ;
import path ;
run accum-compile-times.cpp ;
path-constant TEST_DIR : . ;
run accum-compile-times.cpp : $(TEST_DIR)/makefile-dependencies.dat $(TEST_DIR)/makefile-target-names.dat $(TEST_DIR)/target-compile-costs.dat ;
exe actor_clustering : actor_clustering.cpp ;
run adj_list_ra_edgelist.cpp ;
run adjacency_list.cpp ;
@ -21,7 +25,7 @@ run bfs-example2.cpp ;
run bfs-name-printer.cpp ;
run biconnected_components.cpp ;
run bipartite_example.cpp ;
run boost_web_graph.cpp ;
run boost_web_graph.cpp : $(TEST_DIR)/boost_web.dat ;
exe boykov_kolmogorov-eg : boykov_kolmogorov-eg.cpp ;
exe bron_kerbosch_clique_number : bron_kerbosch_clique_number.cpp ;
exe bron_kerbosch_print_cliques : bron_kerbosch_print_cliques.cpp ;
@ -37,12 +41,12 @@ run copy-example.cpp ;
run cuthill_mckee_ordering.cpp ;
run cycle_canceling_example.cpp ;
run cycle_ratio_example.cpp ;
run cycle-file-dep.cpp ;
run cycle-file-dep2.cpp ;
run cycle-file-dep.cpp : $(TEST_DIR)/makefile-dependencies.dat $(TEST_DIR)/makefile-target-names.dat ;
run cycle-file-dep2.cpp : $(TEST_DIR)/makefile-dependencies.dat $(TEST_DIR)/makefile-target-names.dat ;
run dag_shortest_paths.cpp ;
run dave.cpp ;
run default-constructor.cpp ;
run default-constructor2.cpp ;
run default-constructor.cpp : $(TEST_DIR)/makefile-dependencies.dat ;
run default-constructor2.cpp : $(TEST_DIR)/makefile-dependencies.dat ;
exe degree_centrality : degree_centrality.cpp ;
run dfs.cpp ;
run dfs_parenthesis.cpp ;
@ -54,10 +58,10 @@ run directed_graph.cpp ;
exe eccentricity : eccentricity.cpp ;
run edge_basics.cpp ;
run edge_coloring.cpp ;
run edge_iterator_constructor.cpp ;
run edge_iterator_constructor.cpp : $(TEST_DIR)/edge_iterator_constructor.dat ;
run edge_property.cpp ;
run edge-function.cpp ;
run edge-iter-constructor.cpp ;
run edge-function.cpp : $(TEST_DIR)/makefile-dependencies.dat $(TEST_DIR)/makefile-target-names.dat ;
run edge-iter-constructor.cpp : $(TEST_DIR)/makefile-dependencies.dat ;
exe edmonds-karp-eg : edmonds-karp-eg.cpp ;
run exterior_properties.cpp ;
run exterior_property_map.cpp ;
@ -92,12 +96,12 @@ run isomorphism.cpp ;
run iteration_macros.cpp ;
run iterator-property-map-eg.cpp ;
run johnson-eg.cpp ;
run kevin-bacon.cpp ;
run kevin-bacon.cpp : $(TEST_DIR)/kevin-bacon.dat ;
run king_ordering.cpp ;
run knights_tour.cpp ;
run kruskal-example.cpp ;
run kuratowski_subgraph.cpp ;
run last-mod-time.cpp ;
run last-mod-time.cpp : $(TEST_DIR)/makefile-dependencies.dat ;
run make_biconnected_planar.cpp ;
run make_connected.cpp ;
run make_maximal_planar.cpp ;
@ -108,14 +112,14 @@ exe mean_geodesic : mean_geodesic.cpp ;
exe minimum_degree_ordering : minimum_degree_ordering.cpp ;
run modify_graph.cpp ;
run neighbor_bfs.cpp ;
run ospf-example.cpp ../build//boost_graph ;
run parallel-compile-time.cpp ;
run ospf-example.cpp ../build//boost_graph : $(TEST_DIR)/figs/ospf-graph.dot $(TEST_DIR)/figs/ospf-sptree.dot $(TEST_DIR)/routing-table.dat ;
run parallel-compile-time.cpp : $(TEST_DIR)/makefile-dependencies.dat $(TEST_DIR)/makefile-target-names.dat $(TEST_DIR)/target-compile-costs.dat ;
run planar_face_traversal.cpp ;
run prim-example.cpp ;
run print-adjacent-vertices.cpp ;
run print-edges.cpp ;
run print-in-edges.cpp ;
run print-out-edges.cpp ;
run print-adjacent-vertices.cpp : $(TEST_DIR)/makefile-dependencies.dat $(TEST_DIR)/makefile-target-names.dat ;
run print-edges.cpp : $(TEST_DIR)/makefile-dependencies.dat $(TEST_DIR)/makefile-target-names.dat ;
run print-in-edges.cpp : $(TEST_DIR)/makefile-dependencies.dat $(TEST_DIR)/makefile-target-names.dat ;
run print-out-edges.cpp : $(TEST_DIR)/makefile-dependencies.dat $(TEST_DIR)/makefile-target-names.dat ;
exe property_iterator : property_iterator.cpp ;
run property-map-traits-eg.cpp ;
exe push-relable : push-relabel-eg.cpp ;
@ -143,8 +147,8 @@ exe tiernan_print_cycles : tiernan_print_cycles.cpp ;
run topo_sort.cpp ;
run topo-sort1.cpp ;
run topo-sort2.cpp ;
run topo-sort-file-dep.cpp ;
run topo-sort-file-dep2.cpp ;
run topo-sort-file-dep.cpp : $(TEST_DIR)/makefile-dependencies.dat $(TEST_DIR)/makefile-target-names.dat ;
run topo-sort-file-dep2.cpp : $(TEST_DIR)/makefile-dependencies.dat $(TEST_DIR)/makefile-target-names.dat ;
run transitive_closure.cpp ;
run transpose-example.cpp ;
run two_graphs_common_spanning_trees.cpp ;
@ -153,7 +157,7 @@ run undirected_dfs.cpp ;
run undirected_graph.cpp ;
run vector_as_graph.cpp ;
run vertex_basics.cpp ;
run vertex-name-property.cpp ;
run vertex-name-property.cpp : $(TEST_DIR)/makefile-dependencies.dat $(TEST_DIR)/makefile-target-names.dat ;
run vf2_sub_graph_iso_example.cpp ;
run vf2_sub_graph_iso_multi_example.cpp ;
run visitor.cpp ;
@ -212,7 +216,7 @@ explicit girth ;
# This one crashes at runtime:
#
# run astar_maze.cpp ;
# run kevin-bacon2.cpp /boost/serialization//boost_serialization ;
# run kevin-bacon2.cpp /boost/serialization//boost_serialization : $(TEST_DIR)/kevin-bacon.dat ;
#
# This one dereferences a null-iterator:
#

View File

@ -48,9 +48,9 @@ typedef graph_traits<file_dep_graph2>::vertex_descriptor vertex_t;
typedef graph_traits<file_dep_graph2>::edge_descriptor edge_t;
int
main()
main(int argc, const char** argv)
{
std::ifstream file_in("makefile-dependencies.dat");
std::ifstream file_in(argc >= 2 ? argv[1] : "makefile-dependencies.dat");
typedef graph_traits<file_dep_graph2>::vertices_size_type size_type;
size_type n_vertices;
file_in >> n_vertices; // read in number of vertices
@ -76,8 +76,8 @@ main()
name_map_t name_map = get(vertex_name, g);
compile_cost_map_t compile_cost_map = get(vertex_compile_cost, g);
std::ifstream name_in("makefile-target-names.dat");
std::ifstream compile_cost_in("target-compile-costs.dat");
std::ifstream name_in(argc >= 3 ? argv[2] : "makefile-target-names.dat");
std::ifstream compile_cost_in(argc >= 4 ? argv[3] : "target-compile-costs.dat");
graph_traits < file_dep_graph2 >::vertex_iterator vi, vi_end;
for (boost::tie(vi, vi_end) = vertices(g); vi != vi_end; ++vi) {
name_in >> name_map[*vi];

View File

@ -70,11 +70,11 @@ private:
};
int
main()
main(int argc, const char** argv)
{
using namespace boost;
std::ifstream datafile("./boost_web.dat");
std::ifstream datafile(argc >= 2 ? argv[1] : "./boost_web.dat");
if (!datafile) {
std::cerr << "No ./boost_web.dat file" << std::endl;
return -1;

View File

@ -62,9 +62,9 @@ has_cycle(const file_dep_graph & g)
int
main()
main(int argc, const char** argv)
{
std::ifstream file_in("makefile-dependencies.dat");
std::ifstream file_in(argc >= 2 ? argv[1] : "makefile-dependencies.dat");
typedef graph_traits < file_dep_graph >::vertices_size_type size_type;
size_type n_vertices;
file_in >> n_vertices; // read in number of vertices
@ -83,7 +83,7 @@ main()
#endif
std::vector < std::string > name(num_vertices(g));
std::ifstream name_in("makefile-target-names.dat");
std::ifstream name_in(argc >= 3 ? argv[2] : "makefile-target-names.dat");
graph_traits < file_dep_graph >::vertex_iterator vi, vi_end;
for (boost::tie(vi, vi_end) = vertices(g); vi != vi_end; ++vi)
name_in >> name[*vi];

View File

@ -119,9 +119,9 @@ has_cycle(const file_dep_graph & g)
int
main()
main(int argc, const char** argv)
{
std::ifstream file_in("makefile-dependencies.dat");
std::ifstream file_in(argc >= 2 ? argv[1] : "makefile-dependencies.dat");
typedef graph_traits <file_dep_graph >::vertices_size_type size_type;
size_type n_vertices;
file_in >> n_vertices; // read in number of vertices
@ -140,7 +140,7 @@ main()
#endif
std::vector < std::string > name(num_vertices(g));
std::ifstream name_in("makefile-target-names.dat");
std::ifstream name_in(argc >= 3 ? argv[2] : "makefile-target-names.dat");
graph_traits < file_dep_graph >::vertex_iterator vi, vi_end;
for (boost::tie(vi, vi_end) = vertices(g); vi != vi_end; ++vi)
name_in >> name[*vi];

View File

@ -29,7 +29,7 @@ read_graph_file(std::istream & in, Graph & g)
int
main()
main(int argc, const char** argv)
{
typedef adjacency_list < listS, // Store out-edges of each vertex in a std::list
vecS, // Store vertex set in a std::vector
@ -37,7 +37,7 @@ main()
> graph_type;
graph_type g; // use default constructor to create empty graph
std::ifstream file_in("makefile-dependencies.dat");
std::ifstream file_in(argc >= 2 ? argv[1] : "makefile-dependencies.dat");
read_graph_file(file_in, g);
assert(num_vertices(g) == 15);

View File

@ -32,7 +32,7 @@ read_graph_file(std::istream & in, Graph & g)
int
main()
main(int argc, const char** argv)
{
typedef adjacency_list < listS, // Store out-edges of each vertex in a std::list
vecS, // Store vertex set in a std::vector
@ -40,7 +40,7 @@ main()
> graph_type;
graph_type g; // use default constructor to create empty graph
std::ifstream file_in("makefile-dependencies.dat");
std::ifstream file_in(argc >= 2 ? argv[1] : "makefile-dependencies.dat");
read_graph_file(file_in, g);
assert(num_vertices(g) == 15);

View File

@ -73,7 +73,7 @@ name_equals(const std::string & str, NameMap name)
int
main()
main(int argc, const char** argv)
{
typedef adjacency_list<listS,// Store out-edges of each vertex in a std::list
vecS, // Store vertex set in a std::vector
@ -82,8 +82,8 @@ main()
>graph_type;
graph_type g; // use default constructor to create empty graph
const char* dep_file_name = "makefile-dependencies.dat";
const char* target_file_name = "makefile-target-names.dat";
const char* dep_file_name = argc >= 2 ? argv[1] : "makefile-dependencies.dat";
const char* target_file_name = argc >= 3 ? argv[2] : "makefile-target-names.dat";
std::ifstream file_in(dep_file_name), name_in(target_file_name);
if (!file_in) {

View File

@ -20,7 +20,7 @@ template < typename T >
int
main()
main(int argc, const char** argv)
{
typedef adjacency_list <
listS, // Store out-edges of each vertex in a std::list
@ -28,7 +28,7 @@ main()
directedS // The graph is directed
> graph_type;
std::ifstream file_in("makefile-dependencies.dat");
std::ifstream file_in(argc >= 2 ? argv[1] : "makefile-dependencies.dat");
typedef graph_traits < graph_type >::vertices_size_type size_type;
size_type n_vertices;
file_in >> n_vertices; // read in number of vertices

View File

@ -91,14 +91,14 @@ bool operator!=(const edge_stream_iterator& x,
int
main()
main(int argc, const char** argv)
{
typedef boost::adjacency_list<> IteratorConstructibleGraph;
typedef boost::graph_traits<IteratorConstructibleGraph> Traits;
Traits::vertices_size_type size_V;
Traits::edges_size_type size_E;
std::ifstream f("edge_iterator_constructor.dat");
std::ifstream f(argc >= 2 ? argv[1] : "edge_iterator_constructor.dat");
f >> size_V >> size_E;
edge_stream_iterator edge_iter(f), end;

View File

@ -45,9 +45,9 @@ record_bacon_number(DistanceMap d)
int
main()
main(int argc, const char** argv)
{
std::ifstream datafile("./kevin-bacon.dat");
std::ifstream datafile(argc >= 2 ? argv[1] : "./kevin-bacon.dat");
if (!datafile) {
std::cerr << "No ./kevin-bacon.dat file" << std::endl;
return EXIT_FAILURE;

View File

@ -56,9 +56,9 @@ private:
int* d;
};
int main()
int main(int argc, const char** argv)
{
std::ifstream ifs("./kevin-bacon2.dat");
std::ifstream ifs(argc >= 2 ? argv[1] : "./kevin-bacon2.dat");
if (!ifs) {
std::cerr << "No ./kevin-bacon2.dat file" << std::endl;
return EXIT_FAILURE;

View File

@ -48,7 +48,7 @@ read_graph_file(std::istream & graph_in, std::istream & name_in,
int
main()
main(int argc, const char** argv)
{
typedef adjacency_list < listS, // Store out-edges of each vertex in a std::list
vecS, // Store vertex set in a std::vector
@ -57,8 +57,8 @@ main()
>graph_type;
graph_type g; // use default constructor to create empty graph
std::ifstream file_in("makefile-dependencies.dat"),
name_in("makefile-target-names.dat");
std::ifstream file_in(argc >= 2 ? argv[1] : "makefile-dependencies.dat"),
name_in(argc >= 2 ? argv[1] : "makefile-target-names.dat");
if (!file_in) {
std::cerr << "** Error: could not open file makefile-target-names.dat"
<< std::endl;

View File

@ -16,7 +16,7 @@ namespace boost {
}
int
main()
main(int argc, const char** argv)
{
using namespace boost;
typedef
@ -34,7 +34,7 @@ main()
dp.property("color", get(edge_color, g_dot));
dp.property("color", ref_property_map<g_dot_type*, std::string>(get_property(g_dot, graph_color)));
{
std::ifstream infile("figs/ospf-graph.dot");
std::ifstream infile(argc >= 2 ? argv[1] : "figs/ospf-graph.dot");
read_graphviz(infile, g_dot, dp);
}
@ -84,11 +84,11 @@ main()
get_property(g_dot, graph_color) = "grey";
{
std::ofstream outfile("figs/ospf-sptree.dot");
std::ofstream outfile(argc >= 3 ? argv[2] : "figs/ospf-sptree.dot");
write_graphviz_dp(outfile, g_dot, dp);
}
std::ofstream rtable("routing-table.dat");
std::ofstream rtable(argc >= 4 ? argv[3] : "routing-table.dat");
rtable << "Dest Next Hop Total Cost" << std::endl;
for (boost::tie(vi, vi_end) = vertices(g_dot); vi != vi_end; ++vi)
if (parent[*vi] != *vi) {

View File

@ -117,9 +117,9 @@ typedef property_map < file_dep_graph2, vertex_color_t >::type color_map_t;
int
main()
main(int argc, const char** argv)
{
std::ifstream file_in("makefile-dependencies.dat");
std::ifstream file_in(argc >= 2 ? argv[1] : "makefile-dependencies.dat");
typedef graph_traits < file_dep_graph2 >::vertices_size_type size_type;
size_type n_vertices;
file_in >> n_vertices; // read in number of vertices
@ -155,8 +155,8 @@ main()
get(vertex_color, g);
{
std::ifstream name_in("makefile-target-names.dat");
std::ifstream compile_cost_in("target-compile-costs.dat");
std::ifstream name_in(argc >= 3 ? argv[2] : "makefile-target-names.dat");
std::ifstream compile_cost_in(argc >= 4 ? argv[3] : "target-compile-costs.dat");
graph_traits < file_dep_graph2 >::vertex_iterator vi, vi_end;
for (boost::tie(vi, vi_end) = vertices(g); vi != vi_end; ++vi) {
name_in >> name_map[*vi];

View File

@ -73,7 +73,7 @@ name_equals(const std::string & str, NameMap name)
int
main()
main(int argc, const char** argv)
{
typedef adjacency_list < listS, // Store out-edges of each vertex in a std::list
vecS, // Store vertex set in a std::vector
@ -82,8 +82,8 @@ main()
>graph_type;
graph_type g; // use default constructor to create empty graph
const char* dep_file_name = "makefile-dependencies.dat";
const char* target_file_name = "makefile-target-names.dat";
const char* dep_file_name = argc >= 2 ? argv[1] : "makefile-dependencies.dat";
const char* target_file_name = argc >= 3 ? argv[2] : "makefile-target-names.dat";
std::ifstream file_in(dep_file_name), name_in(target_file_name);
if (!file_in) {
std::cerr << "** Error: could not open file " << dep_file_name

View File

@ -48,7 +48,7 @@ print_dependencies(std::ostream & out, const Graph & g,
int
main()
main(int argc, const char** argv)
{
typedef adjacency_list < listS, // Store out-edges of each vertex in a std::list
vecS, // Store vertex set in a std::vector
@ -57,8 +57,8 @@ main()
>graph_type;
graph_type g; // use default constructor to create empty graph
const char* dep_file_name = "makefile-dependencies.dat";
const char* target_file_name = "makefile-target-names.dat";
const char* dep_file_name = argc >= 2 ? argv[1] : "makefile-dependencies.dat";
const char* target_file_name = argc >= 3 ? argv[2] : "makefile-target-names.dat";
std::ifstream file_in(dep_file_name), name_in(target_file_name);
if (!file_in) {
std::cerr << "** Error: could not open file " << dep_file_name

View File

@ -72,7 +72,7 @@ name_equals(const std::string & str, NameMap name)
int
main()
main(int argc, const char** argv)
{
typedef adjacency_list < listS, // Store out-edges of each vertex in a std::list
vecS, // Store vertex set in a std::vector
@ -81,8 +81,8 @@ main()
>graph_type;
graph_type g; // use default constructor to create empty graph
const char* dep_file_name = "makefile-dependencies.dat";
const char* target_file_name = "makefile-target-names.dat";
const char* dep_file_name = argc >= 2 ? argv[1] : "makefile-dependencies.dat";
const char* target_file_name = argc >= 3 ? argv[2] : "makefile-target-names.dat";
std::ifstream file_in(dep_file_name), name_in(target_file_name);
if (!file_in) {
std::cerr << "** Error: could not open file " << dep_file_name

View File

@ -72,7 +72,7 @@ name_equals(const std::string & str, NameMap name)
int
main()
main(int argc, const char** argv)
{
typedef adjacency_list < listS, // Store out-edges of each vertex in a std::list
vecS, // Store vertex set in a std::vector
@ -81,8 +81,8 @@ main()
>graph_type;
graph_type g; // use default constructor to create empty graph
const char* dep_file_name = "makefile-dependencies.dat";
const char* target_file_name = "makefile-target-names.dat";
const char* dep_file_name = argc >= 2 ? argv[1] : "makefile-dependencies.dat";
const char* target_file_name = argc >= 3 ? argv[2] : "makefile-target-names.dat";
std::ifstream file_in(dep_file_name), name_in(target_file_name);
if (!file_in) {
std::cerr << "** Error: could not open file " << dep_file_name

View File

@ -57,9 +57,9 @@ topo_sort(const file_dep_graph & g, vertex_t * topo_order)
int
main()
main(int argc, const char** argv)
{
std::ifstream file_in("makefile-dependencies.dat");
std::ifstream file_in(argc >= 2 ? argv[1] : "makefile-dependencies.dat");
typedef graph_traits < file_dep_graph >::vertices_size_type size_type;
size_type n_vertices;
file_in >> n_vertices; // read in number of vertices
@ -78,7 +78,7 @@ main()
#endif
std::vector < std::string > name(num_vertices(g));
std::ifstream name_in("makefile-target-names.dat");
std::ifstream name_in(argc >= 3 ? argv[2] : "makefile-target-names.dat");
graph_traits < file_dep_graph >::vertex_iterator vi, vi_end;
for (boost::tie(vi, vi_end) = vertices(g); vi != vi_end; ++vi)
name_in >> name[*vi];

View File

@ -116,9 +116,9 @@ topo_sort(const file_dep_graph & g, vertex_t * topo_order)
int
main()
main(int argc, const char** argv)
{
std::ifstream file_in("makefile-dependencies.dat");
std::ifstream file_in(argc >= 2 ? argv[1] : "makefile-dependencies.dat");
typedef graph_traits<file_dep_graph>::vertices_size_type size_type;
size_type n_vertices;
file_in >> n_vertices; // read in number of vertices
@ -138,7 +138,7 @@ main()
#endif
std::vector < std::string > name(num_vertices(g));
std::ifstream name_in("makefile-target-names.dat");
std::ifstream name_in(argc >= 2 ? argv[1] : "makefile-target-names.dat");
graph_traits < file_dep_graph >::vertex_iterator vi, vi_end;
for (boost::tie(vi, vi_end) = vertices(g); vi != vi_end; ++vi)
name_in >> name[*vi];

View File

@ -38,7 +38,7 @@ read_graph_file(std::istream & graph_in, std::istream & name_in,
int
main()
main(int argc, const char** argv)
{
typedef adjacency_list < listS, // Store out-edges of each vertex in a std::list
vecS, // Store vertex set in a std::vector
@ -47,8 +47,8 @@ main()
>graph_type;
graph_type g; // use default constructor to create empty graph
const char* dep_file_name = "makefile-dependencies.dat";
const char* target_file_name = "makefile-target-names.dat";
const char* dep_file_name = argc >= 2 ? argv[1] : "makefile-dependencies.dat";
const char* target_file_name = argc >= 3 ? argv[2] : "makefile-target-names.dat";
std::ifstream file_in(dep_file_name), name_in(target_file_name);
if (!file_in) {
std::cerr << "** Error: could not open file " << dep_file_name

View File

@ -93,7 +93,15 @@ test-suite graph_test :
[ compile vector_graph_cc.cpp ]
[ compile copy.cpp ]
[ compile swap.cpp ]
[ compile property_iter.cpp ]
[ compile property_iter.cpp : <define>TEST=1 : property_iter_1 ]
[ compile property_iter.cpp : <define>TEST=2 : property_iter_2 ]
[ compile property_iter.cpp : <define>TEST=3 : property_iter_3 ]
[ compile property_iter.cpp : <define>TEST=4 : property_iter_4 ]
[ compile property_iter.cpp : <define>TEST=5 : property_iter_5 ]
[ compile property_iter.cpp : <define>TEST=6 : property_iter_6 ]
[ compile property_iter.cpp : <define>TEST=7 : property_iter_7 ]
[ compile property_iter.cpp : <define>TEST=8 : property_iter_8 ]
[ compile property_iter.cpp : <define>TEST=9 : property_iter_9 ]
[ run bundled_properties.cpp ]
[ run floyd_warshall_test.cpp ]
[ run astar_search_test.cpp ]