Re: Standard way to run test target in specific port

2017-05-14 Thread José G . Juanino

El domingo 14 de mayo a las 13:25:00 CEST, Mathieu Arnold escribió:

Le 14/05/2017 à 11:13, José G. Juanino a écrit :

Hello FreeBSD ports!

I am porting a backup software (bup backup), and the upstream Makefile
has a "test" target. I find useful to make a port knob to allow run
such test (disabled by default). What is the best way to accomplish
that task? Is there any doc or "best practique" to watch for?



You do:

TEST_TARGET=   test

and then, you simply run:

make test

from the ports directory. Do not add options knobs for it.


Thanks for your response, I will do so. 


Regards


--
José G. Juanino


signature.asc
Description: PGP signature


Re: Standard way to run test target in specific port

2017-05-14 Thread Mathieu Arnold
Le 14/05/2017 à 11:13, José G. Juanino a écrit :
> Hello FreeBSD ports!
>
> I am porting a backup software (bup backup), and the upstream Makefile
> has a "test" target. I find useful to make a port knob to allow run
> such test (disabled by default). What is the best way to accomplish
> that task? Is there any doc or "best practique" to watch for?
>

You do:

TEST_TARGET=   test

and then, you simply run:

make test

from the ports directory. Do not add options knobs for it.


-- 
Mathieu Arnold




signature.asc
Description: OpenPGP digital signature


Re: Standard way to run test target in specific port

2017-05-14 Thread José G . Juanino

El domingo 14 de mayo a las 11:13:25 CEST, José G. Juanino escribió:

Hello FreeBSD ports!

I am porting a backup software (bup backup), and the upstream Makefile 
has a "test" target. I find useful to make a port knob to allow run 
such test (disabled by default). What is the best way to accomplish 
that task? Is there any doc or "best practique" to watch for?


I am thinking in write something like this:


RUNTEST_DESC=   Run test suite # knob

.

.if ${PORT_OPTIONS:MRUNTEST}
post-build:
  ${GMAKE} ${MAKE_ARGS} -C ${WRKDIR}/${PORTNAME}-${PORTVERSION} test
.endif


But it seems very contrived and ugly.


You can find the full shar file in 219174 (with no test target  
deployed).


Hi again, I will try to answer to myself ...

I have defined the "RUNTEST" knob in "OPTIONS_DEFINE" variable, and 
after:


RUNTEST_VARS=   TEST_TARGET=test

The last line enable the "do-test" target properly when the knob is set 
(see bsd.port.mk system Makefile)


But I do not know how to invoke automatically that target when user just 
run "make". Indeed I am thinking if really is a good idea to force the 
execution of "make test" by mean of the knob ... In some other ports I 
am seeing, this is enterelly optional. 


Regards


--
José G. Juanino
___
freebsd-ports@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "freebsd-ports-unsubscr...@freebsd.org"


Standard way to run test target in specific port

2017-05-14 Thread José G . Juanino

Hello FreeBSD ports!

I am porting a backup software (bup backup), and the upstream Makefile 
has a "test" target. I find useful to make a port knob to allow run such 
test (disabled by default). What is the best way to accomplish that 
task? Is there any doc or "best practique" to watch for?


I am thinking in write something like this:


RUNTEST_DESC=   Run test suite # knob

.

.if ${PORT_OPTIONS:MRUNTEST}
post-build:
   ${GMAKE} ${MAKE_ARGS} -C ${WRKDIR}/${PORTNAME}-${PORTVERSION} test
.endif


But it seems very contrived and ugly.


You can find the full shar file in 219174 (with no test target  
deployed).



Thanks for your help!


--
José G. Juanino
___
freebsd-ports@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "freebsd-ports-unsubscr...@freebsd.org"