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`` for a debug buil
d. | 8 * Build ``sky`` with ``ninja``, e.g. ``ninja -C out/Debug sky`` for a debug buil
d. |
9 | 9 |
10 If you want to build release, run the following commands: | 10 If you want to build release, run the following commands: |
(...skipping 10 matching lines...) Expand all Loading... |
21 * Note: skydb is currently hard-coded to use ``//out/Debug`` | 21 * Note: skydb is currently hard-coded to use ``//out/Debug`` |
22 | 22 |
23 * ``./sky/tools/test_sky --debug`` | 23 * ``./sky/tools/test_sky --debug`` |
24 * This runs the tests against ``//out/Debug``. If you want to run against | 24 * This runs the tests against ``//out/Debug``. If you want to run against |
25 ``//out/Release``, omit the ``--debug`` flag. | 25 ``//out/Release``, omit the ``--debug`` flag. |
26 | 26 |
27 Running tests manually | 27 Running tests manually |
28 ---------------------- | 28 ---------------------- |
29 | 29 |
30 * ``sky/tools/run_sky_httpd`` | 30 * ``sky/tools/run_sky_httpd`` |
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`` | 31 * ``out/Debug/mojo_shell --args-for="mojo:native_viewport_service/ --use-headles
s-config" --content-handlers=text/html,mojo:sky_viewer/ --url-mappings=mojo:wind
ow_manager=mojo:sky_tester mojo:window_manager`` |
32 * The ``sky_tester`` should print ``#READY`` when ready | 32 * The ``sky_tester`` should print ``#READY`` when ready |
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 | 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 |
34 * 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. |
35 | 35 |
36 Writing tests | 36 Writing tests |
37 ------------- | 37 ------------- |
38 | 38 |
39 * Import ``resources/mocha.html`` and ``resources/chai.html`` | 39 * Import ``resources/mocha.html`` and ``resources/chai.html`` |
40 * 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/): |
41 ```html | 41 ```html |
42 describe('My pretty test of my subject', function() { | 42 describe('My pretty test of my subject', function() { |
43 var subject = new MySubject(); | 43 var subject = new MySubject(); |
44 | 44 |
45 it('should be pretty', function() { | 45 it('should be pretty', function() { |
46 assert.ok(subject.isPretty); | 46 assert.ok(subject.isPretty); |
47 }); | 47 }); |
48 }); | 48 }); |
49 ``` | 49 ``` |
OLD | NEW |