Fossil SCM
Update test/README.md docs
Commit
9879e63575ca2d36ec80b0bb269cbf8baafa047c8825c9ae4507b3f4ec86c598
Parent
0129386ff8d4fae…
1 file changed
+9
-9
+9
-9
| --- test/README.md | ||
| +++ test/README.md | ||
| @@ -88,22 +88,22 @@ | ||
| 88 | 88 | |
| 89 | 89 | If you suspect an output-change bug, use `-verbose` to print the output of every command, and `-keep` to leave test repos in place for inspection. `rewrite-test-output.tcl` replaces hashes, process IDs and temporary paths in the output of a run with fixed strings, so you can use `diff` to compare two runs. You should then be able to update the expected output text. |
| 90 | 90 | |
| 91 | 91 | When a test finds a fault that is not yet fixed, add `knownBug` as the test's last argument, so that the suite still exits with status 0. A known bug that passes is reported as `OK (knownBug)?`. Don't forget to remove `knownBug` when you're sure the fault is fixed. |
| 92 | 92 | |
| 93 | -If the known bug is the exit status of a `fossil` command, add `-knownBug` to that command too. Otherwise the command prints an `ERROR` line on every run, even with `-quiet`. With `-knownBug` you only see that line under `-strict`. | |
| 94 | - | |
| 95 | -A test marked `knownBug` should fail on every system where it's marked. If the fault only shows up in some environments, have the test set up that environment itself. If Fossil really does behave differently on some system, as it does with decomposed pathnames on macOS, have the test check that behavior and leave the mark off there; don't test for the operating system's name. If a test needs something the system might not have, that's a requirement, so use `test_skip`. | |
| 96 | - | |
| 97 | -Stray files in `test/` can be confusing because `delta1.test` and `merge2.test` run their tests on every file and the counts may differ from what is expected. A different total is not a failure. | |
| 98 | - | |
| 99 | -Beware of global variables! If you must create a new global variable, be sure there isn't a collision with other files. Some future design should avoid this | |
| 100 | -problem. | |
| 93 | +If the known bug is the exit status of a `fossil` command, add `-knownBug` to that command too. Otherwise the command prints an `ERROR` line on every run, even with `-quiet`. With `-knownBug` you only see the error line under `-strict`. | |
| 94 | + | |
| 95 | +A test marked `knownBug` should fail on every applicable system. If the fault only shows up in some environments, the test must set up the relevant environment. If Fossil really does behave differently on some system depending how the system is configured (for example decomposed pathnames on macOS, which vary depending whether the filesystem is HFS+ or APFS) the test must check the behavior. The test suite avoids operating system names by testing for behaviors instead, wherever possible. If a test needs something the system might not have, that becomes a requirement and you can use `test_skip` for. | |
| 96 | + | |
| 97 | +`fixed_word_lines NLINE` is a procedure in `tester.tcl` that returns generated text as a string, the same text on every run. `delta1.test` and `merge2.test` use it for their input. If your new test needs text to work on start with this. Look at delta and merge tests for examples of how to use this with character encodings. | |
| 98 | + | |
| 99 | +Beware of global variables! If you feel you really have to create a new global variable, be sure there isn't a collision with other files. Some future design | |
| 100 | +of tester.tcl should avoid this problem. | |
| 101 | 101 | |
| 102 | 102 | `make test` runs only the `.test` files. The other scripts in `test/` are run by hand: |
| 103 | 103 | |
| 104 | 104 | * `release-checklist.wiki` lists the checks to make before a release, with the `.wiki` and `.md` pages they use. |
| 105 | 105 | * `many-www.tcl` requests about 10,000 web pages from an open checkout with `fossil test-http` and times each, to find crashes and slow pages. `valgrind-www.tcl` requests hundreds of pages under valgrind to find memory errors. |
| 106 | 106 | * `update-test-1.sh` and `update-test-2.sh` run `fossil update` scenarios in an empty directory. |
| 107 | 107 | * `link-tester.html` steps through a list of links in `fossil ui`, for checking each page by eye. |
| 108 | 108 | |
| 109 | -The remaining files are test data. | |
| 109 | +The remaining files are helper scripts and test data. | |
| 110 | 110 |
| --- test/README.md | |
| +++ test/README.md | |
| @@ -88,22 +88,22 @@ | |
| 88 | |
| 89 | If you suspect an output-change bug, use `-verbose` to print the output of every command, and `-keep` to leave test repos in place for inspection. `rewrite-test-output.tcl` replaces hashes, process IDs and temporary paths in the output of a run with fixed strings, so you can use `diff` to compare two runs. You should then be able to update the expected output text. |
| 90 | |
| 91 | When a test finds a fault that is not yet fixed, add `knownBug` as the test's last argument, so that the suite still exits with status 0. A known bug that passes is reported as `OK (knownBug)?`. Don't forget to remove `knownBug` when you're sure the fault is fixed. |
| 92 | |
| 93 | If the known bug is the exit status of a `fossil` command, add `-knownBug` to that command too. Otherwise the command prints an `ERROR` line on every run, even with `-quiet`. With `-knownBug` you only see that line under `-strict`. |
| 94 | |
| 95 | A test marked `knownBug` should fail on every system where it's marked. If the fault only shows up in some environments, have the test set up that environment itself. If Fossil really does behave differently on some system, as it does with decomposed pathnames on macOS, have the test check that behavior and leave the mark off there; don't test for the operating system's name. If a test needs something the system might not have, that's a requirement, so use `test_skip`. |
| 96 | |
| 97 | Stray files in `test/` can be confusing because `delta1.test` and `merge2.test` run their tests on every file and the counts may differ from what is expected. A different total is not a failure. |
| 98 | |
| 99 | Beware of global variables! If you must create a new global variable, be sure there isn't a collision with other files. Some future design should avoid this |
| 100 | problem. |
| 101 | |
| 102 | `make test` runs only the `.test` files. The other scripts in `test/` are run by hand: |
| 103 | |
| 104 | * `release-checklist.wiki` lists the checks to make before a release, with the `.wiki` and `.md` pages they use. |
| 105 | * `many-www.tcl` requests about 10,000 web pages from an open checkout with `fossil test-http` and times each, to find crashes and slow pages. `valgrind-www.tcl` requests hundreds of pages under valgrind to find memory errors. |
| 106 | * `update-test-1.sh` and `update-test-2.sh` run `fossil update` scenarios in an empty directory. |
| 107 | * `link-tester.html` steps through a list of links in `fossil ui`, for checking each page by eye. |
| 108 | |
| 109 | The remaining files are test data. |
| 110 |
| --- test/README.md | |
| +++ test/README.md | |
| @@ -88,22 +88,22 @@ | |
| 88 | |
| 89 | If you suspect an output-change bug, use `-verbose` to print the output of every command, and `-keep` to leave test repos in place for inspection. `rewrite-test-output.tcl` replaces hashes, process IDs and temporary paths in the output of a run with fixed strings, so you can use `diff` to compare two runs. You should then be able to update the expected output text. |
| 90 | |
| 91 | When a test finds a fault that is not yet fixed, add `knownBug` as the test's last argument, so that the suite still exits with status 0. A known bug that passes is reported as `OK (knownBug)?`. Don't forget to remove `knownBug` when you're sure the fault is fixed. |
| 92 | |
| 93 | If the known bug is the exit status of a `fossil` command, add `-knownBug` to that command too. Otherwise the command prints an `ERROR` line on every run, even with `-quiet`. With `-knownBug` you only see the error line under `-strict`. |
| 94 | |
| 95 | A test marked `knownBug` should fail on every applicable system. If the fault only shows up in some environments, the test must set up the relevant environment. If Fossil really does behave differently on some system depending how the system is configured (for example decomposed pathnames on macOS, which vary depending whether the filesystem is HFS+ or APFS) the test must check the behavior. The test suite avoids operating system names by testing for behaviors instead, wherever possible. If a test needs something the system might not have, that becomes a requirement and you can use `test_skip` for. |
| 96 | |
| 97 | `fixed_word_lines NLINE` is a procedure in `tester.tcl` that returns generated text as a string, the same text on every run. `delta1.test` and `merge2.test` use it for their input. If your new test needs text to work on start with this. Look at delta and merge tests for examples of how to use this with character encodings. |
| 98 | |
| 99 | Beware of global variables! If you feel you really have to create a new global variable, be sure there isn't a collision with other files. Some future design |
| 100 | of tester.tcl should avoid this problem. |
| 101 | |
| 102 | `make test` runs only the `.test` files. The other scripts in `test/` are run by hand: |
| 103 | |
| 104 | * `release-checklist.wiki` lists the checks to make before a release, with the `.wiki` and `.md` pages they use. |
| 105 | * `many-www.tcl` requests about 10,000 web pages from an open checkout with `fossil test-http` and times each, to find crashes and slow pages. `valgrind-www.tcl` requests hundreds of pages under valgrind to find memory errors. |
| 106 | * `update-test-1.sh` and `update-test-2.sh` run `fossil update` scenarios in an empty directory. |
| 107 | * `link-tester.html` steps through a list of links in `fossil ui`, for checking each page by eye. |
| 108 | |
| 109 | The remaining files are helper scripts and test data. |
| 110 |