1 | /****************************************************************************
|
---|
2 | **
|
---|
3 | ** Copyright (c) 2008-2012 C.B. Barber. All rights reserved.
|
---|
4 | ** $Id: //main/2011/qhull/src/qhulltest/qhulltest.cpp#5 $$Change: 1490 $
|
---|
5 | ** $DateTime: 2012/02/19 20:27:01 $$Author: bbarber $
|
---|
6 | **
|
---|
7 | ****************************************************************************/
|
---|
8 |
|
---|
9 | //pre-compiled headers
|
---|
10 | #include <iostream>
|
---|
11 | #include <sstream>
|
---|
12 | #include <string>
|
---|
13 | #include <stdexcept>
|
---|
14 | #include "RoadTest.h"
|
---|
15 |
|
---|
16 | #include "../libqhullcpp/RoadError.h"
|
---|
17 |
|
---|
18 | using std::cout;
|
---|
19 | using std::endl;
|
---|
20 |
|
---|
21 | namespace orgQhull {
|
---|
22 |
|
---|
23 | void addQhullTests(QStringList &args)
|
---|
24 | {
|
---|
25 | TESTadd_(add_QhullVertex_test); //copy
|
---|
26 |
|
---|
27 | if(args.contains("--all")){
|
---|
28 | args.removeAll("--all");
|
---|
29 | // up-to-date
|
---|
30 | TESTadd_(add_Coordinates_test);
|
---|
31 | TESTadd_(add_PointCoordinates_test);
|
---|
32 | TESTadd_(add_QhullFacet_test);
|
---|
33 | TESTadd_(add_QhullFacetList_test);
|
---|
34 | TESTadd_(add_QhullFacetSet_test);
|
---|
35 | TESTadd_(add_QhullHyperplane_test);
|
---|
36 | TESTadd_(add_QhullLinkedList_test);
|
---|
37 | TESTadd_(add_QhullPoint_test);
|
---|
38 | TESTadd_(add_QhullPoints_test);
|
---|
39 | TESTadd_(add_QhullPointSet_test);
|
---|
40 | TESTadd_(add_QhullRidge_test);
|
---|
41 | TESTadd_(add_QhullSet_test);
|
---|
42 | TESTadd_(add_QhullVertex_test);
|
---|
43 | TESTadd_(add_RboxPoints_test);
|
---|
44 | TESTadd_(add_UsingLibQhull_test);
|
---|
45 | // needs review
|
---|
46 | // qhullStat
|
---|
47 | TESTadd_(add_Qhull_test);
|
---|
48 | }//--all
|
---|
49 | }//addQhullTests
|
---|
50 |
|
---|
51 | int main(int argc, char *argv[])
|
---|
52 | {
|
---|
53 | QCoreApplication app(argc, argv);
|
---|
54 | QStringList args= app.arguments();
|
---|
55 | bool isAll= args.contains("--all");
|
---|
56 | addQhullTests(args);
|
---|
57 | int status=1010;
|
---|
58 | try{
|
---|
59 | status= RoadTest::runTests(args);
|
---|
60 | }catch(const std::exception &e){
|
---|
61 | cout << "FAIL! : runTests() did not catch error\n";
|
---|
62 | cout << e.what() << endl;
|
---|
63 | if(!RoadError::emptyGlobalLog()){
|
---|
64 | cout << RoadError::stringGlobalLog() << endl;
|
---|
65 | RoadError::clearGlobalLog();
|
---|
66 | }
|
---|
67 | }
|
---|
68 | if(!RoadError::emptyGlobalLog()){
|
---|
69 | cout << RoadError::stringGlobalLog() << endl;
|
---|
70 | RoadError::clearGlobalLog();
|
---|
71 | }
|
---|
72 | if(isAll){
|
---|
73 | cout << "Finished test of libqhullcpp. Test libqhull with eg/q_test" << endl;
|
---|
74 | }else{
|
---|
75 | cout << "Finished test of one class. Test all classes with 'qhulltest --all'" << endl;
|
---|
76 | }
|
---|
77 | return status;
|
---|
78 | }
|
---|
79 |
|
---|
80 | }//orgQhull
|
---|
81 |
|
---|
82 | int main(int argc, char *argv[])
|
---|
83 | {
|
---|
84 | return orgQhull::main(argc, argv); // Needs RoadTest:: for TESTadd_() linkage
|
---|
85 | }
|
---|
86 |
|
---|