michael@0: #!/bin/bash michael@0: # michael@0: # This Source Code Form is subject to the terms of the Mozilla Public michael@0: # License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: # file, You can obtain one at http://mozilla.org/MPL/2.0/. michael@0: michael@0: OS=`uname -s` michael@0: ARCH=`uname -p` michael@0: SCRIPT_DIR=`pwd` michael@0: DATE=`date +%Y%m%d` michael@0: michael@0: if [ $# -ne 1 ]; then michael@0: echo "Usage: $0 [securitytip|securityjes5]" michael@0: exit 1 michael@0: fi michael@0: michael@0: BRANCH="$1" michael@0: michael@0: if [ "${BRANCH}" != "securitytip" -a "${BRANCH}" != "securityjes5" ]; then michael@0: echo "Usage: $0 [securitytip|securityjes5]" michael@0: exit 1 michael@0: fi michael@0: michael@0: COV_DIR="/share/builds/mccrel3/security/coverage" michael@0: BRANCH_DIR="${COV_DIR}/${BRANCH}" michael@0: DATE_DIR="${BRANCH_DIR}/${DATE}-${ARCH}" michael@0: CVS_DIR="${DATE_DIR}/cvs_mozilla" michael@0: TCOV_DIR="${DATE_DIR}/tcov_mozilla" michael@0: michael@0: CVS_CHECKOUT_BRANCH="cvs_checkout_${BRANCH}" michael@0: michael@0: export HOST=`hostname` michael@0: export DOMSUF=red.iplanet.com michael@0: michael@0: export NSS_ECC_MORE_THAN_SUITE_B=1 michael@0: export IOPR_HOSTADDR_LIST="dochinups.red.iplanet.com" michael@0: export NSS_AIA_PATH="/share/builds/mccrel3/security/aia_certs" michael@0: export NSS_AIA_HTTP="http://cindercone.red.iplanet.com/share/builds/mccrel3/security/aia_certs" michael@0: michael@0: export USE_TCOV=1 michael@0: export SUN_PROFDATA_DIR="${DATE_DIR}" michael@0: export SUN_PROFDATA="tcov_data" michael@0: michael@0: if [ "${OS}" != "SunOS" ]; then michael@0: echo "OS not supported" michael@0: exit 1 michael@0: fi michael@0: michael@0: case "${ARCH}" in michael@0: "sparc") michael@0: export PATH="/usr/dist/share/sunstudio_sparc,v12.0/SUNWspro/prod/bin:/usr/sfw/bin:/usr/bin:/usr/ccs/bin:/usr/ucb:/tools/ns/bin:/usr/local/bin" michael@0: ;; michael@0: "i386") michael@0: export PATH="/usr/dist/share/sunstudio_i386,v12.0/SUNWspro/bin:/usr/sfw/bin:/usr/bin:/usr/ccs/bin:/usr/ucb:/tools/ns/bin:/usr/local/bin" michael@0: ;; michael@0: *) michael@0: echo "Platform not supported" michael@0: exit 1 michael@0: ;; michael@0: esac michael@0: michael@0: cvs_checkout_securitytip() michael@0: { michael@0: cvs -d :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot co -A mozilla/nsprpub michael@0: cvs -d :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot co -A mozilla/dbm michael@0: cvs -d :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot co -A mozilla/security/dbm michael@0: cvs -d :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot co -A mozilla/security/coreconf michael@0: cvs -d :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot co -A mozilla/security/nss michael@0: cvs -d :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot co -A mozilla/security/jss michael@0: cvs -d :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot co -A -r NSS_3_11_1_RTM mozilla/security/nss/lib/freebl/ecl/ecl-curve.h michael@0: } michael@0: michael@0: cvs_checkout_securityjes5() michael@0: { michael@0: cvs -d :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot co -A -r NSPR_4_6_BRANCH mozilla/nsprpub michael@0: cvs -d :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot co -A -r NSS_3_11_BRANCH mozilla/dbm michael@0: cvs -d :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot co -A -r NSS_3_11_BRANCH mozilla/security/dbm michael@0: cvs -d :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot co -A -r NSS_3_11_BRANCH mozilla/security/coreconf michael@0: cvs -d :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot co -A -r NSS_3_11_BRANCH mozilla/security/nss michael@0: cvs -d :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot co -A -r JSS_4_2_BRANCH mozilla/security/jss michael@0: cvs -d :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot co -A -r NSS_3_11_1_RTM mozilla/security/nss/lib/freebl/ecl/ecl-curve.h michael@0: } michael@0: michael@0: cvs_checkout() michael@0: { michael@0: rm -rf "${DATE_DIR}" michael@0: mkdir -p "${CVS_DIR}" michael@0: cd "${CVS_DIR}" michael@0: michael@0: ${CVS_CHECKOUT_BRANCH} michael@0: } michael@0: michael@0: run_build() michael@0: { michael@0: cd "${CVS_DIR}/mozilla/security/nss" michael@0: gmake nss_build_all michael@0: } michael@0: michael@0: run_tests() michael@0: { michael@0: cd "${CVS_DIR}/mozilla/security/nss/tests" michael@0: ./all.sh michael@0: } michael@0: michael@0: process_results() michael@0: { michael@0: rm -rf "${TCOV_DIR}" michael@0: mkdir -p "${TCOV_DIR}" michael@0: michael@0: cat "${SUN_PROFDATA_DIR}/${SUN_PROFDATA}/tcovd" | grep SRCFILE | grep "${CVS_DIR}/.*.c$" | sed "s:[^/]*\(.*\):\1:" | sort -u | michael@0: while read line michael@0: do michael@0: DIR=`echo "${line}" | sed "s:${CVS_DIR}/\(.*\)/.*:\1:"` michael@0: FILE=`echo "${line}" | sed "s:.*/\(.*\):\1:"` michael@0: michael@0: mkdir -p "${TCOV_DIR}/${DIR}" michael@0: tcov -o "${TCOV_DIR}/${DIR}/$FILE" -x "${SUN_PROFDATA}" $line >/dev/null 2>&1 michael@0: done michael@0: } michael@0: michael@0: cvs_checkout michael@0: run_build michael@0: run_tests michael@0: process_results michael@0: michael@0: cd "${SCRIPT_DIR}" michael@0: ./report.sh "${BRANCH}" "${DATE}" "${ARCH}" michael@0: michael@0: exit 0 michael@0: