Add grunt phpunit
which runs three tasks: phpunit, ajax tests, and phpunit as multisite.
You can also run `grunt phpunit:default`, `grunt phpunit:ajax`, and grunt `phpunit:multisite` separately. `grunt test` now runs the qunit task (both compiled and uncompiled scripts) and the phpunit tasks. props bpetty. fixes #25854, see #25781. git-svn-id: https://develop.svn.wordpress.org/trunk@26064 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
00dffd1bf8
commit
bab82b3b66
29
Gruntfile.js
29
Gruntfile.js
@ -66,7 +66,7 @@ module.exports = function(grunt) {
|
|||||||
dest: BUILD_DIR,
|
dest: BUILD_DIR,
|
||||||
src: []
|
src: []
|
||||||
},
|
},
|
||||||
'qunit-compiled': {
|
qunit: {
|
||||||
src: 'tests/qunit/index.html',
|
src: 'tests/qunit/index.html',
|
||||||
dest: 'tests/qunit/compiled.html',
|
dest: 'tests/qunit/compiled.html',
|
||||||
options: {
|
options: {
|
||||||
@ -159,6 +159,20 @@ module.exports = function(grunt) {
|
|||||||
qunit: {
|
qunit: {
|
||||||
files: ['tests/qunit/**/*.html']
|
files: ['tests/qunit/**/*.html']
|
||||||
},
|
},
|
||||||
|
phpunit: {
|
||||||
|
default: {
|
||||||
|
cmd: 'phpunit',
|
||||||
|
args: ['-c', 'phpunit.xml.dist']
|
||||||
|
},
|
||||||
|
ajax: {
|
||||||
|
cmd: 'phpunit',
|
||||||
|
args: ['-c', 'phpunit.xml.dist', '--group', 'ajax']
|
||||||
|
},
|
||||||
|
multisite: {
|
||||||
|
cmd: 'phpunit',
|
||||||
|
args: ['-c', 'tests/phpunit/multisite.xml']
|
||||||
|
}
|
||||||
|
},
|
||||||
uglify: {
|
uglify: {
|
||||||
core: {
|
core: {
|
||||||
expand: true,
|
expand: true,
|
||||||
@ -260,8 +274,17 @@ module.exports = function(grunt) {
|
|||||||
'uglify:tinymce', 'concat:tinymce', 'compress:tinymce', 'clean:tinymce']);
|
'uglify:tinymce', 'concat:tinymce', 'compress:tinymce', 'clean:tinymce']);
|
||||||
|
|
||||||
// Testing tasks.
|
// Testing tasks.
|
||||||
grunt.registerTask('test', ['qunit']);
|
grunt.registerMultiTask('phpunit', "Runs PHPUnit tests, including the ajax and multisite tests.", function() {
|
||||||
grunt.registerTask('test:compiled', ['build', 'clean:qunit', 'copy:qunit-compiled', 'qunit']);
|
grunt.util.spawn({
|
||||||
|
cmd: this.data.cmd,
|
||||||
|
args: this.data.args,
|
||||||
|
opts: {stdio: 'inherit'}
|
||||||
|
}, this.async());
|
||||||
|
});
|
||||||
|
|
||||||
|
grunt.registerTask('qunit:compiled', "Runs QUnit tests on compiled as well as uncompiled scripts.",
|
||||||
|
['build', 'copy:qunit', 'qunit', 'clean:qunit']);
|
||||||
|
grunt.registerTask('test', "Runs all QUnit and PHPUnit tasks.", ['qunit:compiled', 'phpunit']);
|
||||||
|
|
||||||
// Default task.
|
// Default task.
|
||||||
grunt.registerTask('default', ['build']);
|
grunt.registerTask('default', ['build']);
|
||||||
|
Loading…
Reference in New Issue
Block a user