{"size": 2095, "ext": "rktl", "max_stars_repo_path": "pkgs/racket-test-core/tests/racket/quiet.rktl", "max_stars_repo_name": "lkh01/racket", "max_stars_repo_stars_event_min_datetime": "2018-07-05T21:18:24.000Z", "max_stars_repo_stars_event_max_datetime": "2021-06-04T14:48:37.000Z", "max_issues_repo_path": "pkgs/racket-test-core/tests/racket/quiet.rktl", "max_issues_repo_name": "lkh01/racket", "max_issues_repo_issues_event_min_datetime": "2017-05-10T07:33:20.000Z", "max_issues_repo_issues_event_max_datetime": "2018-07-19T15:49:46.000Z", "max_forks_repo_path": "pkgs/racket-test-core/tests/racket/quiet.rktl", "max_forks_repo_name": "lkh01/racket", "max_forks_repo_forks_event_min_datetime": "2016-04-25T11:47:57.000Z", "max_forks_repo_forks_event_max_datetime": "2017-05-09T14:52:48.000Z"}
{"max_stars_count": 4, "max_issues_count": 9, "max_forks_count": 3, "avg_line_length": 37.4107142857, "max_line_length": 76, "alphanum_fraction": 0.553699284}

(namespace-variable-value 'quiet-load #f
  (lambda ()
    (namespace-set-variable-value! 'quiet-load
      (let ([argv (current-command-line-arguments)])
        (if (= 1 (vector-length argv)) (vector-ref argv 0) "all.rktl")))))

(define timeout-thread #f)

(namespace-variable-value 'real-output-port #f
  (lambda ()
    (let ([outp (current-output-port)]
          [errp (current-error-port)]
          [exit (exit-handler)]
          [errh (uncaught-exception-handler)]
          [esch (error-escape-handler)]
          [cust (current-custodian)]
          [orig-thread (current-thread)])
      (namespace-set-variable-value! 'real-output-port outp)
      (namespace-set-variable-value! 'real-error-port  errp)
      (namespace-set-variable-value! 'last-error #f)
      ;; we're loading this for the first time:
      ;; make real errors show by remembering the exn
      ;; value, and then printing it on abort.
      (uncaught-exception-handler (lambda (e) 
                                    (when (eq? (current-thread) orig-thread)
                                      (set! last-error e))
                                    (errh e)))
      ;; -- set up a timeout
      (set! timeout-thread
            (thread
             (lambda ()
               (sleep 3600)
               (fprintf errp "\n\n~aTIMEOUT -- ABORTING!\n" Section-prefix)
               (exit 3)
               ;; in case the above didn't work for some reason
               (sleep 60)
               (custodian-shutdown-all cust)))))))

(let ([p (make-output-port
          'quiet always-evt (lambda (str s e nonblock? breakable?) (- e s))
          void)])
  (call-with-continuation-prompt
   (lambda ()
     (parameterize ([current-output-port p] [current-error-port p])
       (load-relative quiet-load))
     (kill-thread timeout-thread))
   (default-continuation-prompt-tag)
   (lambda (thunk)
     (when last-error
       (fprintf real-error-port "~aERROR: ~a\n"
                Section-prefix
                (if (exn? last-error) (exn-message last-error) last-error))
       (exit 2))))
  (report-errs #t))
