| OLD | NEW |
| 1 #!/bin/bash | 1 #!/bin/bash |
| 2 # Copyright (c) 2012 The Native Client Authors. All rights reserved. | 2 # Copyright (c) 2012 The Native Client Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 # Use of this source code is governed by a BSD-style license that can be | 6 # Use of this source code is governed by a BSD-style license that can be |
| 7 # found in the LICENSE file. | 7 # found in the LICENSE file. |
| 8 | 8 |
| 9 # Main entry point for buildbots. | 9 # Main entry point for buildbots. |
| 10 # For local testing set BUILDBOT_BUILDERNAME and TEST_BUILDBOT, e.g: | 10 # For local testing set BUILDBOT_BUILDERNAME and TEST_BUILDBOT, e.g: |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 echo ${PYTHON} ${SCRIPT_DIR}/download_emscripten.py | 171 echo ${PYTHON} ${SCRIPT_DIR}/download_emscripten.py |
| 172 ${PYTHON} ${SCRIPT_DIR}/download_emscripten.py | 172 ${PYTHON} ${SCRIPT_DIR}/download_emscripten.py |
| 173 | 173 |
| 174 # Mechanism by which emscripten patches can be tested on the trybots | 174 # Mechanism by which emscripten patches can be tested on the trybots |
| 175 if [ -f "${NACLPORTS_SRC}/emscripten.patch" ]; then | 175 if [ -f "${NACLPORTS_SRC}/emscripten.patch" ]; then |
| 176 cd ${EMSCRIPTEN_ROOT} | 176 cd ${EMSCRIPTEN_ROOT} |
| 177 echo "Applying emscripten.patch" | 177 echo "Applying emscripten.patch" |
| 178 git apply "${NACLPORTS_SRC}/emscripten.patch" | 178 git apply "${NACLPORTS_SRC}/emscripten.patch" |
| 179 cd - | 179 cd - |
| 180 fi | 180 fi |
| 181 | |
| 182 # Add the node 'bin' directory to the PATH. | |
| 183 # TODO(sbc): probably cleaner to modify .emscripten file instead. | |
| 184 local node_bin=${NACLPORTS_SRC}/out/node-v0.12.1-linux-x64/bin/ | |
| 185 if [ ! -d "${node_bin}" ]; then | |
| 186 echo "node bin directory not found: ${node_bin}" | |
| 187 exit 1 | |
| 188 fi | |
| 189 echo "Adding node bin directory to PATH: ${node_bin}" | |
| 190 export PATH=${PATH}:${node_bin} | |
| 191 | |
| 192 export EM_CONFIG=${EMSDK_ROOT}/.emscripten | |
| 193 export EMSCRIPTEN=${EMSDK_ROOT}/emscripten | |
| 194 echo "Setting EM_CONFIG: ${EM_CONFIG} EMSCRIPTEN: ${EMSCRIPTEN}" | |
| 195 | |
| 196 echo "Adding emscripten to PATH: ${EMSCRIPTEN_ROOT}" | |
| 197 export PATH=${PATH}:${EMSCRIPTEN_ROOT} | |
| 198 | |
| 199 # Finally, run 'emcc -v' which will check that the compiler is working | |
| 200 echo "Running emcc -v" | |
| 201 emcc -v | |
| 202 | |
| 203 # Run using -O2 to compile the native js-optimizer | |
| 204 touch ${NACLPORTS_SRC}/out/test.c | |
| 205 emcc -O2 -o ${NACLPORTS_SRC}/out/test.js ${NACLPORTS_SRC}/out/test.c | |
| 206 rm ${NACLPORTS_SRC}/out/test.{c,js} | |
| 207 } | 181 } |
| 208 | 182 |
| 209 Unittests() { | 183 Unittests() { |
| 210 echo "@@@BUILD_STEP naclports unittests@@@" | 184 echo "@@@BUILD_STEP naclports unittests@@@" |
| 211 CMD="make -C $(dirname ${SCRIPT_DIR}) check" | 185 CMD="make -C $(dirname ${SCRIPT_DIR}) check" |
| 212 echo "Running ${CMD}" | 186 echo "Running ${CMD}" |
| 213 if ! ${CMD}; then | 187 if ! ${CMD}; then |
| 214 RESULT=1 | 188 RESULT=1 |
| 215 echo "@@@STEP_FAILURE@@@" | 189 echo "@@@STEP_FAILURE@@@" |
| 216 fi | 190 fi |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 Publish | 233 Publish |
| 260 fi | 234 fi |
| 261 | 235 |
| 262 echo "@@@BUILD_STEP Summary@@@" | 236 echo "@@@BUILD_STEP Summary@@@" |
| 263 if [ "${RESULT}" != "0" ] ; then | 237 if [ "${RESULT}" != "0" ] ; then |
| 264 echo "@@@STEP_FAILURE@@@" | 238 echo "@@@STEP_FAILURE@@@" |
| 265 echo -e "${MESSAGES}" | 239 echo -e "${MESSAGES}" |
| 266 fi | 240 fi |
| 267 | 241 |
| 268 exit ${RESULT} | 242 exit ${RESULT} |
| OLD | NEW |