From 76767f3d6e89e540241e973b8ffe04690a9a2ccb Mon Sep 17 00:00:00 2001 From: George Hartzell Date: Sun, 28 Feb 2016 13:49:56 -0800 Subject: [PATCH] Formula-Cookbook: Improve testing suggestions Based on recent feedback on some pull requests, I touched up the section about adding tests to formula. I wanted to make it clearer that the examples demonstrate how to create files on the fly and add a pointer to the tinyxml2 formula (DomT4 pointed it out to me as a good example). Closes Homebrew/homebrew#49641. Signed-off-by: Dominyk Tiller --- share/doc/homebrew/Formula-Cookbook.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/doc/homebrew/Formula-Cookbook.md b/share/doc/homebrew/Formula-Cookbook.md index 7bc49ff3de..5fb834b206 100644 --- a/share/doc/homebrew/Formula-Cookbook.md +++ b/share/doc/homebrew/Formula-Cookbook.md @@ -245,7 +245,7 @@ The [`test do`](http://www.rubydoc.info/github/Homebrew/homebrew/master/Formula# We want tests that don't require any user input and test the basic functionality of the application. For example `foo build-foo input.foo` is a good test and (despite their widespread use) `foo --version` and `foo --help` are bad tests. However, a bad test is better than no test at all. -See [cmake](https://github.com/Homebrew/homebrew/blob/master/Library/Formula/cmake.rb) for an example of a formula with a good test. A basic `CMakeLists.txt` file is written CMake uses it to generate Makefiles. This test checks that CMake doesn't e.g. segfault during basic operation. +See [cmake](https://github.com/Homebrew/homebrew/blob/master/Library/Formula/cmake.rb) for an example of a formula with a good test. The formula writes a basic `CMakeLists.txt` file into the test directory then calls CMake to generate Makefiles. This test checks that CMake doesn't e.g. segfault during basic operation. Another good example is [tinyxml2](https://github.com/Homebrew/homebrew/blob/master/Library/Formula/tinyxml2.rb), which writes a small C++ source file into the test directory, compiles and links it against the tinyxml2 library and finally checks that the resulting program runs successfully. ## Manuals