Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 #!/bin/bash | |
| 2 # Copyright 2014 The Chromium Authors. All rights reserved. | |
| 3 # Use of this source code is governed by a BSD-style license that can be | |
| 4 # found in the LICENSE file. | |
| 5 # | |
| 6 # Downloads and compiles necessary dependencies (closure compiler, junit) and | |
| 7 # builds and runs Java-specific JUnit tests. | |
| 8 | |
| 9 readonly SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) | |
| 10 readonly TEMP_DIR=$(mktemp -d) | |
| 11 | |
| 12 cleanup() { | |
| 13 echo "Cleaning up" | |
| 14 rm -rf "${TEMP_DIR}" | |
| 15 rm -rf ${SCRIPT_DIR}/runner/*/com/google/javascript/jscomp/*.class | |
| 16 } | |
| 17 | |
| 18 trap cleanup SIGINT SIGHUP SIGTERM | |
| 19 | |
| 20 cd "${TEMP_DIR}" | |
| 21 echo "Cloning Closure Compiler repo" | |
| 22 git clone https://github.com/google/closure-compiler.git | |
| 23 | |
| 24 cd closure-compiler | |
| 25 echo "Building Closure Compiler" | |
| 26 ant all-classes-jar | |
| 27 | |
| 28 readonly cp=".:./runner/test:./runner/src:\ | |
|
Vitaly Pavlenko
2014/09/30 02:42:20
I would probably s/cp/classpath/ to not confuse re
Dan Beam
2014/09/30 03:08:38
Done.
| |
| 29 ${TEMP_DIR}/closure-compiler/build/compiler.jar:\ | |
| 30 ${TEMP_DIR}/closure-compiler/build/classes:\ | |
| 31 ${TEMP_DIR}/closure-compiler/lib/junit.jar" | |
| 32 | |
| 33 cd "${SCRIPT_DIR}" | |
| 34 | |
| 35 echo "Compiling tests" | |
| 36 javac -cp "$cp" runner/test/com/google/javascript/jscomp/ChromePassTest.java | |
|
Vitaly Pavlenko
2014/09/30 02:42:20
prefer "${var}" over "$var"
https://google-styleg
Dan Beam
2014/09/30 03:08:38
Done.
| |
| 37 | |
| 38 echo "Running tests" | |
|
Vitaly Pavlenko
2014/09/30 02:42:20
Should be done only after successfully compilation
Dan Beam
2014/09/30 03:08:37
Done.
| |
| 39 java -cp "$cp" org.junit.runner.JUnitCore \ | |
| 40 com.google.javascript.jscomp.ChromePassTest | |
| 41 | |
| 42 cleanup | |
| OLD | NEW |