aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar reed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2009-02-28 18:26:14 +0000
committerGravatar reed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2009-02-28 18:26:14 +0000
commita396a16d53c1355c59f9f1f739618b47dc346ee4 (patch)
treee9cb77a9c0e2b1105c39ec5834921ee38215117c
parentd8730ea8b25d692c0656f8cf03f02aecfab2a17c (diff)
add tests (unittests) to Makefile
move SkTSort.h into public includes git-svn-id: http://skia.googlecode.com/svn/trunk@98 2bbb7eff-a529-9590-31e7-b0007b416f81
-rw-r--r--Makefile18
-rw-r--r--include/core/SkTSort.h (renamed from src/core/SkTSort.h)0
-rw-r--r--tests/Sk64Test.cpp2
3 files changed, 18 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 63fe6e66e9..94528bb530 100644
--- a/Makefile
+++ b/Makefile
@@ -69,6 +69,8 @@ out/libskia.a: Makefile $(OBJ_LIST)
$(HIDE)$(AR) ru $@ $(OBJ_LIST)
$(HIDE)ranlib $@
+##############################################################################
+
BENCH_SRCS := RectBench.cpp SkBenchmark.cpp main.cpp BitmapBench.cpp
BENCH_SRCS := $(addprefix bench/, $(BENCH_SRCS))
@@ -86,6 +88,21 @@ bench: $(BENCH_OBJS) out/libskia.a
@echo "linking bench..."
$(HIDE)g++ $(BENCH_OBJS) out/libskia.a -o out/bench/bench $(LINKER_OPTS)
+##############################################################################
+
+TESTS_SRCS := GeometryTest.cpp MathTest.cpp MatrixTest.cpp PackBitsTest.cpp \
+ Sk64Test.cpp StringTest.cpp Test.cpp UtilsTest.cpp main.cpp
+TESTS_SRCS := $(addprefix tests/, $(TESTS_SRCS))
+
+TESTS_OBJS := $(TESTS_SRCS:.cpp=.o)
+TESTS_OBJS := $(addprefix out/, $(TESTS_OBJS))
+
+tests: $(TESTS_OBJS) out/libskia.a
+ @echo "linking tests..."
+ $(HIDE)g++ $(TESTS_OBJS) out/libskia.a -o out/tests/tests $(LINKER_OPTS)
+
+##############################################################################
+
.PHONY: clean
clean:
$(HIDE)rm -rf out
@@ -95,6 +112,7 @@ help:
@echo "Targets:"
@echo " <default>: out/libskia.a"
@echo " bench: out/bench/bench"
+ @echo " tests: out/tests/tests"
@echo " clean: removes entire out/ directory"
@echo " help: this text"
@echo "Options: (after make, or in bash shell)"
diff --git a/src/core/SkTSort.h b/include/core/SkTSort.h
index fba49e214f..fba49e214f 100644
--- a/src/core/SkTSort.h
+++ b/include/core/SkTSort.h
diff --git a/tests/Sk64Test.cpp b/tests/Sk64Test.cpp
index 1829c647e1..503395708d 100644
--- a/tests/Sk64Test.cpp
+++ b/tests/Sk64Test.cpp
@@ -2,7 +2,6 @@
#include "SkRandom.h"
#include <math.h>
-#ifdef SK_SUPPORT_UNITTEST
struct BoolTable {
int8_t zero, pos, neg, toBool, sign;
};
@@ -24,7 +23,6 @@ static void bool_table_test(skiatest::Reporter* reporter,
return ((SkLONGLONG)a.fHi << 32) | a.fLo;
}
#endif
-#endif
static void TestSk64(skiatest::Reporter* reporter) {
enum BoolTests {