Skip to content

Commit

Permalink
std.exception: Make unittest less brittle
Browse files Browse the repository at this point in the history
It makes sure the source file can be read from when running the tests.
If the path to std/exception.d in the compile-Phobos command line was
relative, this required the testrunner to be run in the same working
directory as when compiling Phobos.
  • Loading branch information
kinke committed Aug 18, 2018
1 parent 8231e77 commit 70ee500
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion std/exception.d
Expand Up @@ -629,7 +629,7 @@ alias errnoEnforce = enforce!ErrnoException;
@system unittest
{
import core.stdc.stdio : fclose, fgets, fopen;
auto f = fopen(__FILE__, "r").errnoEnforce;
auto f = fopen(__FILE_FULL_PATH__, "r").errnoEnforce;
scope(exit) fclose(f);
char[100] buf;
auto line = fgets(buf.ptr, buf.length, f);
Expand Down

0 comments on commit 70ee500

Please sign in to comment.