digitalmars.D.learn - Specifying which Phobos modules to unittest
- Joseph Rushton Wakeling (9/9) May 10 2012 Hello all,
- =?ISO-8859-1?Q?Christian_K=F6stlin?= (12/21) May 10 2012 the tests are not executed at compile time but instead at runtime before...
- H. S. Teoh (9/27) May 10 2012 [...]
- =?ISO-8859-1?Q?Christian_K=F6stlin?= (1/1) May 10 2012 sorry ... i did not get this, as i never have developed phobos.
- Jonathan M Davis (8/35) May 10 2012 I believe that it's possible. I think that Andrei does it (he posted com...
- Jesse Phillips (6/15) May 10 2012 compile your module with an empty main (that is what the makefile
- Joseph Rushton Wakeling (2/3) May 10 2012 Thanks muchly. :-)
- Joseph Rushton Wakeling (3/4) May 10 2012 ... on second thoughts, that doesn't seem to work. I tested by putting ...
- Dmitry Olshansky (6/10) May 10 2012 mm I've been using this beast for ages with great success.
- Joseph Rushton Wakeling (2/5) May 10 2012 D'oh! Yup. :-\
Hello all, Is there any way to specify individual Phobos modules to unittest when building, instead of having to do the whole lot? When working on 1 single module, it'd be nice to be able to unittest that one alone and not have to worry about doing the complete set of tests until ready to push back to GitHub. Can anyone advise? Thanks & best wishes, -- Joe
May 10 2012
On 05/10/2012 06:21 PM, Joseph Rushton Wakeling wrote:Hello all, Is there any way to specify individual Phobos modules to unittest when building, instead of having to do the whole lot? When working on 1 single module, it'd be nice to be able to unittest that one alone and not have to worry about doing the complete set of tests until ready to push back to GitHub. Can anyone advise? Thanks & best wishes, -- Joethe tests are not executed at compile time but instead at runtime before main(). so you have to compile the modules seperately, and only the modules you want to test with the unittest flag. that means: dmd -c module1.d module2.d module3.d dmd -c -unittest module_with_tests.d dmd module1.o module2.d module3.o module_with_tests.o when you run your linked program your should only get the unittests from moduel_with_tests. regards christian
May 10 2012
On Thu, May 10, 2012 at 07:05:27PM +0200, Christian Köstlin wrote:On 05/10/2012 06:21 PM, Joseph Rushton Wakeling wrote:[...] This is not true of Phobos; the Phobos makefile has a separate rule for building (and running) unittests. The OP's question is, how to make this run only a single module's tests as opposed to the entire Phobos (which takes a while, since some of the tests are quite extensive). T -- Chance favours the prepared mind. -- Louis PasteurHello all, Is there any way to specify individual Phobos modules to unittest when building, instead of having to do the whole lot? When working on 1 single module, it'd be nice to be able to unittest that one alone and not have to worry about doing the complete set of tests until ready to push back to GitHub. Can anyone advise? Thanks & best wishes, -- Joethe tests are not executed at compile time but instead at runtime before main(). so you have to compile the modules seperately, and only the modules you want to test with the unittest flag.
May 10 2012
sorry ... i did not get this, as i never have developed phobos.
May 10 2012
On Thursday, May 10, 2012 10:14:12 H. S. Teoh wrote:On Thu, May 10, 2012 at 07:05:27PM +0200, Christian Köstlin wrote:I believe that it's possible. I think that Andrei does it (he posted commands related to that at one point, but I couldn't get them to work), but I don't know how. I just always run the whole test suite. This is a question that would probably be better asked on either the main list or the Phobos list, since the ones most likely to know are Phobos devs, and a number of them do not pay attention to D.Learn. - Jonathan M DavisOn 05/10/2012 06:21 PM, Joseph Rushton Wakeling wrote:[...] This is not true of Phobos; the Phobos makefile has a separate rule for building (and running) unittests. The OP's question is, how to make this run only a single module's tests as opposed to the entire Phobos (which takes a while, since some of the tests are quite extensive).Hello all, Is there any way to specify individual Phobos modules to unittest when building, instead of having to do the whole lot? When working on 1 single module, it'd be nice to be able to unittest that one alone and not have to worry about doing the complete set of tests until ready to push back to GitHub. Can anyone advise? Thanks & best wishes, -- Joethe tests are not executed at compile time but instead at runtime before main(). so you have to compile the modules seperately, and only the modules you want to test with the unittest flag.
May 10 2012
On Thursday, 10 May 2012 at 16:22:11 UTC, Joseph Rushton Wakeling wrote:Hello all, Is there any way to specify individual Phobos modules to unittest when building, instead of having to do the whole lot? When working on 1 single module, it'd be nice to be able to unittest that one alone and not have to worry about doing the complete set of tests until ready to push back to GitHub. Can anyone advise? Thanks & best wishes, -- Joecompile your module with an empty main (that is what the makefile does) or rdmd --main mymod.d -unittest
May 10 2012
On 10/05/12 19:33, Jesse Phillips wrote:rdmd --main mymod.d -unittestThanks muchly. :-)
May 10 2012
On 10/05/12 19:33, Jesse Phillips wrote:rdmd --main mymod.d -unittest... on second thoughts, that doesn't seem to work. I tested by putting in place a guaranteed-fail unittest; no result. :-(
May 10 2012
On 10.05.2012 22:11, Joseph Rushton Wakeling wrote:On 10/05/12 19:33, Jesse Phillips wrote:mm I've been using this beast for ages with great success. rdmd --main -unittest std\regex.d may it be that -unittest should go first? -- Dmitry Olshanskyrdmd --main mymod.d -unittest... on second thoughts, that doesn't seem to work. I tested by putting in place a guaranteed-fail unittest; no result. :-(
May 10 2012
On 10/05/12 20:47, Dmitry Olshansky wrote:mm I've been using this beast for ages with great success. rdmd --main -unittest std\regex.d may it be that -unittest should go first?D'oh! Yup. :-\
May 10 2012