Cleaning build of test-related files

Dear FPM developers

Cleaning test-related build files can be helpful. Something like:
fpm clean --test

Can FPM do it currently?
I modify test-related files to enforce rebuilding them.

Best

As far as I know, fine-grained cleaning is not currently available. However, I think it would be a nice feature! So can I suggest you open an Issue on the fpm github page about it?

Thank you for your reply! I opened an issue on the fpm github page.

1 Like

On GNU/Linux if you create a script in your path called “fpm-cleantest”

#!/bin/bash
( exec 2>&1
fpm build --list
fpm build --list --tests
)sort|uniq -c|grep ' \<1\> '|expand|awk '{print $2}' |xargs -vf
exit

then you can enter “fpm cleantest” to delete test applications. It would be nice in general to remove specific apps or examples as well. One possibility is that there be an option on “build” to do a rebuild. Is one purpose to clean up files? That seems more like an option on clean; but if the purpose is to build/rebuild perhaps “build --force --tests” is appropriate. I see an appeal to both. Does anyone know if any other package manager has a feature to cleanup individual components or force rebuilds?

The script is a little non-intuitive but it avoids issues with using scratch files and odd project names like “test” or programs called “test” or using non-standard source directories that simpler approaches have issues with.

1 Like