by thyrsus · 11y ago · 0 comments
I have a directory tree full of test data. As the project goes along, the test data will evolve, and thus should go under revision control.
Testing needs to start with known files, so, hey!, git checkout test_data - except that means my latest code revisions need to go into the test_data branch even before they're tested :-(.
Then the tests make their changes to the data, which the tests check, and which I then want to throw away. So: "git checkout test_data -f; git clean -f" -- except that cleans out the source code area as well as the test data area.
I'm thinking the test data should be separate repository. Is that a mistake?
[Edit] I've tried looking at stackoverflow.com, but searching for "git testing" returned ~7000 articles, the first few hundred of which didn't look relevant.
git checkout test_data 'testdata/'
to only grab the 'testdata/' directory from that branch. You can do this with files with a pattern, like '*.c', as well.
does that help?