Warning, /frameworks/kjs/tests/README is written in an unsupported language. File is not indexed.
0001 ========================================================================
0002 The KDE JavaScript Test Suite
0003 ========================================================================
0004
0005 This is a collection of JavaScript (aka ECMAScript) code snipplets
0006 used to test the KDE JavaScript library (dubbed kjs). Most of them
0007 once triggered a bug in the implementation of the
0008 interpreter. Although these bugs are probably fixed by now these
0009 tests can still be used for regression testing.
0010
0011 NOTE:
0012
0013 Don't confuse this code with the HTML bindings for the khtml
0014 widget. Those are implemented in a separate module residing in
0015 kdelibs/khtml/ecma. Test for those can be found elsewhere.
0016
0017 USAGE:
0018
0019 You can evaluate .js files with a binary called 'testkjs' as long as
0020 they contain pure ECMAScript code without any references to browser
0021 specific properties. To build 'testkjs' simply invoke 'make check'
0022 inside of the kdelibs/kjs source directory. Most tests rely on helper
0023 functions like shouldBe(). Those are collected in base.js and have to
0024 be evaluated before the actual test. testkjs accepts multiple input
0025 files in the command line. Therefore a typical test run might look
0026 like this:
0027
0028 testkjs base.js operators.js
0029
0030 For temporary debugging you may use the debug() function which prints
0031 its output to stderr.
0032
0033 NAMING CONVENTION:
0034
0035 *.js regular test
0036 j-*.js JavaScript/JScript extensions not covered by ECMA
0037 *-n.js code that is supposed to trigger a parse/compile error
0038
0039 FUTURE:
0040
0041 All tests could easily be run in a row by a script. If they all stick
0042 to a unified output format (e.g. via shouldBe()) all results can be
0043 parsed and analyzed automatically. Maybe to a summary HTML page. In
0044 case the test suite grows we would need to provide more info about
0045 each test. This could look like:
0046
0047 startTest("ECMA 15.4.2", "Testing the Array Constructor");
0048 // ...
0049 endTest();
0050
0051 PLEA:
0052
0053 In case you find any yet unknown bug please reduce it to a minimal test case
0054 either send it to me or add it to this repository yourself.
0055
0056
0057 Harri Porten <porten@kde.org>
0058
0059