00001 /**************************************************************************** 00002 ** 00003 ** Copyright (c) 2008-2011 C.B. Barber. All rights reserved. 00004 ** $Id: //main/2011/qhull/src/qhulltest/qhulltest.cpp#3 $$Change: 1342 $ 00005 ** $DateTime: 2011/03/07 21:55:47 $$Author: bbarber $ 00006 ** 00007 ****************************************************************************/ 00008 00009 //pre-compiled headers 00010 #include <iostream> 00011 #include <sstream> 00012 #include <string> 00013 #include <stdexcept> 00014 #include "../road/RoadTest.h" 00015 00016 #include "../road/RoadError.h" 00017 00018 using std::cout; 00019 using std::endl; 00020 00021 namespace orgQhull { 00022 00023 void addQhullTests(QStringList &args) 00024 { 00025 TESTadd_(add_QhullVertex_test); //copy 00026 00027 if(args.contains("--all")){ 00028 args.removeAll("--all"); 00029 // up-to-date 00030 TESTadd_(add_Coordinates_test); 00031 TESTadd_(add_PointCoordinates_test); 00032 TESTadd_(add_QhullFacet_test); 00033 TESTadd_(add_QhullFacetList_test); 00034 TESTadd_(add_QhullFacetSet_test); 00035 TESTadd_(add_QhullHyperplane_test); 00036 TESTadd_(add_QhullLinkedList_test); 00037 TESTadd_(add_QhullPoint_test); 00038 TESTadd_(add_QhullPoints_test); 00039 TESTadd_(add_QhullPointSet_test); 00040 TESTadd_(add_QhullRidge_test); 00041 TESTadd_(add_QhullSet_test); 00042 TESTadd_(add_QhullVertex_test); 00043 TESTadd_(add_RboxPoints_test); 00044 TESTadd_(add_UsingLibQhull_test); 00045 // needs review 00046 // qhullStat 00047 TESTadd_(add_Qhull_test); 00048 }//--all 00049 }//addQhullTests 00050 00051 int main(int argc, char *argv[]) 00052 { 00053 QCoreApplication app(argc, argv); 00054 QStringList args= app.arguments(); 00055 bool isAll= args.contains("--all"); 00056 addQhullTests(args); 00057 int status=1010; 00058 try{ 00059 status= RoadTest::runTests(args); 00060 }catch(const std::exception &e){ 00061 cout << "FAIL! : runTests() did not catch error\n"; 00062 cout << e.what() << endl; 00063 if(!RoadError::emptyGlobalLog()){ 00064 cout << RoadError::stringGlobalLog() << endl; 00065 RoadError::clearGlobalLog(); 00066 } 00067 } 00068 if(!RoadError::emptyGlobalLog()){ 00069 cout << RoadError::stringGlobalLog() << endl; 00070 RoadError::clearGlobalLog(); 00071 } 00072 if(isAll){ 00073 cout << "Finished test of libqhullcpp. Test libqhull with eg/q_test" << endl; 00074 }else{ 00075 cout << "Finished test of one class. Test all classes with 'qhulltest --all'" << endl; 00076 } 00077 return status; 00078 } 00079 00080 }//orgQhull 00081 00082 int main(int argc, char *argv[]) 00083 { 00084 return orgQhull::main(argc, argv); // Needs RoadTest:: for TESTadd_() linkage 00085 } 00086