| OLD | NEW |
| 1 Hacking on Sky | 1 Hacking on Sky |
| 2 ============== | 2 ============== |
| 3 | 3 |
| 4 Building | 4 Building |
| 5 -------- | 5 -------- |
| 6 | 6 |
| 7 * Follow the setup & build instructions for [Mojo](https://github.com/domokit/mo
jo) | 7 * Follow the setup & build instructions for [Mojo](https://github.com/domokit/mo
jo) |
| 8 * Build ``sky`` with ``ninja``, e.g. ``ninja -C out/Debug sky`` | 8 * Build ``sky`` with ``ninja``, e.g. ``ninja -C out/Debug sky`` for a debug buil
d. |
| 9 |
| 10 If you want to build release, run the following commands: |
| 11 |
| 12 * ``gn gen out/Release --args="is_debug=false"`` |
| 13 * ``ninja -C out/Release sky`` |
| 9 | 14 |
| 10 Running applications | 15 Running applications |
| 11 -------------------- | 16 -------------------- |
| 12 | 17 |
| 13 * ``./sky/tools/skydb [url]`` | 18 * ``./sky/tools/skydb [url]`` |
| 14 * You should see a ``(skydb)`` prompt | 19 * You should see a ``(skydb)`` prompt |
| 15 * Type ``help`` to see the list of available commands | 20 * Type ``help`` to see the list of available commands |
| 21 * Note: skydb is currently hard-coded to use ``//out/Debug`` |
| 16 | 22 |
| 17 * ``./sky/tools/test_sky --debug`` | 23 * ``./sky/tools/test_sky --debug`` |
| 18 * This should run the tests | 24 * This runs the tests against ``//out/Debug``. If you want to run against |
| 25 ``//out/Release``, omit the ``--debug`` flag. |
| 19 | 26 |
| 20 Running tests manually | 27 Running tests manually |
| 21 ---------------------- | 28 ---------------------- |
| 22 | 29 |
| 23 * ``sky/tools/run_sky_httpd`` | 30 * ``sky/tools/run_sky_httpd`` |
| 24 * ``out/Debug/mojo_shell --args-for="mojo://native_viewport_service/ --use-headl
ess-config" --content-handlers=text/html,mojo://sky_viewer/ --url-mappings=mojo:
window_manager=mojo:sky_tester mojo:window_manager`` | 31 * ``out/Debug/mojo_shell --args-for="mojo://native_viewport_service/ --use-headl
ess-config" --content-handlers=text/html,mojo://sky_viewer/ --url-mappings=mojo:
window_manager=mojo:sky_tester mojo:window_manager`` |
| 25 * The ``sky_tester`` should print ``#READY`` when ready | 32 * The ``sky_tester`` should print ``#READY`` when ready |
| 26 * Type the URL you wish to run, for example ``http://127.0.0.1:8000/lowlevel/tex
t.html``, and press the enter key | 33 * Type the URL you wish to run, for example ``http://127.0.0.1:8000/lowlevel/tex
t.html``, and press the enter key |
| 27 * The harness should print the results of the test. You can then type another U
RL. | 34 * The harness should print the results of the test. You can then type another U
RL. |
| 28 | 35 |
| 29 Writing tests | 36 Writing tests |
| 30 ------------- | 37 ------------- |
| 31 | 38 |
| 32 * Import ``resources/mocha.html`` and ``resources/chai.html`` | 39 * Import ``resources/mocha.html`` and ``resources/chai.html`` |
| 33 * Write tests in [mocha format](http://visionmedia.github.io/mocha/#getting-star
ted) and use [chai asserts](http://chaijs.com/api/assert/): | 40 * Write tests in [mocha format](http://visionmedia.github.io/mocha/#getting-star
ted) and use [chai asserts](http://chaijs.com/api/assert/): |
| 34 ```html | 41 ```html |
| 35 describe('My pretty test of my subject', function() { | 42 describe('My pretty test of my subject', function() { |
| 36 var subject = new MySubject(); | 43 var subject = new MySubject(); |
| 37 | 44 |
| 38 it('should be pretty', function() { | 45 it('should be pretty', function() { |
| 39 assert.ok(subject.isPretty); | 46 assert.ok(subject.isPretty); |
| 40 }); | 47 }); |
| 41 }); | 48 }); |
| 42 ``` | 49 ``` |
| OLD | NEW |