From 70ee50053b8c5a0e9baf89e97f691c877c1cad80 Mon Sep 17 00:00:00 2001 From: Martin Kinkelin Date: Sat, 18 Aug 2018 19:59:55 +0200 Subject: [PATCH] std.exception: Make unittest less brittle 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. --- std/exception.d | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/std/exception.d b/std/exception.d index 5e09fb6af2e..324a9934827 100644 --- a/std/exception.d +++ b/std/exception.d @@ -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);