diff --git a/.gitignore b/.gitignore index 523980b77..29e9cc9ce 100644 --- a/.gitignore +++ b/.gitignore @@ -3,9 +3,9 @@ # But not .gitignore and .vagrant-puppet !.gitignore !.vagrant-puppet -# Build artefacts + build/ -# Dev environmental -.idea/ -# Configure output -config.log \ No newline at end of file +test/js/npm-debug.log + +# ./configure output +config.log diff --git a/test/javascript/.PLACEHOLDER b/test/javascript/.PLACEHOLDER deleted file mode 100644 index e69de29bb..000000000 diff --git a/test/js/regression/bug.4102.js b/test/js/regression/bug.4102.js new file mode 100644 index 000000000..9344c341a --- /dev/null +++ b/test/js/regression/bug.4102.js @@ -0,0 +1,11 @@ +describe('regression test for bug #4102', function(){ + it('Object.create', function(){ + Object.create.should.be.a('function'); + + var t = { + name: 'test123' + }; + + t.should.have.property('name').and.equal('test123'); + }); +}); diff --git a/test/js/runtests.sh b/test/js/runtests.sh index d0196b0a2..496a9eab7 100755 --- a/test/js/runtests.sh +++ b/test/js/runtests.sh @@ -4,11 +4,23 @@ set -o nounset SCRIPTNAME=$(readlink -f $0) DIR=$(dirname $SCRIPTNAME) +MOCHA=$(which mocha) +DEFAULT="--recursive --require should" + +if [[ ! -x $MOCHA ]]; then + echo "mocha not found!"; + exit 1 +fi # 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 +cd $DIR -exit 0 +# Don't know where node modules are +export NODE_PATH=.:/usr/local/lib/node_modules:/usr/lib/node_modules + +$MOCHA --reporter "xunit" $DEFAULT "$@" . > $DIR/../../build/log/mocha_results.xml +$MOCHA --reporter "mocha-cobertura-reporter" $DEFAULT "$@" . > $DIR/../../build/log/mocha_coverage.xml + +exit 0 \ No newline at end of file diff --git a/test/php/phpunit.xml b/test/php/phpunit.xml index d56bbb063..f685c4ff0 100644 --- a/test/php/phpunit.xml +++ b/test/php/phpunit.xml @@ -1,3 +1,4 @@ + - - - - + + + + - + + + + application/ + bin/ + library/ + + + + regression/ + + + \ No newline at end of file diff --git a/test/php/regression/Bug4102Test.php b/test/php/regression/Bug4102Test.php new file mode 100644 index 000000000..dd232ac73 --- /dev/null +++ b/test/php/regression/Bug4102Test.php @@ -0,0 +1,44 @@ +assertContains('Bug4102Test', $class); + } + + /** + * Test namespace to match definition + */ + public function testNamespace() + { + $namespace = __NAMESPACE__; + $this->assertEquals('Tests\Icinga\Regression', $namespace); + } + + /** + * Test phpunit inheritance + */ + public function testInheritance() + { + $this->assertInstanceOf('\PHPUnit_Framework_TestCase', $this); + } +} diff --git a/test/php/runtests.sh b/test/php/runtests.sh index 0caa34742..7c07792ee 100755 --- a/test/php/runtests.sh +++ b/test/php/runtests.sh @@ -16,6 +16,6 @@ mkdir -p $DIR/../../build/log cd $DIR -$PHPUNIT "$@" . +$PHPUNIT "$@" exit 0