readme.txt 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. Directories
  2. -----------
  3. webtbs...........Tests for web-bug-database bugs (success in compilation)
  4. Digits in filename refer to bug database entry
  5. webtbf...........Tests for web-bug-database bugs (fail compile)
  6. Digits in filename refer to bug database entry
  7. test.............Testsuites for different aspects of the compiler/rtl etc
  8. tbs..............Tests for other bugs, added by the fpc core team
  9. (success in compilation) Digits in filename is a serial no
  10. tbf..............Tests for other bugs, added by the fpc core team
  11. (fail compile) Digits in filename is a serial no
  12. units............Helper units for doing the tests
  13. utils............Utilities for processing tests
  14. Writing a test
  15. --------------
  16. A test should have a name on the form t*.pp, to be recognized as a test.
  17. It should return 0 on success, any other value indicate failure.
  18. Test directives
  19. ---------------
  20. At the top of the test source code, some directives
  21. can be used to determine how the tests will be
  22. processed (if processed automatically via make),
  23. e. g. {%CPU=i386} :
  24. OPT................Compiler option required to compile
  25. CPU................Only for these CPU's (i386,m68k,etc). Might be a list.
  26. SKIPCPU............Not for these CPU's (i386,m68k,etc). Might be a list.
  27. TARGET.............Only for these OS targets (win32,macos,etc).
  28. Might be a list.
  29. SKIPTARGET.........Not for these OS targets (win32,macos,etc).
  30. Might be a list.
  31. VERSION............Compiler with at lest this version number required.
  32. MAXVERSION.........Compiler with at most this version number required.
  33. RESULT.............Exit code of execution of test expected
  34. GRAPH..............Requires graph unit
  35. FAIL...............Compilation must fail
  36. RECOMPILE..........After compiling a test, recompile the test for a second
  37. time. This is needed to test ppu loading issues.
  38. NORUN..............Do not execute test, only compile it
  39. INTERACTIVE........Do not execute test, as it requires user intervention
  40. NOTE...............Output note when compiling/executing test
  41. NEEDLIBRARY........Adds -rpath to the linker for unix. This is needed to
  42. test runtime library tests. The library needs the -FE.
  43. option to place the .so in the correct directory.
  44. KNOWNRUNERROR......Known bug, which manifest itself at runtime. To the
  45. right of the equal sign is the expected exit code,
  46. followed by an optional note. Will not be logged
  47. as a bug.
  48. KNOWNCOMPILEERROR..Known bug, which manifest itself at compile time. To
  49. the right of the equal sign is the expected exit code
  50. from compiler, followed by an optional note. Will not
  51. be logged as a bug.
  52. NOTE: A list consists of comma separated items, e. g. CPU=i386,m68k,linux
  53. No space between the elements and the comma.
  54. Usage
  55. -----
  56. To actually start the testsuite:
  57. do a simple
  58. make full This should create a log of all failed tests.
  59. make rundigest scans the created log file and outputs some statistics
  60. make rundigest USESQL=YES sends the results to an SQL database
  61. When the tests are performed, first the units (e g rtl) needed by the tests
  62. are compiled in a clean determined way and put in the units directory. Then
  63. webtbs/webtbf/test/tbs/tbf are searched for t*.pp to be compiled
  64. and executed as tests.
  65. Controling testing in more detail
  66. ---------------------------------
  67. Calling "make full" will preform tests in a standard manner. To have
  68. more control of the test process we must differentiate between:
  69. * Driver enviroment: compiler/rtl etc to be used by the tools which
  70. runs and analyze the tests. All normal options to make, like FPC
  71. OS_TARGET, OPT etc controls this.
  72. * Test environment: compiler/rtl etc to be tested, to be used
  73. *in* the tests. Ususal options, prepended with TEST_ , controls
  74. this. If no such options are given, test and driver environment
  75. will be the same.
  76. This differentiation also enables cross testing.
  77. The following test options can be given:
  78. TEST_FPC defaults to FPC
  79. TEST_OS_TARGET defaults to default target of TEST_FPC
  80. TEST_CPU_TARGET defaults to default target of TEST_FPC
  81. TEST_OPT defaults to ""
  82. TEST_FPC_VERSION defaults to version of TEST_FPC
  83. TEST_CCOMPILER defaults to installed gcc compiler, but only
  84. if driver and test full-targets are the same.
  85. TEST_VERBOSE let dotest be more verbose, only usefull for debugging
  86. TEST_DELTEMP delete temporary executable/object/ppu file, default is off
  87. (Please add more test options if needed)
  88. NOTE To clean after a test session, "make clean" must be given the same
  89. options as when running the tests.
  90. The utils directory is considerd to belong to the driver environment,
  91. all other directories belongs to the test environment.
  92. Remote execution
  93. ----------------
  94. Also remote execution of the testsuite is possible
  95. Requirements:
  96. - rsh/ssh must work without keyboard interaction or extra parameters
  97. Test options:
  98. TEST_RSH set this to the hostname when you want to use rsh/rcp
  99. to execute/copy the test
  100. TEST_SSH set this to use ssh/scp to execute the test
  101. TEST_PUTTY test using putty when remote testing (pscp and plink)
  102. TEST_REMOTEOPT extra options to remote program
  103. TEST_REMOTEPATH set remote path to use, default is /tmp
  104. TEST_DELTEMP delete executable after running, so the remote system
  105. doesn't need much free disk space
  106. TEST_REMOTEPW pass a password with -pw to remote tools, mainly usefull for putty
  107. Example:
  108. -------
  109. make TEST_FPC=$HOME/fpc/compiler/ppcsparc TEST_BINUTILSPREFIX=sparc-linux- \
  110. TEST_RSH=sunny TEST_REMOTEPATH=/tmp/tests
  111. make TEST_FPC=$HOME/fpc/compiler/ppcsparc TEST_BINUTILSPREFIX=sparc-linux- \
  112. TEST_SSH=fpc@sunny TEST_REMOTEPATH=/tmp/tests
  113. Example for win32/putty:
  114. make TEST_FPC=c:\fpc\compiler\ppcarm TEST_BINUTILSPREFIX=arm-linux- \
  115. [email protected] TEST_REMOTEPATH=/tmp TEST_DELTEMP=1 \
  116. "TEST_REMOTEPW=xxx" FPC=c:\fpc\compiler\ppc386
  117. Emulator execution
  118. ------------------
  119. Emulator execution is possible as well. It can't be combined with remote execution though.
  120. EMULATOR name of the emulator to use
  121. Example:
  122. make TEST_FPC=~/fpc/compiler/ppcrossarm TEST_OPT=-XParm-linux- EMULATOR=qemu-arm
  123. make TEST_FPC=~/fpc/compiler/ppcrossarm TEST_OPT=-XParm-linux- EMULATOR=qemu-arm \
  124. digest DBDIGESTOPT="-C qemu-arm" USESQL=YES
  125. Example cross testing of target MacOS with driver Darwin
  126. --------------------------------------------------------
  127. NOTE Today it is possible to run the test suite MacOS native.
  128. A machine with both MacOS X and classic MacOS installed. Note that make will not
  129. run the tests, that has to be done in MPW with the scripts in utils/macos.
  130. make clean alltest TEST_OS_TARGET=macos TEST_OPT="-WT -st" \
  131. USEUNITDIR=/Projekt/Freepascal/fpc/rtl/macos
  132. To clean. Note that same options as above has to be given so that the correct
  133. files will be removed.
  134. make clean TEST_OS_TARGET=macos USEUNITDIR=/Projekt/Freepascal/fpc/rtl/macos