summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Gruntfile.js15
-rw-r--r--README.markdown2
-rw-r--r--Rakefile9
3 files changed, 16 insertions, 10 deletions
diff --git a/Gruntfile.js b/Gruntfile.js
index bfcc020..0e56e00 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -1,3 +1,5 @@
+var childProcess = require('child_process');
+
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
@@ -68,11 +70,22 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-uglify');
+
grunt.registerTask('dist-dir', function() {
grunt.file.delete('dist');
grunt.file.mkdir('dist');
});
+ grunt.registerTask('test', function() {
+ var done = this.async();
+ var runner = childProcess.fork('./spec/env/runner', [], {stdio: 'inherit'});
+ runner.on('close', function(code) {
+ if (code != 0) {
+ grunt.fatal(code + ' tests failed');
+ }
+ done();
+ });
+ });
- grunt.registerTask('default', ['dist-dir', 'concat', 'uglify']);
+ grunt.registerTask('default', ['jshint', 'dist-dir', 'concat', 'uglify', 'test']);
};
diff --git a/README.markdown b/README.markdown
index a56278e..2ea39a8 100644
--- a/README.markdown
+++ b/README.markdown
@@ -402,7 +402,7 @@ if you've got bundler installed.
To build Handlebars.js from scratch, you'll want to run `rake build`
in the root of the project. That will build Handlebars and output the
-results to the dist/ folder. To run tests, run `rake spec` or `npm test`.
+results to the dist/ folder. To run tests, run `grunt test` or `npm test`.
You can also run our set of benchmarks with `rake bench`.
If you notice any problems, please report them to the GitHub issue tracker at
diff --git a/Rakefile b/Rakefile
index 731d53b..21a4cc8 100644
--- a/Rakefile
+++ b/Rakefile
@@ -26,13 +26,7 @@ end
task :compile => "lib/handlebars/compiler/parser.js"
-desc "run the spec suite"
-task :spec => [:build] do
- rc = system "npm test"
- fail "npm test failed with exit code #{$?.exitstatus}" if (rc.nil? || ! rc || $?.exitstatus != 0)
-end
-
-task :default => [:compile, :spec]
+task :default => [:build]
task :build => [:compile] do |task|
system "grunt"
@@ -65,7 +59,6 @@ task :version, [:version] => [] do |task, args|
end
Rake::Task[:build].invoke
- Rake::Task[:spec].invoke
# TODO : Make sure that all of these files are updated properly in git then run npm version
end