dimanche 13 août 2017

Testing cli programs and file operations

I'm building a dotfiles manager program for uni in rust, and looking for ways to test aspects of the program. As far as I can see, it can be broken into 2 parts:

  • unit testing for logic and individual functions
  • testing that it does what it should do irl (eg. correctly moving/renaming/linking files)

The first one isn't a problem, but for the second one I'm at a loss. It needs to be able to run in a confined environment, so if it does do something stupid it won't rm -rf HOME or worse on me.

So my question is, are there any standard/good methods of testing programs like this? Are there tools available that would do what I'm wanting?

The only tools I've found so far seem to be custom built (like the test scripts for rcm for example), or Aruba (which seems like it could work, but I'm struggling to see how this could be used effectively in this case - especially since it involves heaps of files and directories.

Thanks.

Aucun commentaire:

Enregistrer un commentaire