librelist archives

« back to archive

What should I put in the test function?

What should I put in the test function?

From:
Tzu-ping Chung
Date:
2011-09-17 @ 23:55
Hi,

I was creating a new formula for a lib that I need to work with. I brew 
create the formula, but found a function "test" that I don't recognize. 
Some searching on this mail list yields only this thread, so I guess this 
is a new requirement? If so, what tests should I put in here? Is file 
existence checking enough, or should I check the dependency of the libs I 
installed (by tool or something)? This is not in the cookbook, and I have 
never seen this before, so I guess that I better ask about it before 
submitting a pull request.

Re: [homebrew] What should I put in the test function?

From:
Max Howell
Date:
2011-09-20 @ 02:30
The test should test that the tool works. So checking that running it with
no arguments returns 0 should suffice.

> Hi,
> 
> I was creating a new formula for a lib that I need to work with. I brew 
create the formula, but found a function "test" that I don't recognize. 
Some searching on this mail list yields only this thread, so I guess this 
is a new requirement? If so, what tests should I put in here? Is file 
existence checking enough, or should I check the dependency of the libs I 
installed (by tool or something)? This is not in the cookbook, and I have 
never seen this before, so I guess that I better ask about it before 
submitting a pull request.