Permalink
Browse files

merge master, fix conflicts

  • Loading branch information...
basecode committed Sep 26, 2012
2 parents e0930c0 + 6ab8aa0 commit 456c441dd098aa045ee44994966a3efa099dfe20
Showing with 1,324 additions and 2,651 deletions.
  1. +8 −0 CHANGELOG
  2. +1 −0 LICENSE
  3. +3 −0 Makefile
  4. +2 −1 README.md
  5. +104 −0 lib/jasmine-console/console-runner.js
  6. +492 −1 lib/jasmine-core/jasmine-html.js
  7. +82 −166 lib/jasmine-core/jasmine.css
  8. +290 −209 lib/jasmine-core/jasmine.js
  9. +1 −1 lib/jasmine-core/version.rb
  10. +0 −8 lib/requirejs/order.js
  11. +35 −2,053 lib/requirejs/require.js
  12. +5 −4 src/asset/asset_controller.js
  13. +4 −5 src/asset/asset_handler.js
  14. +3 −1 src/asset/raw_handler.js
  15. +6 −0 src/bootstrapper/player.js
  16. +6 −1 src/runner/animation/keyframe_animation.js
  17. +8 −1 src/runner/path/path.js
  18. +2 −2 src/runner/stage.js
  19. +1 −1 src/runner/text_span.js
  20. +0 −13 test/COVERAGE.txt
  21. +2 −3 test/animation/animation-spec.js
  22. +2 −3 test/animation/keyframe_animation-spec.js
  23. +23 −4 test/asset-loading-spec.js
  24. +2 −3 test/asset-request-spec.js
  25. +2 −3 test/asset-resource-spec.js
  26. +2 −3 test/asset_display_object-spec.js
  27. +2 −3 test/asset_handler-spec.js
  28. +2 −3 test/bitmap-spec.js
  29. +1 −4 test/build-spec.js
  30. +2 −3 test/color-spec.js
  31. +1 −3 test/compare-spec.js
  32. +2 −3 test/curved_path-spec.js
  33. +2 −3 test/display_list-spec.js
  34. +2 −3 test/display_object-spec.js
  35. +2 −3 test/doc/cheatsheet/sheet-spec.js
  36. +2 −3 test/dom_element-spec.js
  37. +2 −3 test/event_emitter-spec.js
  38. +2 −3 test/filter/base_filter-spec.js
  39. +2 −3 test/filter/builtin-spec.js
  40. +2 −3 test/font_family-spec.js
  41. +2 −3 test/gradient-spec.js
  42. +2 −3 test/group-spec.js
  43. +2 −3 test/matrix-spec.js
  44. +2 −3 test/movie-spec.js
  45. +2 −3 test/path/arc-spec.js
  46. +2 −3 test/path/circle-spec.js
  47. +2 −3 test/path/ellipse-spec.js
  48. +2 −3 test/path/path-spec.js
  49. +2 −3 test/path/polygon-spec.js
  50. +2 −3 test/path/rect-spec.js
  51. +2 −3 test/path/star-spec.js
  52. +57 −0 test/phantom-runner-jasmine.js
  53. +28 −3 test/player-spec.js
  54. +2 −3 test/point-spec.js
  55. +2 −3 test/renderer/svg-spec.js
  56. +2 −3 test/renderer/svg_filters-spec.js
  57. +2 −3 test/renderer/svg_helper-spec.js
  58. +2 −3 test/renderer/svg_renderer_svg-spec.js
  59. +2 −3 test/renderer_controller-spec.js
  60. +12 −8 test/runner-build.html
  61. +12 −9 test/runner-compare.html
  62. +17 −5 test/runner-qc.html
  63. +15 −6 test/runner.html
  64. +17 −16 test/runner.js
  65. +2 −3 test/segment_helper-spec.js
  66. +2 −3 test/stage-spec.js
  67. +6 −3 test/text-spec.js
  68. +2 −3 test/timeline-spec.js
  69. +2 −3 test/tools-spec.js
  70. +2 −3 test/ui_event-spec.js
  71. +2 −3 test/uri-spec.js
  72. +2 −3 test/video-spec.js
View
@@ -5,6 +5,14 @@ v0.3.7
* Make the default textOrigin in the Text class 'top'
* Cleanup KeyframeAnimation and remove setSubject(s) methods
to bring inline with current Animation class
+* Fix internal asset messaging so that assetData (loadData) is
+ correctly sent to the runner (AssetLoader)
+* Add missing `delay` option to KeyframeAnimation
+* Fix issue where TextSpan child default strokeWidth took
+ precedence over parent (Text instance) strokeWidth
+* Add the ability to execute tests via commandline: `make test-phantom`
+* Allow to pass a function within `code` in `bonsai.run`
+* Make `player.Renderer` configurable via `player.setup()`
* Add `Audio` a new DisplayObject including new API
* Add `drawAudio` method and according tests in renderer
* Add `AudioHandler` a new AssetHandler for Audio resources
View
@@ -25,6 +25,7 @@ External libraries (each with their own license):
- requirejs: https://github.com/jrburke/requirejs/blob/master/LICENSE
- jasmine: https://github.com/pivotal/jasmine/blob/master/MIT.LICENSE
+ - phantom-jasmine: Apache 2 - https://github.com/jcarver989/phantom-jasmine/issues/8
- closure: http://code.google.com/p/closure-compiler/source/browse/trunk/COPYING
- qc.js: https://github.com/darrint/qc.js/blob/master/COPYING
View
@@ -86,6 +86,9 @@ test: mktemp
phantomjs --load-plugins=yes ${CI_TOOLS_DIR}/script/phantom_runner.js ${BASE_URL}/${TEST_RUNNER_COMPARE} ${TEMP_DIR} 0 jasmine
phantomjs --load-plugins=yes ${CI_TOOLS_DIR}/script/phantom_runner.js ${BASE_URL}/${TEST_RUNNER_QC} ${TEMP_DIR} 0 qc
+test-phantom: mktemp
+ phantomjs test/phantom-runner-jasmine.js test/runner.html
+
syntux-diff: mktemp
${CI_TOOLS_DIR}/bin/syntux_diff.sh ${WORKSPACE}/src ${TEMP_DIR}
View
@@ -49,4 +49,5 @@ r.animate('400ms', {
});
```
-See more here: [Bonsai Documentation/Overviews](http://docs.bonsaijs.org).
+See more here: [Bonsai Documentation/Overviews](http://docs.bonsaijs.org) or
+join the IRC channel [#bonsaijs on freenode](http://webchat.freenode.net/?channels=bonsaijs) and ask for help.
@@ -0,0 +1,104 @@
+/**
+ Jasmine Reporter that outputs test results to the browser console.
+ Useful for running in a headless environment such as PhantomJs, ZombieJs etc.
+
+ Usage:
+ // From your html file that loads jasmine:
+ jasmine.getEnv().addReporter(new jasmine.ConsoleReporter());
+ jasmine.getEnv().execute();
+*/
+
+(function(jasmine, console) {
+ if (!jasmine) {
+ throw "jasmine library isn't loaded!";
+ }
+
+ var ANSI = {}
+ ANSI.color_map = {
+ "green" : 32,
+ "red" : 31
+ }
+
+ ANSI.colorize_text = function(text, color) {
+ var color_code = this.color_map[color];
+ return "\033[" + color_code + "m" + text + "\033[0m";
+ }
+
+ var ConsoleReporter = function() {
+ if (!console || !console.log) { throw "console isn't present!"; }
+ this.status = this.statuses.stopped;
+ };
+
+ var proto = ConsoleReporter.prototype;
+ proto.statuses = {
+ stopped : "stopped",
+ running : "running",
+ fail : "fail",
+ success : "success"
+ };
+
+ proto.reportRunnerStarting = function(runner) {
+ this.status = this.statuses.running;
+ this.start_time = (new Date()).getTime();
+ this.executed_specs = 0;
+ this.passed_specs = 0;
+ this.log("Starting...");
+ };
+
+ proto.reportRunnerResults = function(runner) {
+ var failed = this.executed_specs - this.passed_specs;
+ var spec_str = this.executed_specs + (this.executed_specs === 1 ? " spec, " : " specs, ");
+ var fail_str = failed + (failed === 1 ? " failure in " : " failures in ");
+ var color = (failed > 0)? "red" : "green";
+ var dur = (new Date()).getTime() - this.start_time;
+
+ this.log("");
+ this.log("Finished");
+ this.log("-----------------");
+ this.log(spec_str + fail_str + (dur/1000) + "s.", color);
+
+ this.status = (failed > 0)? this.statuses.fail : this.statuses.success;
+
+ /* Print something that signals that testing is over so that headless browsers
+ like PhantomJs know when to terminate. */
+ this.log("");
+ this.log("ConsoleReporter finished");
+ };
+
+
+ proto.reportSpecStarting = function(spec) {
+ this.executed_specs++;
+ };
+
+ proto.reportSpecResults = function(spec) {
+ if (spec.results().passed()) {
+ this.passed_specs++;
+ return;
+ }
+
+ var resultText = spec.suite.description + " : " + spec.description;
+ this.log(resultText, "red");
+
+ var items = spec.results().getItems()
+ for (var i = 0; i < items.length; i++) {
+ var trace = items[i].trace.stack || items[i].trace;
+ this.log(trace, "red");
+ }
+ };
+
+ proto.reportSuiteResults = function(suite) {
+ if (!suite.parentSuite) { return; }
+ var results = suite.results();
+ var failed = results.totalCount - results.passedCount;
+ var color = (failed > 0)? "red" : "green";
+ this.log(suite.description + ": " + results.passedCount + " of " + results.totalCount + " passed.", color);
+ };
+
+ proto.log = function(str, color) {
+ var text = (color != undefined)? ANSI.colorize_text(str, color) : str;
+ console.log(text)
+ };
+
+ jasmine.ConsoleReporter = ConsoleReporter;
+})(jasmine, console);
+
Oops, something went wrong.

0 comments on commit 456c441

Please sign in to comment.