diff --git a/src/Test/Sandbox/Internals.hs b/src/Test/Sandbox/Internals.hs
--- a/src/Test/Sandbox/Internals.hs
+++ b/src/Test/Sandbox/Internals.hs
@@ -339,6 +339,13 @@
           , spPid = Just pid
           , spPGid = Just pgid
           }
+        Just ExitSuccess -> do
+          mStr <- case hOutRO of
+            Just h -> liftM Just $ liftIO $ hGetContents h
+            Nothing -> return Nothing
+          updateProcess sp {
+            spInstance = Just $ StoppedInstance ExitSuccess mStr
+          }
         Just errno' -> throwError $ "Process " ++ spName sp ++ " not running.\n"
                                  ++ " - command-line: " ++ formatCommandLine bin args ++ "\n"
                                  ++ " - exit code: " ++ show errno' 
diff --git a/test-sandbox.cabal b/test-sandbox.cabal
--- a/test-sandbox.cabal
+++ b/test-sandbox.cabal
@@ -1,5 +1,5 @@
 Name:           test-sandbox
-Version:        0.0.1.12
+Version:        0.0.1.13
 Cabal-Version:  >= 1.14
 Category:       Testing
 Synopsis:       Sandbox for system tests
diff --git a/test/test.hs b/test/test.hs
--- a/test/test.hs
+++ b/test/test.hs
@@ -14,6 +14,7 @@
 import qualified Data.Text as T
 import qualified Data.Map as M
 import System.Posix.Files
+import System.Exit (ExitCode(..))
 import Data.IORef
 import Data.Char
 import Control.Concurrent
@@ -74,6 +75,24 @@
           runSandbox' ref I.isVerbose `shouldReturn` False
           _ <- runSandbox' ref $ setVariable I.verbosityKey True
           runSandbox' ref I.isVerbose `shouldReturn` True
+      it ": run" $ do
+        withSandbox $ \ref -> runSandbox' ref $ do
+          file <- setFile "echoecho"
+                  [str|#!/usr/bin/env bash
+                      |echo "echoecho"
+                      |]
+          liftIO $ setExecuteMode file
+
+          pname1 <- register "echo1" file [] def
+          (exitCode1, mStr1) <- run pname1 1
+          liftIO $ exitCode1 `shouldBe` ExitSuccess
+          liftIO $ mStr1 `shouldBe` Nothing
+
+          pname2 <- register "echo2" file [] def { psCapture = Just CaptureStdout }
+          (exitCode2, mStr2) <- run pname2 1
+          liftIO $ exitCode2 `shouldBe` ExitSuccess
+          liftIO $ mStr2 `shouldBe` Just "echoecho\n"
+
 #if defined(__MACOSX__) ||  defined(__WIN32__)
 #else
     describe "signal test" $ do
