Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add a graphicator test and use get_network_element_type against try-catch
authornavarrop <navarrop@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Mon, 14 Mar 2011 13:54:21 +0000 (13:54 +0000)
committernavarrop <navarrop@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Mon, 14 Mar 2011 13:54:21 +0000 (13:54 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@9784 48e7efb5-ca39-0410-a469-dd3cf9ba447f

buildtools/Cmake/AddTests.cmake
tools/graphicator/graphicator.c
tools/graphicator/graphicator.tesh [new file with mode: 0644]

index 1f854de..bcd3c4a 100644 (file)
@@ -370,6 +370,9 @@ set_tests_properties(lua-masterslave-bypass                 PROPERTIES ENVIRONMENT "LUA_CPATH
 set_tests_properties(lua-msg-masterslave-console       PROPERTIES ENVIRONMENT "LUA_CPATH=${CMAKE_BINARY_DIR}/examples/lua/?.so")
 endif(HAVE_LUA)
 
+add_test(graphicator ${CMAKE_BINARY_DIR}/bin/tesh --setenv srcdir=${CMAKE_HOME_DIRECTORY} --setenv bindir=${CMAKE_BINARY_DIR}/bin --cd ${CMAKE_HOME_DIRECTORY}/tools/graphicator graphicator.tesh)
+
+
 # END TESH TESTS
 
 if(enable_smpi)
index c93965f..638073a 100644 (file)
@@ -125,7 +125,8 @@ int main(int argc, char **argv)
 
       xbt_node_t src_node = xbt_graph_search_node (graph, src, strcmp);
       xbt_node_t dst_node = xbt_graph_search_node (graph, dst, strcmp);
-      TRY {
+      if(get_network_element_type(src) != SURF_NETWORK_ELEMENT_AS &&
+                 get_network_element_type(dst) != SURF_NETWORK_ELEMENT_AS ){
         xbt_dynar_t route = global_routing->get_route(src,dst);
         xbt_node_t previous = src_node;
         for(i=0;i<xbt_dynar_length(route) ;i++)
@@ -143,14 +144,15 @@ int main(int argc, char **argv)
             xbt_graph_new_edge (graph, previous, link_node, NULL);
           }
           previous = link_node;
+          free(link_name);
         }
         xbt_edge_t edge = xbt_graph_search_edge (graph, previous, dst_node);
         if (!edge){
           XBT_DEBUG("\%s %s", (char*)xbt_graph_node_get_data(previous), (char*)xbt_graph_node_get_data(dst_node));
           xbt_graph_new_edge (graph, previous, dst_node, NULL);
         }
-      } CATCH(e) {}
     }
+   }
   }
   xbt_graph_export_graphviz (graph, graphvizFile, node_name, edge_name);
   xbt_graph_free_graph (graph, NULL, NULL, NULL);
diff --git a/tools/graphicator/graphicator.tesh b/tools/graphicator/graphicator.tesh
new file mode 100644 (file)
index 0000000..0e70163
--- /dev/null
@@ -0,0 +1,6 @@
+#! ./tesh
+
+$ ${bindir:=.}/graphicator ${srcdir:=.}/teshsuite/simdag/platforms/one_cluster.xml test.dot
+> [0.000000] [surf_workstation/INFO] surf_workstation_model_init_ptask_L07
+
+$ rm test.dot