diff options
Diffstat (limited to 'tests/coverage')
-rw-r--r-- | tests/coverage/README | 14 | ||||
-rwxr-xr-x | tests/coverage/instrument.sh | 62 |
2 files changed, 0 insertions, 76 deletions
diff --git a/tests/coverage/README b/tests/coverage/README deleted file mode 100644 index 36abe184..00000000 --- a/tests/coverage/README +++ /dev/null @@ -1,14 +0,0 @@ -Used to produce coverage reports from the automated tests -via jscoverage (http://siliconforks.com/jscoverage/). - -You'll need to install jscoverage first. -You'll also need Google Chrome. - -Then: - -$ cd tests/test-coverage -$ ./instrument.sh - -See the Summary tab for the coverage report. - -This is only tested on Linux. diff --git a/tests/coverage/instrument.sh b/tests/coverage/instrument.sh deleted file mode 100755 index e716ecad..00000000 --- a/tests/coverage/instrument.sh +++ /dev/null @@ -1,62 +0,0 @@ -#!/bin/bash -# Run instrumented unit tests -# -# set CHROME_BIN to the path to/name of your Google Chrome binary -# (default = `which google-chrome`) -# set JS_COVERAGE_BIN to the path to/name of your jscoverage binary -# (default = `which jscoverage`) - -# where are we? -SCRIPT_PATH=`readlink -f $0` - -if [[ "x" == "x$SCRIPT_PATH" ]] ; then - DIR=`dirname $0` -else - DIR=`dirname $SCRIPT_PATH` -fi - -# programs we need to run -if [[ "x" == "x$CHROME_BIN" ]] ; then - CHROME_BIN=`which google-chrome || which chromium-browser` -fi - -if [[ "x$CHROME_BIN" == "x" ]] ; then - echo "*** ERROR: google-chrome not found - please make sure it's installed" - echo "Then either put it on your PATH or set the CHROME_BIN env variable" - exit 1 -fi - -if [[ "x" == "x$JSCOVERAGE_BIN" ]] ; then - JSCOVERAGE_BIN=`which jscoverage` -fi - -if [[ "x$JSCOVERAGE_BIN" == "x" ]] ; then - echo "*** ERROR: jscoverage not found - please make sure it's installed" - echo "Then either put it on your PATH or set the JSCOVERAGE_BIN env variable" - exit 1 -fi - -# directory for instrumented files -if [ -d $DIR/instrumented ] ; then - rm -Rf $DIR/instrumented -fi - -# just instrument the tizen-web-ui-fw file -$JSCOVERAGE_BIN --exclude tizen-web-ui-fw-libs.js --exclude jquery.js \ - $DIR/../../build/tizen-web-ui-fw/latest/js $DIR/instrumented - -# copy all the unit tests to the instrumented directory -cp -a $DIR/../unit-tests/* $DIR/instrumented/ - -# edit links in all index.html test files -for file in `find $DIR/instrumented/ -name index.html` ; do - # refer to the instrumented tizen-web-ui-fw JS file - sed -i -e 's%\.\.\/\.\.\/\.\.\/build\/tizen-web-ui-fw\/latest\/js\/tizen-web-ui-fw\.js%\.\.\/tizen-web-ui-fw\.js%' $file - - # other files are just one directory further up - sed -i -e 's%\.\.\/\.\.\/build%\.\.\/\.\.\/\.\.\/build%' $file - sed -i -e 's%\.\.\/\.\.\/\libs%\.\.\/\.\.\/\.\.\/libs%' $file -done - -# run the top-level test file through jscoverage -$CHROME_BIN --allow-file-access-from-files file://$DIR/instrumented/jscoverage.html?index.html |