OLD | NEW |
1 # Copyright (c) 2013 The Native Client Authors. All rights reserved. | 1 # Copyright (c) 2013 The Native Client Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 MAKE_TARGETS="CCLD=\$(CXX) all" | 5 MAKE_TARGETS="CCLD=\$(CXX) all" |
6 NACLPORTS_CPPFLAGS+=" -DNACL_SDK_VERSION=$NACL_SDK_VERSION" | 6 NACLPORTS_CPPFLAGS+=" -DNACL_SDK_VERSION=$NACL_SDK_VERSION" |
7 if [ "${NACL_DEBUG}" = "1" ] ; then | 7 if [ "${NACL_DEBUG}" = "1" ] ; then |
8 NACLPORTS_CPPFLAGS+=" -DSQLITE_DEBUG -DSQLITE_LOCK_TRACE" | 8 NACLPORTS_CPPFLAGS+=" -DSQLITE_DEBUG -DSQLITE_LOCK_TRACE" |
9 fi | 9 fi |
10 if [ "${NACL_SHARED}" = "1" ]; then | 10 if [ "${NACL_SHARED}" = "1" ]; then |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 | 46 |
47 TestStep() { | 47 TestStep() { |
48 MakeDir naclport_test | 48 MakeDir naclport_test |
49 | 49 |
50 if [[ ${NACL_ARCH} == "pnacl" ]]; then | 50 if [[ ${NACL_ARCH} == "pnacl" ]]; then |
51 EXT=.bc | 51 EXT=.bc |
52 else | 52 else |
53 EXT=${NACL_EXEEXT} | 53 EXT=${NACL_EXEEXT} |
54 fi | 54 fi |
55 | 55 |
56 INCLUDES="-I${SRC_DIR}" | 56 INCLUDES="-I${SRC_DIR} -I${GTEST_SRC}/include" |
| 57 LogExecute ${NACLCXX} ${INCLUDES} ${NACLPORTS_CPPFLAGS} -I${GTEST_SRC} \ |
| 58 ${NACLPORTS_CFLAGS} -o gtest-all.o -c ${GTEST_SRC}/src/gtest-all.cc |
| 59 |
57 LogExecute ${NACLCXX} ${INCLUDES} ${NACLPORTS_CPPFLAGS} \ | 60 LogExecute ${NACLCXX} ${INCLUDES} ${NACLPORTS_CPPFLAGS} \ |
58 ${NACLPORTS_CFLAGS} ${NACLPORTS_LDFLAGS} \ | 61 ${NACLPORTS_CFLAGS} -o test.o -c ${START_DIR}/test.cc |
59 -DPPAPI -o naclport_test/test${EXT} \ | 62 |
60 ${START_DIR}/test.cc sqlite3.o ${NACLPORTS_LIBS} -lgtest | 63 LogExecute ${NACLCXX} ${NACLPORTS_LDFLAGS} \ |
| 64 -o naclport_test/test${EXT} test.o gtest-all.o sqlite3.o ${NACLPORTS_LIBS} |
61 | 65 |
62 [[ ${NACL_ARCH} == "pnacl" ]] && ${PNACLFINALIZE} \ | 66 [[ ${NACL_ARCH} == "pnacl" ]] && ${PNACLFINALIZE} \ |
63 -o naclport_test/test${NACL_EXEEXT} naclport_test/test${EXT} | 67 -o naclport_test/test${NACL_EXEEXT} naclport_test/test${EXT} |
64 | 68 |
65 echo "Running test" | 69 echo "Running test" |
66 | 70 |
67 if [ "${NACL_ARCH}" = "pnacl" ]; then | 71 if [ "${NACL_ARCH}" = "pnacl" ]; then |
68 local pexe=test${NACL_EXEEXT} | 72 local pexe=test${NACL_EXEEXT} |
69 (cd naclport_test; | 73 (cd naclport_test; |
70 TranslateAndWriteLauncherScript ${pexe} x86-32 test.x86-32${EXT} \ | 74 TranslateAndWriteLauncherScript ${pexe} x86-32 test.x86-32${EXT} \ |
71 test) | 75 test) |
72 RunTest | 76 RunTest |
73 (cd naclport_test; | 77 (cd naclport_test; |
74 TranslateAndWriteLauncherScript ${pexe} x86-64 test.x86-64${EXT} \ | 78 TranslateAndWriteLauncherScript ${pexe} x86-64 test.x86-64${EXT} \ |
75 test) | 79 test) |
76 RunTest | 80 RunTest |
77 echo "Tests OK" | 81 echo "Tests OK" |
78 elif [ "$(uname -m)" = "${NACL_ARCH_ALT}" ]; then | 82 elif [ "$(uname -m)" = "${NACL_ARCH_ALT}" ]; then |
79 WriteLauncherScript naclport_test/test test${EXT} | 83 WriteLauncherScript naclport_test/test test${EXT} |
80 RunTest | 84 RunTest |
81 echo "Tests OK" | 85 echo "Tests OK" |
82 fi | 86 fi |
83 } | 87 } |
OLD | NEW |