-
Notifications
You must be signed in to change notification settings - Fork 438
Test Guidelines
Depend on the purpose of the test case (whether it's a positive or negative one), place it under test/run_pass
or test/run_fail
directory. The required external resources should be placed into test/resources
.
All test case files must be named in the following form test_<module name>[_<functionallity].js
where <module name>
should match one of the JS modules name in the IoT.js. If there is a test case which can not tied to a
module (like some js features) then the iotjs
name can be used as module name. It is important to
correctly specify the module name as the test executor relies on that information.
- Write a test case and place it into the proper directory.
- List up the test case in test/testsets.json, and set attributes (timeout, skip, ...) on the test case if it needs.
When you build iotjs
binary successfully, you can run test driver with this binary.
/path/to/iotjs tools/check_test.js
Some basic options are provided.
Existing test options are listed as follows;
start-from
quiet=yes|no (default is yes)
output-file
skip-module
output-coverage=yes|no (default is no)
experimental=yes|no (default is no)
To give options, please use two dashes '--' once before the option name as described in the following sections.
Options that may need explanations.
- start-from: a test case file name where the driver starts.
- quiet: a flag that indicates if the driver suppresses console outputs of test case.
- output-file: a file name where the driver leaves output.
- skip-module: a module list to skip test of specific modules.
- output-coverage: a flag that indicates wether coverage data should be written to disk
- experimental: a flag that indicates if tests for experimental are needed
build/x86_64-linux/debug/bin/iotjs tools/check_test.js -- start-from=test_console.js quiet=no