Bug 1145636 - Update jsapi-tests/README. (The functional change is where it talks about the Makefile; that was stale.) r=Waldo.

--HG--
extra : rebase_source : 6fc28f096b4dead733e8fe5ab18530e23b2108e6
extra : source : 0a00470fdc2ac488d917602d5969a54ca87b8014
This commit is contained in:
Jason Orendorff 2014-10-31 16:58:18 -05:00
Родитель e55a1c46a2
Коммит 836fc77c87
1 изменённых файлов: 9 добавлений и 7 удалений

Просмотреть файл

@ -1,9 +1,9 @@
=== JSAPI Test Suite # JSAPI Test Suite
The tests in this directory exercise the JSAPI. The tests in this directory exercise the JSAPI.
--- Building and running the tests ## Building and running the tests
If you built JS, you already built the tests. If you built JS, you already built the tests.
@ -20,16 +20,18 @@ To run the tests in a debugger:
cd $OBJDIR/dist/bin cd $OBJDIR/dist/bin
gdb ./jsapi-tests gdb ./jsapi-tests
--- Creating new tests
## Creating new tests
1. You can either add to an existing test*.cpp file or make a new one. 1. You can either add to an existing test*.cpp file or make a new one.
Copy an existing test and replace the body with your test code. Copy an existing test and replace the body with your test code.
The test harness provides `cx`, `rt`, and `global` for your use. The test harness provides `cx`, `rt`, and `global` for your use.
2. If you made a new .cpp file, add it to the CPPSRCS list in Makefile.in. 2. If you made a new .cpp file, add it to the UNIFIED_SOURCES list
in moz.build.
--- Writing test code ## Writing test code
Here is a sample test: Here is a sample test:
@ -135,7 +137,7 @@ tests.h:
Otherwise SameValue(a, b) iff a === b. Otherwise SameValue(a, b) iff a === b.
--- Custom test setup ## Custom test setup
Before executing each test, the test framework calls the tests' init() member Before executing each test, the test framework calls the tests' init() member
function, which populates the rt, cx, and global member variables. function, which populates the rt, cx, and global member variables.