Bladeren bron

Removed Quaternion Test, silenced more warnings.

Added build and run steps for all Unit Tests
Thomas Buck 10 jaren geleden
bovenliggende
commit
21ed8f4683
6 gewijzigde bestanden met toevoegingen van 37 en 70 verwijderingen
  1. 1
    0
      ChangeLog
  2. 31
    22
      Makefile
  3. 3
    3
      test/MatMath.cpp
  4. 1
    1
      test/Matrix.cpp
  5. 0
    43
      test/Quaternion.cpp
  6. 1
    1
      test/tga.cpp

+ 1
- 0
ChangeLog Bestand weergeven

@@ -10,6 +10,7 @@
10 10
 	* Turned on many more warnings and silenced some of them.
11 11
 	  There are a lot of unused parameters, so this warning is still turned
12 12
 	  off.
13
+	* Removed empty Quaternion Unit Test
13 14
 
14 15
 	[ 20140111 ]
15 16
 	* Rewrote GLString Unit Test, now using TTF Font

+ 31
- 22
Makefile Bestand weergeven

@@ -221,6 +221,7 @@ clean-dep:
221 221
 clean-test:
222 222
 	@-echo "Cleaning test builds"
223 223
 	@-rm -f $(BUILD_TEST_DIR)/*.o
224
+	@-rm -rf $(BUILD_TEST_DIR)/*.dSYM
224 225
 	@-rm -f $(BUILD_TEST_DIR)/*.test
225 226
 	@-rm -rf $(BUILD_TEST_DIR)/*.build
226 227
 	@-echo "[DONE]"
@@ -278,11 +279,36 @@ endif
278 279
 #################################################################
279 280
 TEST_FLAGS=$(WARNINGS) -g -O0 -DDEBUG -lstdc++ -Iinclude
280 281
 
281
-TEST_MAP_TR5=~/projects/Data/models/tombraider/tr5/demo.trc
282
-TEST_MAP_TR4=~/projects/Data/models/tombraider/tr4/angkor1.tr4
283
-TEST_MAP_TR3=~/projects/Data/models/tombraider/tr3/scotland.tr2
284
-TEST_MAP_TR2=~/projects/Data/models/tombraider/tr2/unwater.tr2
285
-TEST_MAP_TR1=~/projects/Data/models/tombraider/tr1/level1.phd
282
+TEST_MAP_TR5=~/.OpenRaider/paks/tr5/demo.trc
283
+TEST_MAP_TR4=~/.OpenRaider/paks/tr4/angkor1.tr4
284
+TEST_MAP_TR3=~/.OpenRaider/paks/tr3/scotland.tr2
285
+TEST_MAP_TR2=~/.OpenRaider/paks/tr2/unwater.tr2
286
+TEST_MAP_TR1=~/.OpenRaider/paks/tr1/level1.phd
287
+
288
+test.build: Matrix.test Math.test Memory.test Network.test Sound.test TGA.test GLString.test TombRaider.test
289
+
290
+test: test.build
291
+	@-echo "================================================="
292
+	@-echo "Running Memory unit test"
293
+	$(BUILD_TEST_DIR)/memory_test.test
294
+	@-echo "================================================="
295
+	@-echo "Running Matrix unit test"
296
+	$(BUILD_TEST_DIR)/Matrix.test
297
+	@-echo "================================================="
298
+	@-echo "Running Math unit test"
299
+	$(BUILD_TEST_DIR)/Math.test
300
+	@-echo "================================================="
301
+	@-echo "Running Sound unit test"
302
+	$(BUILD_TEST_DIR)/Sound.test
303
+	@-echo "================================================="
304
+	@-echo "Running TGA unit test"
305
+	$(BUILD_TEST_DIR)/TGA.test
306
+	@-echo "================================================="
307
+	@-echo "Running GLString unit test"
308
+	$(BUILD_TEST_DIR)/GLString.test
309
+	@-echo "================================================="
310
+	@-echo "Running TombRaider unit test"
311
+	$(BUILD_TEST_DIR)/TombRaider.test load $(TEST_MAP_TR1)
286 312
 
287 313
 TombRaider.reg_test:
288 314
 	$(MAKE) TombRaider.test
@@ -314,17 +340,6 @@ GLString.test:
314 340
 
315 341
 #################################################################
316 342
 
317
-Hel.test: Quaternion.test Matrix.test Math.test
318
-	@-echo "================================================="
319
-	@-echo "Running Matrix unit test"
320
-	$(BUILD_TEST_DIR)/Matrix.test
321
-	@-echo "================================================="
322
-	$(BUILD_TEST_DIR)/Math.test
323
-	@-echo "Running hel Math unit test"
324
-	@-echo "================================================="
325
-	@-echo "Running Quaternion unit test"
326
-	$(BUILD_TEST_DIR)/Quaternion.test
327
-
328 343
 Matrix.test:
329 344
 	@-echo "Building Matrix unit test"
330 345
 	mkdir -p $(BUILD_TEST_DIR)
@@ -332,12 +347,6 @@ Matrix.test:
332 347
 	src/Matrix.cpp src/Quaternion.cpp src/Vector3d.cpp \
333 348
 	test/Matrix.cpp -o $(BUILD_TEST_DIR)/Matrix.test
334 349
 
335
-Quaternion.test:
336
-	@-echo "Building Quaternion unit test"
337
-	mkdir -p $(BUILD_TEST_DIR)
338
-	$(CC) $(WARNINGS) -g -lm -lstdc++ -Iinclude \
339
-	src/Quaternion.cpp test/Quaternion.cpp -o $(BUILD_TEST_DIR)/Quaternion.test
340
-
341 350
 Math.test:
342 351
 	@-echo "Building Math unit test"
343 352
 	mkdir -p $(BUILD_TEST_DIR)

+ 3
- 3
test/MatMath.cpp Bestand weergeven

@@ -71,13 +71,13 @@ TEST random(vec_t bound[2]) {
71 71
 SUITE(mathSuite) {
72 72
     RUN_TEST(constants);
73 73
     RUN_TEST(types);
74
-    for (int i = 0; i < (sizeof(testDegrees) / sizeof(testDegrees[0])); i++) {
74
+    for (unsigned int i = 0; i < (sizeof(testDegrees) / sizeof(testDegrees[0])); i++) {
75 75
         RUN_TESTp(conversionToRad, testDegrees[i]);
76 76
     }
77
-    for (int i = 0; i < (sizeof(testRads) / sizeof(testRads[0])); i++) {
77
+    for (unsigned int i = 0; i < (sizeof(testRads) / sizeof(testRads[0])); i++) {
78 78
         RUN_TESTp(conversionToDeg, testRads[i]);
79 79
     }
80
-    for (int i = 0; i < sizeof(testBounds) / sizeof(testBounds[0]); i++) {
80
+    for (unsigned int i = 0; i < sizeof(testBounds) / sizeof(testBounds[0]); i++) {
81 81
         RUN_TESTp(random, testBounds[i]);
82 82
     }
83 83
 }

+ 1
- 1
test/Matrix.cpp Bestand weergeven

@@ -115,7 +115,7 @@ TEST precision() {
115 115
 }
116 116
 
117 117
 SUITE(matrixSuite) {
118
-    for (int i = 0; i < sizeof(initialValues) / sizeof(initialValues[0]); i++) {
118
+    for (unsigned int i = 0; i < sizeof(initialValues) / sizeof(initialValues[0]); i++) {
119 119
         for (int mode = 0; mode < 3; mode++) {
120 120
             RUN_TESTp(identity, initialValues[i], mode);
121 121
         }

+ 0
- 43
test/Quaternion.cpp Bestand weergeven

@@ -1,43 +0,0 @@
1
-/* -*- Mode: C++; tab-width: 3; indent-tabs-mode: t; c-basic-offset: 3 -*- */
2
-/*================================================================
3
- *
4
- * Project : Hel
5
- * Author  : Terry 'Mongoose' Hendrix II
6
- * Website : http://www.westga.edu/~stu7440/
7
- * Email   : stu7440@westga.edu
8
- * Object  : Quaternion
9
- * License : No use w/o permission (C) 2002 Mongoose
10
- * Comments: Quaternion now in C++ class form fresh from the grove
11
- *
12
- *
13
- *           This file was generated using Mongoose's C++
14
- *           template generator script.  <stu7440@westga.edu>
15
- *
16
- *-- History -------------------------------------------------
17
- *
18
- * 2002.12.16:
19
- * Mongoose - Created, based on mtk3d ( freyja )
20
- =================================================================*/
21
-
22
-#include <stdio.h>
23
-#include <math.h>
24
-
25
-#include <Quaternion.h>
26
-
27
-int runQuaternionUnitTest(int argc, char *argv[])
28
-{
29
-    //! \todo Implement Quaternion Unit Tests!
30
-    printf("Not implemented!\n");
31
-	return 0;
32
-}
33
-
34
-
35
-int main(int argc, char *argv[])
36
-{
37
-	printf("[Quaternion class test]\n");
38
-
39
-	runQuaternionUnitTest(argc, argv);
40
-
41
-	return 0;
42
-}
43
-

+ 1
- 1
test/tga.cpp Bestand weergeven

@@ -35,7 +35,7 @@ TEST loadFile(FILE *f) {
35 35
 }
36 36
 
37 37
 SUITE(tgaSuite) {
38
-    for (int i = 0; i < (sizeof(testFiles) / sizeof(testFiles[0])); i++) {
38
+    for (unsigned int i = 0; i < (sizeof(testFiles) / sizeof(testFiles[0])); i++) {
39 39
         FILE *f = fopen(testFiles[i], "r");
40 40
         RUN_TESTp(checkFile, f);
41 41
         RUN_TESTp(loadFile, f);

Laden…
Annuleren
Opslaan