[opengtl-commits] [192] add a tool to run test of the shiva language

[ Thread Index | Date Index | More lists.tuxfamily.org/opengtl-commits Archives ]


Revision: 192
Author:   cyrille
Date:     2008-06-14 11:07:23 +0200 (Sat, 14 Jun 2008)

Log Message:
-----------
add a tool to run test of the shiva language

Modified Paths:
--------------
    trunk/OpenGTL/OpenShiva/tools/CMakeLists.txt
    trunk/OpenGTL/OpenShiva/tools/interpreter/Shiva.cpp
    trunk/OpenGTL/OpenShiva/tools/tester/CMakeLists.txt
    trunk/OpenGTL/OpenShiva/tools/tester/Shiva.cpp

Added Paths:
-----------
    trunk/OpenGTL/OpenShiva/tools/tester/


Modified: trunk/OpenGTL/OpenShiva/tools/CMakeLists.txt
===================================================================
--- trunk/OpenGTL/OpenShiva/tools/CMakeLists.txt	2008-06-14 09:06:21 UTC (rev 191)
+++ trunk/OpenGTL/OpenShiva/tools/CMakeLists.txt	2008-06-14 09:07:23 UTC (rev 192)
@@ -1,2 +1,3 @@
 add_subdirectory(compiler)
 add_subdirectory(interpreter)
+add_subdirectory(tester)

Modified: trunk/OpenGTL/OpenShiva/tools/interpreter/Shiva.cpp
===================================================================
--- trunk/OpenGTL/OpenShiva/tools/interpreter/Shiva.cpp	2008-06-14 09:06:21 UTC (rev 191)
+++ trunk/OpenGTL/OpenShiva/tools/interpreter/Shiva.cpp	2008-06-14 09:07:23 UTC (rev 192)
@@ -49,7 +49,6 @@
 {
   GTLCore::String fileName = "";
   GTLCore::String output = "";
-  bool showAssembly = false;
   for(int ai = 1; ai < argc; ai++)
   {
     if(ARG_IS("-h","--help"))
@@ -107,10 +106,6 @@
       std::cout << "Error: " << std::endl << p.compilationErrorsMessage() << std::endl;
       return EXIT_FAILURE;
     }
-    if( showAssembly )
-    {
-      std::cout << p.asmSourceCode();
-    }
   }
   return EXIT_SUCCESS;
 }

Copied: trunk/OpenGTL/OpenShiva/tools/tester (from rev 183, trunk/OpenGTL/OpenShiva/tools/interpreter)

Modified: trunk/OpenGTL/OpenShiva/tools/tester/CMakeLists.txt
===================================================================
--- trunk/OpenGTL/OpenShiva/tools/interpreter/CMakeLists.txt	2008-05-24 09:30:36 UTC (rev 183)
+++ trunk/OpenGTL/OpenShiva/tools/tester/CMakeLists.txt	2008-06-14 09:07:23 UTC (rev 192)
@@ -1,9 +1,8 @@
 include_directories( ${CMAKE_SOURCE_DIR} )
 
-set(shiva_SRCS
+set(shivatester_SRCS
   Shiva.cpp
     )
 
-add_executable(shiva ${shiva_SRCS})
-target_link_libraries(shiva OpenShiva )
-install( TARGETS shiva DESTINATION ${BIN_INSTALL_DIR} )
+add_executable(shivatester ${shivatester_SRCS})
+target_link_libraries(shivatester OpenShiva )

Modified: trunk/OpenGTL/OpenShiva/tools/tester/Shiva.cpp
===================================================================
--- trunk/OpenGTL/OpenShiva/tools/interpreter/Shiva.cpp	2008-05-24 09:30:36 UTC (rev 183)
+++ trunk/OpenGTL/OpenShiva/tools/tester/Shiva.cpp	2008-06-14 09:07:23 UTC (rev 192)
@@ -35,7 +35,7 @@
 }
 void printHelp()
 {
-  std::cout << "Usage : shiva [option] fileName.shiva [input0.png input1.png ...] output.png" << std::endl;
+  std::cout << "Usage : shivatester [option] fileName.shiva" << std::endl;
   std::cout << std::endl;
   std::cout << "Options : " << std::endl;
 //   std::cout << "  -L --module-dir   add a location where to find modules" << std::endl;
@@ -49,7 +49,6 @@
 {
   GTLCore::String fileName = "";
   GTLCore::String output = "";
-  bool showAssembly = false;
   for(int ai = 1; ai < argc; ai++)
   {
     if(ARG_IS("-h","--help"))
@@ -70,8 +69,7 @@
 //         OpenShiva::ModulesManager::instance()->addDirectory(argv[ai]);
       }
     } else {
-      SHIVA_DEBUG( ai << " " << (int)argc << " " << ( ai > argc - 2) );
-      if( ai > argc - 2)
+      if( ai != argc - 1)
       {
         std::cerr << "Invalid command line parameters." << std::endl;
       } else {
@@ -107,10 +105,7 @@
       std::cout << "Error: " << std::endl << p.compilationErrorsMessage() << std::endl;
       return EXIT_FAILURE;
     }
-    if( showAssembly )
-    {
-      std::cout << p.asmSourceCode();
-    }
+    return p.runTest();
   }
   return EXIT_SUCCESS;
 }


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/