1. David Krentzlin
  2. sentry

Commits

certainty  committed 2b8c326

updated test-plugin to work with error message created by test-error

  • Participants
  • Parent commits 5577c07
  • Branches default

Comments (0)

Files changed (3)

File sentry

View file
  • Ignore whitespace
 #!/bin/sh
 
-if [ ! -e ./sentry.scm]; then
+if [ ! -e ./sentry.scm ]; then
   echo "No sentry file found. Please make sure you have valid sentry.scm in ${pwd}"
   exit 1
 else

File sentry-plugin-test.scm

View file
  • Ignore whitespace
       (classify-test-result result)))
 
   (define (classify-test-result result)
-    (let ((fail-patterns (list "[ \x1b[31mFAIL\x1b[0m]" "[ FAIL]")))
+    (let ((fail-patterns (list "[ \x1b[31mFAIL\x1b[0m]" "[ FAIL]" "[ ERROR]" "[ \x1b[31mERROR\x1b[0m]")))
       (if (any (lambda (pattern) (string-contains-ci result pattern)) fail-patterns)
           'failed
           'success)))

File sentry.scm

View file
  • Ignore whitespace
 
 ;; Sentry protocoll
 (define (sentry . plugins)
-  (let* ((directory (current-directory)))
+  (let* ((directory (current-directory))
+         (sighandler (lambda _ (print "Stopping sentry ..."))))
+    (print "Staring sentry for " directory)
+    (for-each (cut set-signal-handler! <> sighandler) (list signal/term signal/quit))
+    ;; print list of plugins?
     (monitor-directory directory (current-monitor)  event-handler: (notify-changed-handler (run-sentries plugins)))))
 
 (define ((run-sentries plugins) path event)
   (for-each (lambda (plugin) (plugin path event)) plugins))
 
 
-;; would be invoked like this
-;; (sentry
-;;   (test-guard  ".*.scm"))
-
 )