marxin / cvise

Super-parallel Python port of the C-Reduce
Other
219 stars 25 forks source link

Make CVise understand files in a filesystem tree #132

Closed dmcdougall closed 4 months ago

dmcdougall commented 4 months ago

CVise now understands test cases that live in subdirectories in a filesystem tree.

The behaviour is to simply create the directories needed in tmpfs. And interestingness checks are already expected to handle paths to test cases.

For example, a user can now say:

cvise <args> ./interesting.sh dir1/file1 file2 dir2/file1 dir3/file3

This feature ought to make it easier to minimise more complicated situations involving larger applications that create complex out-of-source build trees where:

  1. there are several files in different directories; and
  2. files that have the same name but live in different directories.

There is some extra historical context behind this pull request. I had initially made an inquiry about copying extra folders in #110. In that issue, however, CVise didn't really understand that the directory is really part of the test case. What I'm trying to do here is give the user the opportunity to minimise test cases without having to extract them all from an existing and potentially complex directory hierarchy.

I'm very open to criticism on this contribution, so please feel free to tear it apart. Or if this contribution isn't something that the community is interested in, I'm happy for it to be rejected.

marxin commented 4 months ago

Thanks for the pull request. I decided to use this opportunity and make a bigger refactoring related to pathlib in the testing.py file. Having that, I added the requested functionality. Please test my #133, does it work for you?

dmcdougall commented 4 months ago

I added the requested functionality

Thank you.

Please test my https://github.com/marxin/cvise/pull/133

Will do. Thanks again.