trinity-devel@lists.pearsoncomputing.net

Message: previous - next
Month: June 2016

Re: test target and code

From: deloptes <deloptes@...>
Date: Sun, 19 Jun 2016 14:41:19 +0200
deloptes wrote:

> deloptes wrote:
> 
> add_custom_target(testing check
>    COMMAND bash test.sh
>    COMMENT .......
>    DEPENDS .......
>    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
> )
> 
> does this look good to you
> especially add_custom_target(testing check
> 
> thanks

I tested now and it seems it should be 

        add_custom_target(testing ALL

I don't see any other option in docs except all or skip this, but ALL also
means it should pass the tests as the target is called on build and if
skipped the testing target can not be called

fakeroot debian/rules testing
...
make: *** No rule to make target 'testing'.  Stop.

Another problem I have with 

COMMAND bash test.sh

is that it tries executing this but test is not created at this point of
time. However I have defined

add_custom_command(
  TARGET testing PRE_BUILD
  COMMAND test
  ARGS -f ${CMAKE_CURRENT_BINARY_DIR}/test.sh || ln -s
${CMAKE_CURRENT_SOURCE_DIR}/test.sh ${CMAKE_CURRENT_BINARY_DIR}
  WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)

Can you help a bit please?

thanks