diff --git a/.gitignore b/.gitignore index f3aa299c9..947d9af64 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ +build/ .idea/ -config.log +config.log \ No newline at end of file diff --git a/bin/createdoc.sh b/bin/createdoc.sh new file mode 100755 index 000000000..cb005fdd8 --- /dev/null +++ b/bin/createdoc.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +set -o nounset + +SCRIPTNAME=$(readlink -f $0) +DIR=$(dirname $SCRIPTNAME) + +for filepath in `find $DIR/../doc -type f -name "*.md"`; do + markdown $filepath > `dirname $filepath`/`basename $filepath .md`.html +done + +exit 0 diff --git a/test/js/.jshintignore b/test/js/.jshintignore new file mode 100644 index 000000000..c9b36835d --- /dev/null +++ b/test/js/.jshintignore @@ -0,0 +1 @@ +../../library/vendor/** diff --git a/test/js/.jshintrc b/test/js/.jshintrc new file mode 100644 index 000000000..756e43b8a --- /dev/null +++ b/test/js/.jshintrc @@ -0,0 +1,6 @@ +/* See http://www.jshint.com/docs/#usage on how to use this file */ + +{ + + +} diff --git a/test/js/checkswag.sh b/test/js/checkswag.sh new file mode 100755 index 000000000..df73f5a5a --- /dev/null +++ b/test/js/checkswag.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +set -o nounset + +SCRIPTNAME=$(readlink -f $0) +DIR=$(dirname $SCRIPTNAME) + +# Make sure that the destination directory for logs and reports exists +mkdir -p $DIR/../../build/log + +jshint --reporter=jslint "$@" $DIR/../.. > $DIR/../../build/log/jshint_results.xml + +exit 0 diff --git a/test/js/runtests.sh b/test/js/runtests.sh new file mode 100755 index 000000000..d0196b0a2 --- /dev/null +++ b/test/js/runtests.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +set -o nounset + +SCRIPTNAME=$(readlink -f $0) +DIR=$(dirname $SCRIPTNAME) + +# Make sure that the destination directory for logs and reports exists +mkdir -p $DIR/../../build/log + +mocha --reporter "xunit" --recursive "$@" . > $DIR/../../build/log/mocha_results.xml +mocha --reporter "cobertura" --recursive "$@" . > $DIR/../../build/log/mocha_coverage.xml + +exit 0 diff --git a/test/php/checkswag.sh b/test/php/checkswag.sh new file mode 100755 index 000000000..8d4850379 --- /dev/null +++ b/test/php/checkswag.sh @@ -0,0 +1,24 @@ +#!/bin/sh + +set -o nounset + +SCRIPTNAME=$(readlink -f $0) +DIR=$(dirname $SCRIPTNAME) +PHPCS=$(which phpcs) + +if [[ ! -x $PHPCS ]]; then + echo "PHPCS not found!" + exit 1 +fi + +# Make sure that the destination directory for logs and reports exists +mkdir -p $DIR/../../build/log + +phpcs -p --standard=PSR2 --extensions=php --encoding=utf-8 \ + --report-checkstyle=$DIR/../../build/log/phpcs_results.xml \ + "$@" \ + $DIR/../../application \ + $DIR/../../library/Icinga \ + $DIR/../../bin + +exit 0 diff --git a/test/php/phpunit.xml b/test/php/phpunit.xml new file mode 100644 index 000000000..d56bbb063 --- /dev/null +++ b/test/php/phpunit.xml @@ -0,0 +1,22 @@ + + + + + + + + + diff --git a/test/php/runtests.sh b/test/php/runtests.sh new file mode 100755 index 000000000..0caa34742 --- /dev/null +++ b/test/php/runtests.sh @@ -0,0 +1,21 @@ +#!/bin/sh + +set -o nounset + +SCRIPTNAME=$(readlink -f $0) +DIR=$(dirname $SCRIPTNAME) +PHPUNIT=$(which phpunit) + +if [[ ! -x $PHPUNIT ]]; then + echo "PHPUnit not found!" + exit 1 +fi + +# Make sure that the destination directory for logs and reports exists +mkdir -p $DIR/../../build/log + +cd $DIR + +$PHPUNIT "$@" . + +exit 0