Make WordPress Core

Changeset 26064


Ignore:
Timestamp:
11/09/2013 09:18:23 PM (11 years ago)
Author:
nacin
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Gruntfile.js

    r26063 r26064  
    6767                src: []
    6868            },
    69             'qunit-compiled': {
     69            qunit: {
    7070                src: 'tests/qunit/index.html',
    7171                dest: 'tests/qunit/compiled.html',
     
    160160            files: ['tests/qunit/**/*.html']
    161161        },
     162        phpunit: {
     163            default: {
     164                cmd: 'phpunit',
     165                args: ['-c', 'phpunit.xml.dist']
     166            },
     167            ajax: {
     168                cmd: 'phpunit',
     169                args: ['-c', 'phpunit.xml.dist', '--group', 'ajax']
     170            },
     171            multisite: {
     172                cmd: 'phpunit',
     173                args: ['-c', 'tests/phpunit/multisite.xml']
     174            }
     175        },
    162176        uglify: {
    163177            core: {
     
    261275
    262276    // Testing tasks.
    263     grunt.registerTask('test', ['qunit']);
    264     grunt.registerTask('test:compiled', ['build', 'clean:qunit', 'copy:qunit-compiled', 'qunit']);
     277    grunt.registerMultiTask('phpunit', "Runs PHPUnit tests, including the ajax and multisite tests.", function() {
     278        grunt.util.spawn({
     279            cmd: this.data.cmd,
     280            args: this.data.args,
     281            opts: {stdio: 'inherit'}
     282        }, this.async());
     283    });
     284
     285    grunt.registerTask('qunit:compiled', "Runs QUnit tests on compiled as well as uncompiled scripts.",
     286        ['build', 'copy:qunit', 'qunit', 'clean:qunit']);
     287    grunt.registerTask('test', "Runs all QUnit and PHPUnit tasks.", ['qunit:compiled', 'phpunit']);
    265288
    266289    // Default task.
Note: See TracChangeset for help on using the changeset viewer.