readme.txt 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  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. GRAPH..............Requires graph unit
  37. FAIL...............Compilation must fail
  38. RECOMPILE..........After compiling a test, recompile the test for a second
  39. time. This is needed to test ppu loading issues.
  40. NORUN..............Do not execute test, only compile it
  41. INTERACTIVE........Do not execute test, as it requires user intervention
  42. NOTE...............Output note when compiling/executing test
  43. NEEDLIBRARY........Adds -rpath to the linker for unix. This is needed to
  44. test runtime library tests. The library needs the -FE.
  45. option to place the .so in the correct directory.
  46. KNOWNRUNERROR......Known bug, which manifest itself at runtime. To the
  47. right of the equal sign is the expected exit code,
  48. followed by an optional note. Will not be logged
  49. as a bug.
  50. KNOWNCOMPILEERROR..Known bug, which manifest itself at compile time. To
  51. the right of the equal sign is the expected exit code
  52. from compiler, followed by an optional note. Will not
  53. be logged as a bug.
  54. NOTE: A list consists of comma separated items, e. g. CPU=i386,m68k,powerpc
  55. No space between the elements and the comma.
  56. Usage
  57. -----
  58. To actually start the testsuite:
  59. do a simple
  60. make full This should create a log of all failed tests.
  61. make rundigest scans the created log file and outputs some statistics
  62. make rundigest USESQL=YES sends the results to an SQL database
  63. When the tests are performed, first the units (e g rtl) needed by the tests
  64. are compiled in a clean determined way and put in the units directory. Then
  65. webtbs/webtbf/test/tbs/tbf are searched for t*.pp to be compiled
  66. and executed as tests.
  67. Controling testing in more detail
  68. ---------------------------------
  69. Calling "make full" will preform tests in a standard manner. To have
  70. more control of the test process we must differentiate between:
  71. * Driver enviroment: compiler/rtl etc to be used by the tools which
  72. runs and analyze the tests. All normal options to make, like FPC
  73. OS_TARGET, OPT etc controls this.
  74. * Test environment: compiler/rtl etc to be tested, to be used
  75. *in* the tests. Ususal options, prepended with TEST_ , controls
  76. this. If no such options are given, test and driver environment
  77. will be the same.
  78. This differentiation also enables cross testing.
  79. The following test options can be given:
  80. TEST_FPC defaults to FPC
  81. TEST_OS_TARGET defaults to default target of TEST_FPC
  82. TEST_CPU_TARGET defaults to default target of TEST_FPC
  83. TEST_OPT defaults to ""
  84. TEST_FPC_VERSION defaults to version of TEST_FPC
  85. TEST_CCOMPILER defaults to installed gcc compiler, but only
  86. if driver and test full-targets are the same.
  87. TEST_VERBOSE let dotest be more verbose, only usefull for debugging
  88. TEST_DELTEMP delete temporary executable/object/ppu file, default is off
  89. (Please add more test options if needed)
  90. NOTE To clean after a test session, "make clean" must be given the same
  91. options as when running the tests.
  92. The utils directory is considerd to belong to the driver environment,
  93. all other directories belongs to the test environment.
  94. Remote execution
  95. ----------------
  96. Also remote execution of the testsuite is possible
  97. Requirements:
  98. - rsh/ssh must work without keyboard interaction or extra parameters
  99. Test options:
  100. TEST_RSH set this to the hostname when you want to use rsh/rcp
  101. to execute/copy the test
  102. TEST_SSH set this to use ssh/scp to execute the test
  103. TEST_PUTTY test using putty when remote testing (pscp and plink)
  104. TEST_REMOTEOPT extra options to remote program
  105. TEST_REMOTEPATH set remote path to use, default is /tmp
  106. TEST_DELTEMP delete executable after running, so the remote system
  107. doesn't need much free disk space
  108. TEST_REMOTEPW pass a password with -pw to remote tools, mainly usefull for putty
  109. Example:
  110. -------
  111. make TEST_FPC=$HOME/fpc/compiler/ppcsparc TEST_BINUTILSPREFIX=sparc-linux- \
  112. TEST_RSH=sunny TEST_REMOTEPATH=/tmp/tests
  113. make TEST_FPC=$HOME/fpc/compiler/ppcsparc TEST_BINUTILSPREFIX=sparc-linux- \
  114. TEST_SSH=fpc@sunny TEST_REMOTEPATH=/tmp/tests
  115. Example for win32/putty:
  116. make TEST_FPC=c:\fpc\compiler\ppcarm TEST_BINUTILSPREFIX=arm-linux- \
  117. [email protected] TEST_REMOTEPATH=/tmp TEST_DELTEMP=1 \
  118. "TEST_REMOTEPW=xxx" FPC=c:\fpc\compiler\ppc386
  119. Emulator execution
  120. ------------------
  121. Emulator execution is possible as well. It can't be combined with remote execution though.
  122. EMULATOR name of the emulator to use
  123. Example:
  124. make TEST_FPC=~/fpc/compiler/ppcrossarm TEST_OPT=-XParm-linux- EMULATOR=qemu-arm
  125. make TEST_FPC=~/fpc/compiler/ppcrossarm TEST_OPT=-XParm-linux- EMULATOR=qemu-arm \
  126. digest DBDIGESTOPT="-C qemu-arm" USESQL=YES
  127. Example cross testing of target MacOS with driver Darwin
  128. --------------------------------------------------------
  129. NOTE Today it is possible to run the test suite MacOS native.
  130. A machine with both MacOS X and classic MacOS installed. Note that make will not
  131. run the tests, that has to be done in MPW with the scripts in utils/macos.
  132. make clean alltest TEST_OS_TARGET=macos TEST_OPT="-WT -st" \
  133. USEUNITDIR=/Projekt/Freepascal/fpc/rtl/macos
  134. To clean. Note that same options as above has to be given so that the correct
  135. files will be removed.
  136. make clean TEST_OS_TARGET=macos USEUNITDIR=/Projekt/Freepascal/fpc/rtl/macos
  137. Example cross testing of target arm-wince
  138. -----------------------------------------
  139. //arm-wince example : see FPCTRUNK\DEMO\WINCE\TESTEMU\ for additional required tools
  140. make TEST_FPC=ppcrossarm TEST_CPU_TARGET=arm TEST_OS_TARGET=wince TEST_OPT="-XParm-wince-pe- -WC" EMULATOR=MyDisc:\My\Path\to\wcetemu.exe