readme.txt 10.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  1. Usage
  2. -----
  3. To start the test suite execute:
  4. make full TEST_FPC=path_to_your_compiler
  5. This should run all tests, scan the created log file and output some
  6. statistics.
  7. make digest TEST_FPC=path_to_your_compiler
  8. scans the created log file and outputs some statistics
  9. make digest USESQL=YES TEST_FPC=path_to_your_compiler
  10. sends the results to an SQL database
  11. When the tests are performed, first the units (e.g. rtl) needed by the
  12. tests are compiled in a clean determined way and put in the units
  13. directory. Then webtbs/webtbf/test/tbs/tbf are searched for t*.pp to be
  14. compiled and executed as tests.
  15. Directories
  16. -----------
  17. webtbs...........Tests for web-bug-database bugs (should compile/run)
  18. Digits in filename refer to bug database entry
  19. webtbf...........Tests for web-bug-database bugs (should not compile/run)
  20. Digits in filename refer to bug database entry
  21. test.............Test suites for different aspects of the compiler/rtl etc
  22. test/packages....Tests depending on packages. The tests are sorted by package
  23. though this is not mandatory because tests can depend on
  24. multiple packages
  25. tbs..............Tests for other bugs, added by the fpc core team
  26. (success in compilation) Digits in filename is a serial no
  27. tbf..............Tests for other bugs, added by the fpc core team
  28. (fail compile) Digits in filename is a serial no
  29. units............Helper units for doing the tests
  30. utils............Utilities for processing tests
  31. Writing a test
  32. --------------
  33. A test should have a name on the form t*.pp, to be recognized as a test.
  34. It should return 0 on success, any other value indicates failure.
  35. Test directives
  36. ---------------
  37. At the top of the test source code, some directives can be used to
  38. determine how the tests will be processed (if processed automatically via
  39. make), e.g. {%CPU=i386}:
  40. OPT................Compiler option required to compile
  41. CPU................Only for these CPU's (i386,m68k,etc). Might be a list.
  42. SKIPCPU............Not for these CPU's (i386,m68k,etc). Might be a list.
  43. TARGET.............Only for these OS targets (win32,MacOS,etc).
  44. Might be a list.
  45. SKIPTARGET.........Not for these OS targets (win32,MacOS,etc).
  46. Might be a list.
  47. VERSION............Compiler with at lest this version number required.
  48. MAXVERSION.........Compiler with at most this version number required.
  49. RESULT.............Exit code of execution of test expected
  50. TIMEOUT............Timeout indication for test in seconds (only used if
  51. enabled by defining TEST_TIMEOUT)
  52. FILES..............List of files (separated by spaces) required by test,
  53. will be copied to remote before execution
  54. GRAPH..............Requires graph unit
  55. FAIL...............Compilation must fail
  56. RECOMPILE..........After compiling a test, recompile the test for a second
  57. time. This is needed to test ppu loading issues.
  58. NORUN..............Do not execute test, only compile it
  59. INTERACTIVE........Do not execute test, as it requires user intervention
  60. NOTE...............Output note when compiling/executing test
  61. NEEDLIBRARY........Adds -rpath to the linker for unix. This is needed to
  62. test runtime library tests. The library needs the -FE.
  63. option to place the .so in the correct directory.
  64. NEEDEDAFTER........Use it if the files are necessary for a later test.
  65. this option will avoid delteting generated file even when
  66. TEST_DELTEMP is used.
  67. KNOWNRUNERROR......Known bug, which manifest itself at runtime. To the
  68. right of the equal sign is the expected exit code,
  69. followed by an optional note. Will not be logged
  70. as a bug.
  71. KNOWNCOMPILEERROR..Known bug, which manifest itself at compile time. To
  72. the right of the equal sign is the expected exit code
  73. from compiler, followed by an optional note. Will not
  74. be logged as a bug.
  75. QUICKTEST..........If set, only tests without package dependencies are executed
  76. WPOPARAS...........Parameters to be added after -OW/-Ow to perform whole
  77. program optimization tests
  78. WPOPASSES..........Number of whole program optimization iterations to perform
  79. ("1" means compile once with "-FWsomefile -OW<wpoparas>"
  80. and then again with "-FWsomefile2 -OW<wpoparas>
  81. -Fwsomefile1 -Ow<wpoparas>", "2" means another pass but
  82. using somefile2 as input and somefile3 as output, etc.)
  83. NOTE: A list consists of comma separated items, e. g. CPU=i386,m68k,powerpc
  84. No space between the elements and the comma.
  85. Controling testing in more detail
  86. ---------------------------------
  87. Calling "make full" will perform tests in a standard manner. To have
  88. more control of the test process one must distinguish between:
  89. * Driver environment: compiler/rtl etc. to be used by the tools which
  90. runs and analyze the tests. All normal options to make, like FPC
  91. OS_TARGET, OPT etc. controls this.
  92. * Test environment: compiler/rtl etc. to be tested, to be used
  93. *in* the tests. Ususal options, prepended with TEST_ , controls
  94. this. If no such options are given, test and driver environment
  95. will be the same.
  96. This differentiation also enables cross testing.
  97. The following test options can be given:
  98. TEST_FPC compiler to test (no default)
  99. TEST_OS_TARGET defaults to default target of TEST_FPC
  100. TEST_CPU_TARGET defaults to default target of TEST_FPC
  101. TEST_OPT defaults to ""
  102. TEST_FPC_VERSION defaults to version of TEST_FPC
  103. TEST_CCOMPILER defaults to installed gcc compiler, but only
  104. if driver and test full-targets are the same.
  105. TEST_VERBOSE let dotest be more verbose, only useful for debugging
  106. TEST_BENCH display compilation/execution time of each test
  107. TEST_DELTEMP delete temporary executable/object/ppu file,
  108. default is off
  109. TEST_TIMEOUT use timeout wrapper for (remote) execution
  110. V print dotest commandline
  111. TEST_ABI test a certain abi, this influences where the
  112. c object files are taken from: TEST_ABI=eabi
  113. takes the c*.o files from
  114. test/cg/obj/linux/arm-eabi
  115. (Please add more test options if needed)
  116. NOTE: To clean after a test session, "make clean TEST_FPC=path_to_your_compiler"
  117. must be given the same options as when running the tests.
  118. The utils directory is considerd to belong to the driver environment,
  119. all other directories belong to the test environment.
  120. Remote execution
  121. ----------------
  122. Also remote execution of the test suite is possible.
  123. Requirements:
  124. - rsh/ssh must work without keyboard interaction or extra parameters
  125. Test options:
  126. TEST_RSH set this to the hostname when you want to use rsh/rcp
  127. to execute/copy the test
  128. TEST_SSH set this to use ssh/scp to execute the test
  129. TEST_PUTTY test using putty when remote testing (pscp and plink)
  130. TEST_REMOTEOPT extra options to remote program
  131. TEST_REMOTEPATH set remote path to use, default is /tmp
  132. TEST_DELBEFORE delete remote executable before uploading
  133. TEST_DELTEMP delete executable after running, so the remote system
  134. doesn't need much free disk space
  135. TEST_REMOTEPW pass a password with -pw to remote tools,
  136. mainly useful for putty
  137. Examples:
  138. -------
  139. make TEST_FPC=$HOME/fpc/compiler/ppcsparc TEST_BINUTILSPREFIX=sparc-linux- \
  140. TEST_RSH=sunny TEST_REMOTEPATH=/tmp/tests
  141. make TEST_FPC=$HOME/fpc/compiler/ppcsparc TEST_BINUTILSPREFIX=sparc-linux- \
  142. TEST_SSH=fpc@sunny TEST_REMOTEPATH=/tmp/tests
  143. Example for win32/putty:
  144. make TEST_FPC=c:\fpc\compiler\ppcarm TEST_BINUTILSPREFIX=arm-linux- \
  145. [email protected] TEST_REMOTEPATH=/tmp TEST_DELTEMP=1 \
  146. "TEST_REMOTEPW=xxx" FPC=c:\fpc\compiler\ppc386
  147. Emulator execution
  148. ------------------
  149. Emulator execution is possible as well. It can't be combined with remote
  150. execution though.
  151. EMULATOR: name of the emulator to use
  152. Examples:
  153. make TEST_FPC=~/fpc/compiler/ppcrossarm TEST_OPT=-XParm-linux- \
  154. EMULATOR=qemu-arm
  155. make TEST_FPC=~/fpc/compiler/ppcrossarm TEST_OPT=-XParm-linux- \
  156. EMULATOR=qemu-arm digest DBDIGESTOPT="-C qemu-arm" USESQL=YES
  157. Example cross testing of target Mac OS with driver Darwin
  158. --------------------------------------------------------
  159. NOTE: Today, it is possible to run the test suite Mac OS native.
  160. A machine with both Mac OS X and classic Mac OS installed is required.
  161. Note that make will not run the tests. This has to be done in MPW with the
  162. scripts in utils/MacOS.
  163. make clean alltest TEST_OS_TARGET=MacOS TEST_OPT="-WT -st" \
  164. USEUNITDIR=/Projekt/Freepascal/fpc/rtl/MacOS
  165. To clean. Note that same options as above has to be given so that the
  166. correct files will be removed.
  167. make clean TEST_OS_TARGET=MacOS USEUNITDIR=/Projekt/Freepascal/fpc/rtl/MacOS
  168. Example cross testing of target arm-wince
  169. -----------------------------------------
  170. //arm-wince example:
  171. see FPCTRUNK\DEMO\WINCE\TESTEMU\ for additionally required tools
  172. Connect your device via ActiveSync and execute:
  173. make TEST_FPC=ppcrossarm TEST_CPU_TARGET=arm TEST_OS_TARGET=wince \
  174. TEST_OPT="-XParm-wince- -WC -Xs" \
  175. EMULATOR=MyDisc:\My\Path\to\wcetemu.exe
  176. Tests will be performed in the \fpctests folder on the device.
  177. Result uploading
  178. ----------------
  179. Results can be uploaded to the test suite result DB
  180. (http://www.freepascal.org/testsuite/cgi-bin/testsuite.cgi) by executing
  181. make uploadrun
  182. On unix:
  183. - The testing machine must be enabled to login on www.freepascal.org
  184. automatically as user fpc with ssh.
  185. On Windows:
  186. - The putty utilities plink.exe and pscp.exe must be in the path
  187. - There must be a putty session named [email protected] which is
  188. enabled to login automatically into www.freepascal.org