Our product (C++ windows application, Google Test as testing framework, VS2015 as IDE) has a number of file-based interfaces to external products, i.e., we generate a file which is then imported into an external product. For testing these interfaces, we have chosen a golden file approach:
- Invoke the code that produces an interface file, save the resulting file for later reference (this is our golden file - we here assume that the current state of interface code is correct).
- Commit the golden file to the TFS repository.
- Make changes to the interface code.
- Invoke the code, compare the resulting file with the according golden file.
- If the files are equal, the test passes. Otherwise,
- Enable the refresh modus which makes sure that the golden file is overriden by the file resulting from invoking the interface code.
- Invoke the interface code (thus refreshing the golden file).
- Investigate the outgoing changes in VS's team explorer. If the changes are as desired by our code changes from step 3, commit code changes and golden file. Otherwise, go back to step 3.
This approach works great for us, but it has one drawback: VS only recognizes that the golden files have changed (and thus allows us to investigate the changes) if we use a local workspace. If we use a server workspace, programmatically remove the read-only flag from the golden files and refresh them as described above, VS still does not recognize that the files have changed.
So my question is: Is there any way to make our golden file testing approach work with server workspaces, e.g. by telling VS that some files have changed?
Aucun commentaire:
Enregistrer un commentaire