Bladeren bron

Made changes to testing protocol

enhancement_3
Trevor Irons 8 jaren geleden
bovenliggende
commit
4da2f9ffd6

+ 5
- 6
CMakeLists.txt Bestand weergeven

@@ -204,8 +204,8 @@ if(CXXTEST_FOUND)
204 204
     enable_testing()
205 205
     #CXXTEST_ADD_TEST(tester_executable runner.cpp
206 206
     #                    ${CMAKE_CURRENT_SOURCE_DIR}/src/myTestsuite.h)
207
-	CXXTEST_ADD_TEST(unittest_foo foo_test.cc
208
-                      ${CMAKE_CURRENT_SOURCE_DIR}/src/myTestSuite.h)
207
+	#CXXTEST_ADD_TEST(unittest_foo foo_test.cc
208
+    #                  ${CMAKE_CURRENT_SOURCE_DIR}/src/myTestSuite.h)
209 209
     #target_link_libraries(unittest_foo foo) # as needed
210 210
 #	else()
211 211
 #	message(FATAL_ERROR "CxxTest not found.")
@@ -222,10 +222,9 @@ add_subdirectory (Modules)
222 222
 # 
223 223
 include_directories(${CMAKE_INSTALL_PREFIX}/include)
224 224
 
225
-add_executable(Hello "${PROJECT_SOURCE_DIR}/src/test.cpp")
226
-target_link_libraries(Hello lemmacore)
227
-add_dependencies(Hello YAML-CPP)
228
-
225
+#add_executable(Hello "${PROJECT_SOURCE_DIR}/src/test.cpp")
226
+#target_link_libraries(Hello lemmacore)
227
+#add_dependencies(Hello YAML-CPP)
229 228
 
230 229
 # add a target to generate API documentation with Doxygen
231 230
 # ALL make documentation build by default if possible

+ 5
- 0
LemmaCore/include/EarthModel.h Bestand weergeven

@@ -90,6 +90,11 @@ namespace Lemma {
90 90
             /// \mathbf{B}_0 \Vert \f$ in Gauss units
91 91
             Real GetMagneticFieldMagnitudeInGauss( );
92 92
 
93
+            /** Returns the name of the underlying class, similiar to Python's type */
94
+            virtual inline std::string GetName() const {
95
+                return this->CName;
96
+            }
97
+
93 98
         protected:
94 99
 
95 100
             // ====================  LIFECYCLE     =======================

+ 5
- 0
LemmaCore/include/Filter.h Bestand weergeven

@@ -39,6 +39,11 @@ namespace Lemma {
39 39
 
40 40
             // ====================  INQUIRY       =======================
41 41
 
42
+            /** Returns the name of the underlying class, similiar to Python's type */
43
+            virtual inline std::string GetName() const {
44
+                return this->CName;
45
+            }
46
+
42 47
         protected:
43 48
 
44 49
             // ====================  LIFECYCLE     =======================

+ 5
- 0
LemmaCore/include/Grid.h Bestand weergeven

@@ -42,6 +42,11 @@ class Grid : public LemmaObject {
42 42
 
43 43
         // ====================  INQUIRY       ===================================
44 44
 
45
+        /** Returns the name of the underlying class, similiar to Python's type */
46
+        virtual inline std::string GetName() const {
47
+            return this->CName;
48
+        }
49
+
45 50
     protected:
46 51
 
47 52
         // ====================  LIFECYCLE     ===================================

+ 8
- 0
LemmaCore/include/GridReader.h Bestand weergeven

@@ -51,6 +51,11 @@ namespace Lemma {
51 51
 
52 52
             // ====================  INQUIRY       =======================
53 53
 
54
+            /** Returns the name of the underlying class, similiar to Python's type */
55
+            virtual inline std::string GetName() const {
56
+                return this->CName;
57
+            }
58
+
54 59
         protected:
55 60
 
56 61
             // ====================  LIFECYCLE     =======================
@@ -65,6 +70,9 @@ namespace Lemma {
65 70
 
66 71
         private:
67 72
 
73
+            /** ASCII string representation of the class name */
74
+            static constexpr auto CName = "GridReader";
75
+
68 76
             // ====================  DATA MEMBERS  =========================
69 77
 
70 78
     }; // -----  end of class  GridReader  -----

+ 5
- 0
LemmaCore/include/Instrument.h Bestand weergeven

@@ -41,6 +41,11 @@ namespace Lemma {
41 41
 
42 42
 			// ====================  INQUIRY       ===========================
43 43
 
44
+            /** Returns the name of the underlying class, similiar to Python's type */
45
+            virtual inline std::string GetName() const {
46
+                return this->CName;
47
+            }
48
+
44 49
 			// ====================  DATA MEMBERS  ===========================
45 50
 
46 51
 		protected:

+ 5
- 0
LemmaCore/include/LayeredEarth.h Bestand weergeven

@@ -85,6 +85,11 @@ namespace Lemma {
85 85
             YAML::Node Serialize() const;
86 86
             //static LayeredEarth* DeSerialize(const YAML::Node& node);
87 87
 
88
+            /** Returns the name of the underlying class, similiar to Python's type */
89
+            virtual inline std::string GetName() const {
90
+                return this->CName;
91
+            }
92
+
88 93
 		protected:
89 94
 
90 95
 			// ====================  LIFECYCLE     ===========================

+ 1
- 1
LemmaCore/include/LemmaCore Bestand weergeven

@@ -30,10 +30,10 @@
30 30
 #include "RectilinearGridReader.h"
31 31
 #include "RectilinearGridVTKExporter.h"
32 32
 #include "WindowFilter.h"
33
+// helpers and utilities
33 34
 #include "banner.h"
34 35
 #include "helper.h"
35 36
 #include "timer.h"
36
-
37 37
 #endif   // ----- #ifndef LEMMAINCLUDE_INC  -----
38 38
 
39 39
 /* vim: set tabstop=4 expandtab: */

+ 5
- 0
LemmaCore/include/RectilinearGrid.h Bestand weergeven

@@ -141,6 +141,11 @@ namespace Lemma {
141 141
 
142 142
             // ====================  INQUIRY       =======================
143 143
 
144
+            /** Returns the name of the underlying class, similiar to Python's type */
145
+            virtual inline std::string GetName() const {
146
+                return this->CName;
147
+            }
148
+
144 149
         protected:
145 150
 
146 151
             // ====================  LIFECYCLE     =======================

+ 5
- 0
LemmaCore/include/RectilinearGridReader.h Bestand weergeven

@@ -73,6 +73,11 @@ namespace Lemma {
73 73
 
74 74
             // ====================  INQUIRY       =======================
75 75
 
76
+            /** Returns the name of the underlying class, similiar to Python's type */
77
+            virtual inline std::string GetName() const {
78
+                return this->CName;
79
+            }
80
+
76 81
         protected:
77 82
 
78 83
             // ====================  LIFECYCLE     =======================

+ 6
- 1
LemmaCore/include/RectilinearGridVTKExporter.h Bestand weergeven

@@ -83,6 +83,11 @@ class RectilinearGridVTKExporter : public LemmaObject {
83 83
      */
84 84
     void WriteVTKGrid( const std::string& name );
85 85
 
86
+    /** Returns the name of the underlying class, similiar to Python's type */
87
+    virtual inline std::string GetName() const {
88
+        return this->CName;
89
+    }
90
+
86 91
     protected:
87 92
 
88 93
     // ====================  LIFECYCLE     =======================
@@ -96,7 +101,7 @@ class RectilinearGridVTKExporter : public LemmaObject {
96 101
     private:
97 102
 
98 103
     /** ASCII string representation of the class name */
99
-    static constexpr auto CName = "VTKRectilinearGridVTKExporter";
104
+    static constexpr auto CName = "RectilinearGridVTKExporter";
100 105
 
101 106
     void BuildVTKRectilinearGrid();
102 107
 

+ 5
- 0
LemmaCore/include/WindowFilter.h Bestand weergeven

@@ -76,6 +76,11 @@ namespace Lemma {
76 76
             /// Returns a Vector of the filter coefficients.
77 77
             VectorXr GetFilterCoefficients( );
78 78
 
79
+            /** Returns the name of the underlying class, similiar to Python's type */
80
+            virtual inline std::string GetName() const {
81
+                return this->CName;
82
+            }
83
+
79 84
         protected:
80 85
 
81 86
             // ====================  LIFECYCLE     =======================

+ 11
- 4
LemmaCore/testing/CMakeLists.txt Bestand weergeven

@@ -1,4 +1,11 @@
1
-add_executable(testOne testOne.cpp)
2
-add_executable(testTwo testTwo.cpp)
3
-add_test( testLemmaCoreOne testOne )
4
-add_test( testLemmaCoreTwo testTwo )
1
+#add_executable(testOne testOne.cpp)
2
+#add_executable(testTwo testTwo.cpp)
3
+#add_test( testLemmaCoreOne testOne )
4
+#add_test( testLemmaCoreTwo testTwo )
5
+
6
+CXXTEST_ADD_TEST(unittest_GetNameCheck GetNameCheck.cc ${CMAKE_CURRENT_SOURCE_DIR}/GetNameCheck.h)
7
+target_link_libraries(unittest_GetNameCheck "lemmacore")
8
+
9
+CXXTEST_ADD_TEST(unittest_SerializeCheck SerializeCheck.cc ${CMAKE_CURRENT_SOURCE_DIR}/SerializeCheck.h)
10
+target_link_libraries(unittest_SerializeCheck "lemmacore")
11
+ 

+ 1
- 1
src/myTestSuite.h Bestand weergeven

@@ -26,7 +26,7 @@ class MyTestSuite : public CxxTest::TestSuite
26 26
     void testAddition( void )
27 27
     {
28 28
         TS_ASSERT( 1 + 1 > 1 );
29
-        TS_ASSERT( 1 - 1 > 1 );
29
+        TS_ASSERT( 3 - 1 > 1 );
30 30
         TS_ASSERT_EQUALS( 1 + 1, 2 );
31 31
     }
32 32
 };

Laden…
Annuleren
Opslaan