-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile
39 lines (32 loc) · 1.49 KB
/
Makefile
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
# To build an xpi of current HEAD in build/:
# $ make
#
# Env var OBJDIR is required for 'test' and 'testcoverage' targets.
# Env var MOZILLA_SRC is required for 'testcoverage' target.
#
# On Linux you probably want to 'test' or 'testcoverage' with :
# $ nice xvfb-run make test
# So that the desktop is not monopolized by the tests.
PWD=`pwd`
VERSION=`git describe --tags --dirty | tail -c +2`
XPI="${PWD}/build/CodeInspector-${VERSION}.xpi"
COVERAGE_DIR="${PWD}/build/coverage/${VERSION}"
export TEST_PATH=browser/base/content/test/CodeInspector
export COVERAGE_PROJECT=Code Inspector
export COVERAGE_FILTER=*/CodeInspector.jsm */AdaptiveSplitView.jsm */StyleEditorUtils.jsm
COVERAGE_DIR="${PWD}/build/coverage/${VERSION}"
.PHONY: xpi test testcoverage
xpi:
@echo "Building '${XPI}'..."
@mkdir -p build
@git archive --format=zip -o ${XPI} HEAD
test:
@ln -sfT `pwd`/test/ui ${OBJDIR}/_tests/testing/mochitest/browser/${TEST_PATH}
@make -C ${OBJDIR} mochitest-browser-chrome
testcoverage:
@ln -sfT `pwd`/test/ui ${OBJDIR}/_tests/testing/mochitest/browser/${TEST_PATH}
@mkdir -p ${COVERAGE_DIR}
-@COVERAGE=1 COVERAGE_OUTPUT="${COVERAGE_DIR}/coverage_raw.json" make -C ${OBJDIR} mochitest-browser-chrome
@python ${MOZILLA_SRC}/testing/tools/coverage/aggregate.py ${COVERAGE_DIR}/coverage_raw.json > ${COVERAGE_DIR}/coverage.json
@cd ${COVERAGE_DIR}; COVERAGE_VERSION=${VERSION} python ${MOZILLA_SRC}/testing/tools/coverage/report.py coverage.json
@echo "Test coverage report ready: ${COVERAGE_DIR}/index.html"