sociomantic-tsunami / makd

A Make library/framework to build D projects
Boost Software License 1.0
9 stars 20 forks source link

Save test binaries #124

Closed leandro-lucarella-sociomantic closed 6 years ago

leandro-lucarella-sociomantic commented 6 years ago

When running tests, since the final target is a test.stamp instead of producing the binary (because we care about running them, not just building them), the test binaries themselves are considered intermediate files by Make, and normally removed automatically (even if a test failed).

To avoid this, we need to mark them as .PRECIOUS:, for example for integration tests:

.PRECIOUS: $(patsubst $C/integrationtest/%/main.d,$O/test-%,$(wildcard $C/integrationtest/*/main.d))
mathias-baumann-sociomantic commented 6 years ago

image

leandro-lucarella-sociomantic commented 6 years ago

Attached fix.

leandro-lucarella-sociomantic commented 6 years ago

I guess you didn't actually test it, right? I was about to do a simple test.

leandro-lucarella-sociomantic commented 6 years ago

Usually when I assign a PR to myself is because it's ready to be reviewed (and I appreciate approvals) but I want to do the merging myself (because I'm checking something for example).

leandro-lucarella-sociomantic commented 6 years ago

My simple test worked, all seems :heavy_check_mark:

mathias-baumann-sociomantic commented 6 years ago

I didn't test, no. Will only "approve" next time then :)