1 ========================================================================
2 The KDE JavaScript Test Suite
3 ========================================================================
5 This is a collection of JavaScript (aka ECMAScript) code snipplets
6 used to test the KDE JavaScript library (dubbed kjs). Most of them
7 once triggered a bug in the implementation of the
8 interpreter. Allthough these bugs are probably fixed by now theses
9 tests can still be used for regression testing.
13 Don't confuse this code with the HTML bindings for the khtml
14 widget. Those are implemented in a seperate module residing in
15 kdelibs/khtml/ecma. Test for those can be found elsewhere.
19 You can evaluate .js files with a binary called 'testkjs' as long as
20 they contain pure ECMAScript code without any references to browser
21 specific properties. To build 'testkjs' simply invoke 'make check'
22 inside of the kdelibs/kjs source directory. Most tests rely on helper
23 functions like shouldBe(). Those are collected in base.js and have to
24 be evaluated before the actual test. testkjs accepts multiple input
25 files in the command line. Therefore a typical test run might look
28 testkjs base.js operators.js
30 For temporary debugging you may use the debug() function which prints
36 j-*.js JavaScript/JScript extensions not covered by ECMA
37 *-n.js code that is supposed to trigger a parse/compile error
41 All tests could easily be run in a row by a script. If they all stick
42 to a unified output format (e.g. via shouldBe()) all results can be
43 parsed and analyzed automatically. Maybe to a summary HTML page. In
44 case the test suite grows we would need to provide more info about
45 each test. This could look like:
47 startTest("ECMA 15.4.2", "Testing the Array Constructor");
53 In case you find any yet unknown bug please reduce it to a minimal test case
54 either send it to me or add it to this repository yourself.
57 Harri Porten <porten@kde.org>