string module_name = "scm output-" + format;
output_module_ = scm_c_resolve_module (module_name.c_str ());
+
+ /*
+ Enable errors for undefined stencil routines if
+ -dwarning-as-error is specified; else enable warnings.
+ */
+ SCM proc = ly_lily_module_constant ("backend-testing");
+ scm_call_1 (proc, output_module_);
}
Paper_outputter::~Paper_outputter ()
relative_includes = to_boolean (val);
val = scm_from_bool (to_boolean (val));
}
+ else if (var == ly_symbol2scm ("warning-as-error"))
+ val = scm_from_bool (to_boolean (val));
scm_hashq_set_x (option_hash, var, val);
}
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; backend helpers.
+(use-modules (scm ps-to-png)
+ (ice-9 optargs))
+
(define-public (ly:system command . rest)
(let* ((status 0)
(dev-null "/dev/null")
(ly:progress "\n")
(ly:system cmd)))
-(use-modules (scm ps-to-png))
-
(define-public (postscript->png resolution paper-width paper-height name)
(let* ((verbose (ly:get-option 'verbose))
(rename-page-1 #f))
scope)))
(apply string-append (map output-scope scopes)))
+(define-public (backend-testing output-module)
+ (define (missing-stencil-expression name)
+ (apply
+ (if (ly:get-option 'warning-as-error) ly:error ly:warning)
+ (list (_ "missing stencil expression `~S'") name)))
+
+ (map (lambda (x)
+ (if (not (module-defined? output-module x))
+ (module-define! output-module x
+ (lambda* (#:optional y . z)
+ (missing-stencil-expression x)))))
+ (ly:all-stencil-expressions)))
"List available font names.")
(verbose ,(ly:command-line-verbose?)
"Value of the --verbose flag (read-only).")
+ (warning-as-error #f
+"Exit if an undefined stencil expression is
+found.")
))
;; Need to do this in the beginning. Other parts of the Scheme