README_DOM 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. Testing FCL DOM implementation with official test suite from w3.org
  2. -------------------------------------------------------------------
  3. *** IMPORTANT: READ CAREFULLY!
  4. IF YOU ARE ABOUT TO RUN THESE TESTS, CONSIDER DOING SO IN AN ENVIRONMENT
  5. THAT YOU MAY ALLOW TO BE TRASHED.
  6. As of writing this at 3 June 2008, FCL DOM memory model is
  7. not compatible - at all - with the way that w3.org tests use. In
  8. particular, tests acquire (and use) references to objects that DOM
  9. implementation frees. Therefore, running the tests WILL result in heap
  10. corruption, executing arbitrary code, and any other imaginable kind of
  11. disaster. Be warned.
  12. *** End of notice
  13. --------------------------------------------------------------------
  14. To test the FCL DOM implementation, follow these steps:
  15. 1) Checkout the DOM test suite from w3.org CVS repository. The project name is
  16. 2001/DOM-Test-Suite. Only 'tests' subdirectory is needed, everything else
  17. is irrelevant for our purposes.
  18. Use the following commands:
  19. CVSROOT=:pserver:[email protected]:/sources/public
  20. cvs login
  21. (enter the password anonymous when prompted)
  22. cvs checkout 2001/DOM-Test-Suite/tests
  23. 2) Compile the testgen utility. A simple
  24. fpc testgen.pp
  25. should do it.
  26. 3) Use testgen to convert DOM test suites into Pascal code. Specify path to the
  27. directory that contains 'alltests.xml' file, and the name of resulting FPC unit.
  28. Testgen expects the API description file 'api.xml' present in its directory.
  29. Successful conversion of the following test modules is possible:
  30. Level 1 Core (527 tests):
  31. testgen 2001/DOM-Test-Suite/tests/level1/core core1.pp
  32. Level 2 Core (282 tests):
  33. testgen 2001/DOM-Test-Suite/tests/level2/core core2.pp
  34. Level 3 Core (partial only, 131 out of 722 tests):
  35. testgen 2001/DOM-Test-Suite/tests/level3/core core3.pp
  36. In the examples above, output names (core1.pp, etc.) carry no defined meaning, you may
  37. use anything instead.
  38. Normally, tests that contain properties/methods unsupported by FCL DOM, or
  39. other elements not yet known to testgen, will be skipped. The conversion may be forced
  40. by using -f commandline switch, but in this case the resulting Pascal unit will likely
  41. fail to compile.
  42. 4) Now, pick up your preferred fpcunit test runner, include the generated units into
  43. its uses clause, and compile. During compilation, path to 'domunit.pp' should be added
  44. to the unit search paths.
  45. 5) During runtime, tests must be able to read test files which are located
  46. within CVS source tree ('files' subdirectory of each module directory).