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
This commit is contained in:
reed@android.com 2009-02-28 18:26:14 +00:00
parent d8730ea8b2
commit a396a16d53
3 changed files with 18 additions and 2 deletions

View File

@ -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)"

View File

@ -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 {