Commits

evhan  committed 9678900

Smoke test a simple mount/unmount before running test suite

  • Participants
  • Parent commits 5f5022c

Comments (0)

Files changed (3)

File tests/empty.scm

-(use fuse posix srfi-18 test)
+(use fuse posix test)
 
 (define (test-empty path)
   (let ((fs (make-filesystem)))

File tests/run.scm

 
 (cond-expand (linux) (else (exit 0)))
 
+(test-group "fuse (smoke test)"
+  (load "smoke.scm")
+  (unless (test-smoke "path")
+    (fprintf (current-error-port)
+             "    simple mount failed\n")
+    (fprintf (current-error-port)
+             "    skipping other tests\n")
+    (exit 1)))
+
 (define-syntax test-interpreted
   (syntax-rules ()
     ((_ file)

File tests/smoke.scm

+(use test fuse)
+
+(define (test-smoke path)
+  (let ((fs (make-filesystem)))
+    (dynamic-wind
+     (lambda ()
+       (create-directory path #t))
+     (lambda ()
+       (case (test-assert (filesystem-start! path fs))
+         ((PASS)
+          (filesystem-wait! path fs 'started)
+          (filesystem-stop! path fs)
+          (filesystem-wait! path fs 'stopped))
+         ((FAIL) #f)))
+     (lambda ()
+       (handle-exceptions _ #f (delete-directory path #t))))))