Salome HOME
Switch development flag to 1
[modules/hexablock.git] / src / TEST_CPP / Test_HEXABLOCK.cxx
index 7a9d5071ec0af3cd94f7dd4c5d6ac64e53acb962..8d114d1d48bbcad62ea131278c31395d8135e421 100755 (executable)
@@ -1,3 +1,22 @@
+// Copyright (C) 2009-2016  CEA/DEN, EDF R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
 #include <cppunit/BriefTestProgressListener.h>
 #include <cppunit/CompilerOutputter.h>
 #include <cppunit/extensions/TestFactoryRegistry.h>
@@ -6,7 +25,83 @@
 #include <cppunit/TestRunner.h>
 #include <cppunit/XmlOutputter.h>
 
-int main(int argc, char* argv[])
+#include "test_unit.hxx"
+
+#define TestUnit(call) display(#call); ier=call(nbargs,tabargs); display(ier)
+
+static int    total_tests  = 0;
+static int    total_errors = 0;
+static cpchar test_name    = "Unknown";
+
+static void display (cpchar name);
+static void display (int ier);
+
+// ============================================================== Main
+int main (int nbargs, cpchar tabargs [])
+{
+   int ier;
+
+   goto_workspace ();
+
+   TestUnit (test_sphere );
+   TestUnit (test_joint );
+   TestUnit (test_prism );
+   TestUnit (test_revolution9 );
+   TestUnit (test_revolution );
+   TestUnit (test_coude );
+   TestUnit (test_count );
+   TestUnit (test_decoupage );
+   // TestUnit (test_gen_xml );
+   // TestUnit (test_string_xml );
+   ///   TestUnit (test_relecture );
+   TestUnit (test_spherical);
+   TestUnit (test_grille_cyl );
+   TestUnit (test_cylindrical );
+   TestUnit (test_cylinder );
+   // TestUnit (test_xml_cylinder );
+   TestUnit (test_pipe );
+   TestUnit (test_joint2 );
+   TestUnit (test_croix );
+   TestUnit (test_pipes );
+   TestUnit (test_lorraine);
+   TestUnit (test_disconnect2 );
+   TestUnit (test_disconnect4 );
+   TestUnit (test_disconnect1 );
+   TestUnit (test_disconnect3 );
+   TestUnit (test_disconnect );
+   TestUnit (test_transfo2 );
+   TestUnit (test_transfo );
+   TestUnit (test_copy_document );
+   TestUnit (test_cylindricals );
+                 // Dans test_quads
+   TestUnit (test_hexa_quads_5 );
+   TestUnit (test_hexa_quads_ab );
+   TestUnit (test_hexa_quads_ac );
+   TestUnit (test_hexa_quads_ace );
+   TestUnit (test_hexa_quads_acd );
+   TestUnit (test_hexa_quads_abcd );
+   TestUnit (test_hexa_quads_abce );
+   TestUnit (test_cramer );
+   TestUnit (test_hexa_quads_ac1 );
+   TestUnit (test_asso_grid );
+   TestUnit (test_piquage );
+   TestUnit (test_replace );
+   TestUnit (test_hemispheres );
+
+   free_workspace ();
+
+   cout << "========================================= " 
+        << endl;
+   cout << "==== End of tests : Number of Errors = " << total_errors << " / " << total_tests
+        << endl;
+   cout << "========================================= " 
+        << endl;
+
+   return total_errors==0 ? 0 : 1;
+}
+
+// ============================================================== main-type
+int main_standard (int argc, char* argv[])
 {
        // Retrieve test path from command line first argument. Default to "" which resolve
        // to the top level suite.
@@ -44,4 +139,29 @@ int main(int argc, char* argv[])
        file.close();
        
        return result.wasSuccessful() ? 0 : 1;
-}
\ No newline at end of file
+}
+// ============================================================= display name
+void display (cpchar nom)
+{
+   test_name = nom;
+   cout << endl;
+   cout << "========================================= Run "
+        << test_name << endl;
+}
+// ============================================================= display ier
+void display (int result)
+{
+   cout << ".........................................."
+        << " End of " << test_name;
+   total_tests++;
+   if (result==0)
+      {
+      cout << ", Successfull";
+      }
+   else {
+      cout << ", Code error = " << result;
+      total_errors++;
+   };
+   cout << endl;
+   
+}