Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(610)

Side by Side Diff: third_party/closure_compiler/build_and_run_tests

Issue 615733002: closure: add bash script to build and run Java tests from command line. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: vitalyp@ review Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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 rm -rf "${TEMP_DIR}"
14 rm -rf ${SCRIPT_DIR}/runner/*/com/google/javascript/jscomp/*.class
15 }
16
17 die_earlier() {
18 cleanup
19 exit 1
20 }
21
22 trap die_earlier SIGINT SIGHUP SIGTERM
23
24 cd "${TEMP_DIR}"
25 echo "Cloning Closure Compiler repo"
26 git clone https://github.com/google/closure-compiler.git || die_earlier
27
28 cd closure-compiler
29 echo "Building Closure Compiler"
30 ant all-classes-jar || die_earlier
31
32 readonly classpath=".:./runner/test:./runner/src:\
33 ${TEMP_DIR}/closure-compiler/build/compiler.jar:\
34 ${TEMP_DIR}/closure-compiler/build/classes:\
35 ${TEMP_DIR}/closure-compiler/lib/junit.jar"
36
37 cd "${SCRIPT_DIR}"
38
39 echo "Compiling tests"
40 javac -classpath "${classpath}" \
41 runner/test/com/google/javascript/jscomp/ChromePassTest.java || die_earlier
42
43 echo "Running tests"
44 java -classpath "${classpath}" org.junit.runner.JUnitCore \
45 com.google.javascript.jscomp.ChromePassTest || die_earlier
46
47 echo "Cleaning up"
Vitaly Pavlenko 2014/10/01 00:04:59 Actually, this "echo" is better to pull inside cle
48 cleanup
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698