racket / rackunit

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Count skipped tests with `rackunit/log`?

jackfirth opened this issue · comments

This would allow raco test to know when not all tests were run for whatever reason. Tests that are skipped in the package build server (e.g. tests requiring an internet connection) could cause the package catalog entry to say "succeeds, some tests skipped" instead of just "succeeds".

Is the idea here that testing code can opt-in to saying "this test was skipped and I want you to know"? If so then yes I want this.

Example:

;; Issue a warning if we skip this test
(if (eq? (system-type) 'windows)
  (check-true ....)
  (test-log "Skipped test because Windows"))

;; Don't care if we skip this test
(if (today-is-tuesday?)
  (check-true ....)
  (void))

Yes, that's exactly it. I'm not sure what the correct way to show a message about a skipped test is though. All I know for certain is I want rackunit/log to support counting skipped tests, and I want there to be a way for custom checks and user test cases to skip tests for arbitrary reasons while incrementing the counter.