-
Notifications
You must be signed in to change notification settings - Fork 525
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Problem: can't handle temp files in tests easily (#1777)
* Problem: zproject's selftest-rw does not allways work ... we run our tests inside complicated Docker containers setup, where is no guarantee user running test can access files in src/selftest-rw. Solution: Add a constructor to create temporary file, which is automatically removed on destroy. This will leads to nicer API for tests + it'd be hard to find a platform without writable temporary directory. So this concept can work better than src/selftest-rw + it leads to nicer code. * Problem: new api not drafted Solution: mark zfile_tmp as a draft * Problem: zfile_tmp is linked in non-draft build Solution: hide the test behing macro guard * Problem: zfile_tmp can't be merged Solution: use mkstemp funtion * Problem: remove_on_destroy setup before file is opened Solution: do it after file operations are succesfull * Problem: zfile_tmp fails on Windows Solution: use macros to hide the windows incompatible part * Problem: can;t pass CI Solution: turn zfile_tmp off on Windows
- Loading branch information
Showing
4 changed files
with
87 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters