#include "music.hh"
#include "output-def.hh"
#include "pointer-group-interface.hh"
+#include "program-option.hh"
#include "stencil.hh"
#include "stream-event.hh"
#include "system.hh"
void
Grob::warning (string s) const
{
+ if (get_program_option ("warning-as-error"))
+ error (s);
+
SCM cause = self_scm ();
while (Grob *g = unsmob_grob (cause))
cause = g->get_property ("cause");
void
Grob::programming_error (string s) const
{
+ if (get_program_option ("warning-as-error"))
+ error (s);
+
SCM cause = self_scm ();
while (Grob *g = unsmob_grob (cause))
cause = g->get_property ("cause");
if (Music *m = unsmob_music (cause))
m->origin ()->message (s);
else if (Stream_event *ev = unsmob_stream_event (cause))
- ev->origin ()->warning (s);
+ ev->origin ()->message (s);
else
::message (s);
}
using namespace std;
#include "international.hh"
+#include "program-option.hh"
#include "source-file.hh"
#include "sources.hh"
#include "warn.hh"
void
Input::programming_error (string s) const
{
- message (_f ("programming error: %s", s.c_str ()));
- message (_ ("continuing, cross fingers") + "\n");
+ if (get_program_option ("warning-as-error"))
+ ::error (s);
+ else {
+ message (_f ("programming error: %s", s.c_str ()));
+ message (_ ("continuing, cross fingers") + "\n");
+ }
}
void
Input::warning (string s) const
{
- message (_f ("warning: %s", s));
+ if (get_program_option ("warning-as-error"))
+ ::error (s);
+ else
+ message (_f ("warning: %s", s));
}
void
(define-public (backend-testing output-module)
(define (missing-stencil-expression name)
(begin
- (apply
- (if (ly:get-option 'warning-as-error) ly:error ly:warning)
- (list (_ "missing stencil expression `~S'") name))
+ (ly:warning (_ "missing stencil expression `~S'") name)
""))
(map (lambda (x)
(verbose ,(ly:command-line-verbose?)
"Value of the --verbose flag (read-only).")
(warning-as-error #f
-"Exit if an undefined stencil expression is
-found.")
+"Change all warning and programming_error
+messages into errors.")
))
;; Need to do this in the beginning. Other parts of the Scheme
(if (ly:get-option 'trace-scheme-coverage)
(coverage:enable))
+(if (ly:get-option 'warning-as-error)
+ (begin
+ (set! ly:warning ly:error)
+ (set! ly:programming-error ly:error)))
+
(define-public parser #f)