-
Notifications
You must be signed in to change notification settings - Fork 2
/
test.sh
executable file
·74 lines (65 loc) · 1.5 KB
/
test.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# Note: On a 64-bit system you need to install the following:
# apt-get install g++-multilib
clear
set -e
set -x
export GTEST_DIR=./third_party/googletest/
# Clang conversion
# export CC=g++
export CC=clang++
# Build GoogleTest if not found.
# sudo apt-get install libc++6
echo "Building GoogleTest library."
mkdir -p ./bin/
$CC \
-m32 \
-pthread \
-I $GTEST_DIR \
-I $GTEST_DIR/include \
-c $GTEST_DIR/src/gtest-all.cc
ar -rv ./bin/libgtest.a gtest-all.o
# TODO(chris): Move this to the Makefile.
echo "Building klib unit tests."
$CC \
-I$GTEST_DIR/include \
-I. \
-std=c++11 \
-pthread \
-m32 \
-fno-stack-protector -Wall -Wextra \
./klib/strings.cpp \
./klib/argaccumulator.cpp \
./klib/argaccumulator_test.cpp \
./klib/type_printer.cpp \
./klib/type_printer_test.cpp \
./klib/print_test.cpp \
./klib/debug.cpp \
./klib/debug_test.cpp \
./klib/tests_main.cpp \
./klib/print.cpp \
./bin/libgtest.a \
-o ./bin/klib-tests
echo "Running."
./bin/klib-tests
echo "Building kernel unit tests."
$CC \
-I$GTEST_DIR/include \
-I. \
-m32 \
-std=c++11 \
-pthread \
-Wall -Wextra \
./klib/argaccumulator.cpp \
./klib/panic.cpp \
./klib/type_printer.cpp \
./klib/print.cpp \
./klib/strings.cpp \
./kernel/boot.cpp \
./kernel/elf.cpp \
./kernel/memory.cpp \
./kernel/memory_test.cpp \
./kernel/tests_main.cpp \
./bin/libgtest.a \
-o ./bin/kernel-tests
echo "Running."
./bin/kernel-tests