On Wed, Nov 30, 2016 at 7:45 AM, Erik Brinkman <[email protected]> wrote:
> However, you /can/ specify targets for partial builds, by simply executing
> `tup [target]...`, where target can be a file, directory, or group. This
> will make sure that all files specified by target are built. Thus, you could
> have all of your tests output to <test> to have a convenient target, but
> since they'd depend on the final build, this wouldn't make much sense.

If all your tests were in a 'test' subdirectory, then 'tup test' would
stop executing after those tests are run. Note that even if tup is
executed with a specific target (or directory, group, etc), it still
takes the whole DAG into account. So if the files in test/ depend on
the program under src/ or somewhere else, running 'tup test' would
still build the program if it's out of date and you didn't run 'tup
src' first. In this simple example, running 'tup src' would just build
the program and not run the test files, while 'tup test' or just plain
'tup' would run everything including tests.

The tests also don't necessarily have to output anything - there can
be command nodes in the DAG that have no outputs. Something like this:

test/Tupfile:
: foreach test*.sh | ../src/my_program |> sh %f |>

src/Tupfile:
: |> gcc my_program.c -o %o |> my_program

I don't generally have test cases run by tup myself, but I think
that's more just my personal preference. Having a simple Makefile or
something else for command dispatch is perfectly reasonable, IMO. (In
the tup project itself, there's just a 'test.sh' script to manage
running test cases, since I don't think running tup in tup would work
very well).

-Mike

-- 
-- 
tup-users mailing list
email: [email protected]
unsubscribe: [email protected]
options: http://groups.google.com/group/tup-users?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"tup-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to