]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/graph/test/adj_list_test.cpp
1 //=======================================================================
2 // Copyright 2002 Indiana University.
3 // Authors: Andrew Lumsdaine, Lie-Quan Lee, Jeremy G. Siek
5 // Distributed under the Boost Software License, Version 1.0. (See
6 // accompanying file LICENSE_1_0.txt or copy at
7 // http://www.boost.org/LICENSE_1_0.txt)
8 //=======================================================================
15 // This is meant to be executed from the current directory
17 std::string container_types
[] = { "vecS", "listS", "setS" };
18 const int N
= sizeof(container_types
)/sizeof(std::string
);
20 std::string directed_types
[] = { "bidirectionalS", "directedS", "undirectedS"};
21 const int D
= sizeof(directed_types
)/sizeof(std::string
);
26 int i
, j
, k
, ret
= 0, rc
, t
= 0;
27 for (i
= 0; i
< N
; ++i
)
28 for (j
= 0; j
< N
; ++j
)
29 for (k
= 0; k
< D
; ++k
, ++t
) {
31 std::string file_name
= "graph_type.hpp";
32 system("rm -f graph_type.hpp");
33 std::ofstream
header(file_name
.c_str());
35 std::cerr
<< "could not open file " << file_name
<< std::endl
;
39 header
<< "#include <boost/graph/adjacency_list.hpp>" << std::endl
40 << "typedef boost::adjacency_list<boost::" << container_types
[i
]
41 << ", boost::" << container_types
[j
]
42 << ", boost::" << directed_types
[k
]
43 << ", boost::property<vertex_id_t, std::size_t>"
44 << ", boost::property<edge_id_t, std::size_t> > Graph;"
46 << "typedef boost::property<vertex_id_t, std::size_t> VertexId;"
48 << "typedef boost::property<edge_id_t, std::size_t> EdgeID;"
50 system("rm -f graph.exe graph.o graph.obj");
51 // the following system call should be replaced by a
52 // portable "compile" command.
53 //const char* compile = "g++ -I.. -O2 -Wall -Wno-long-long -ftemplate-depth-30 ../libs/graph/test/graph.cpp -o graph.exe";
54 const char* compile
= "g++ -I/u/jsiek/boost graph.cpp -o graph.exe";
55 std::cout
<< compile
<< std::endl
;
58 std::cerr
<< "compile failed for " << container_types
[i
] << " "
59 << container_types
[j
] << " " << directed_types
[k
]
63 rc
= system("./graph.exe");
65 std::cerr
<< "run failed for " << container_types
[i
] << " "
66 << container_types
[j
] << " " << directed_types
[k
]
70 std::cout
<< (t
+1) << " of " << (N
*N
*D
) << " tests passed."