From 836fc77c873923f7d3d0322d2e818cb64caf31f9 Mon Sep 17 00:00:00 2001 From: Jason Orendorff Date: Fri, 31 Oct 2014 16:58:18 -0500 Subject: [PATCH] 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 --- js/src/jsapi-tests/README | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/js/src/jsapi-tests/README b/js/src/jsapi-tests/README index e25174374359..06b3fb2b45c7 100644 --- a/js/src/jsapi-tests/README +++ b/js/src/jsapi-tests/README @@ -1,9 +1,9 @@ -=== JSAPI Test Suite +# JSAPI Test Suite 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. @@ -20,16 +20,18 @@ To run the tests in a debugger: cd $OBJDIR/dist/bin gdb ./jsapi-tests ---- Creating new tests - 1. You can either add to an existing test*.cpp file or make a new one. +## Creating new tests + +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. 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: @@ -135,7 +137,7 @@ tests.h: 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 function, which populates the rt, cx, and global member variables.