readme.txt 8.4 KB

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