- (:plist-file "test" :source-plist (:test-outer "OUT"))
- (:file "test-driver" :depends-on ("test"))))
-
-(defmethod perform ((op test-op) (com (eql (find-system :sb-introspect-tests))))
- (or (funcall (intern "DO-TESTS" (find-package "SB-RT")))
- (error "~S failed" 'test-op)))
+ (:plist-file "test" :source-plist (:test-outer "OUT") :operation-done-p (compile-op (o c) nil))
+ (:source-only-file "load-test")
+ (:file "test-driver" :depends-on ("test" "load-test")))
+ :perform
+ (test-op (o c)
+ ;; N.b. At least DEFINITION-SOURCE-PLIST.1 assumes that CWD is the
+ ;; contrib/sb-introspect directory which is true for when this is
+ ;; implicitly run via make-target-contribs.sh -- but not when this
+ ;; is executed manually.
+ (let ((*default-pathname-defaults* (translate-logical-pathname (system-source-directory c))))
+ (multiple-value-bind (soft strict pending) (symbol-call :sb-rt :do-tests)
+ (declare (ignorable pending))
+ (fresh-line)
+ (unless strict
+ #+sb-testing-contrib
+ ;; We create TEST-PASSED from a shell script if tests passed. But
+ ;; since the shell script only `touch'es it, we can actually create
+ ;; it ahead of time -- as long as we're certain that tests truly
+ ;; passed, hence the check for SOFT.
+ (when soft
+ (with-open-file (s #p"SYS:CONTRIB;SB-INTROSPECT;TEST-PASSED"
+ :direction :output)
+ (dolist (pend pending)
+ (format s "Expected failure: ~A~%" pend))))
+ (warn "ignoring expected failures in test-op"))
+ (unless soft
+ (error "test-op failed with unexpected failures"))))))