From ed1d9450c061f85bd53b253fce4bb849c6829979 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Sat, 15 May 2021 09:10:19 -0600 Subject: [PATCH] raco test: improve error for a bad `config` submodule Closes #1488 --- pkgs/compiler-lib/compiler/commands/test.rkt | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/pkgs/compiler-lib/compiler/commands/test.rkt b/pkgs/compiler-lib/compiler/commands/test.rkt index 1746df18f6..217c4a6810 100644 --- a/pkgs/compiler-lib/compiler/commands/test.rkt +++ b/pkgs/compiler-lib/compiler/commands/test.rkt @@ -345,7 +345,19 @@ (or (cond [(not try-config?) #f] [(module-declared? (add-submod p 'config) #t) - (dynamic-require (add-submod p 'config) '#%info-lookup)] + (define submod (add-submod p 'config)) + (dynamic-require submod + '#%info-lookup + (lambda () + (error test-exe-name + (format + (string-append + "cannot extract information from a `config` submodule;\n" + " the submodule should use the `info` module language\n" + " submodule: ~.s\n" + " current directory: ~a") + (normalize-module-path submod) + (current-directory)))))] [else #f]) (lambda (what get-default) (get-default)))) (dynamic-require-elsewhere