diff --git a/cabal-install/Main.hs b/cabal-install/Main.hs
index f25ecebf4f413b7d64f31e02e98d860af269a50d..489d69abcbd4b2bb747867083fea004094e0b8ff 100644
--- a/cabal-install/Main.hs
+++ b/cabal-install/Main.hs
@@ -111,7 +111,8 @@ import Distribution.Client.Utils              (determineNumJobs
                                               ,existsAndIsMoreRecentThan)
 
 import Distribution.PackageDescription
-         ( Executable(..), benchmarkName, testName )
+         ( Executable(..), benchmarkName, benchmarkBuildInfo, testName
+         , testBuildInfo, buildable )
 import Distribution.PackageDescription.Parse
          ( readPackageDescription )
 import Distribution.PackageDescription.PrettyPrint
@@ -730,21 +731,29 @@ testAction (testFlags, buildFlags, buildExFlags) extraArgs globalFlags = do
   -- the package was just configured, so the LBI must be available
   lbi <- getPersistBuildConfig distPref
   let pkgDescr = LBI.localPkgDescr lbi
-      nameTestsOnly = LBI.foldComponent (const Nothing)
-                                        (const Nothing)
-                                        (Just . testName)
-                                        (const Nothing)
+      nameTestsOnly =
+        LBI.foldComponent
+          (const Nothing)
+          (const Nothing)
+          (\t ->
+            if buildable (testBuildInfo t)
+              then Just (testName t)
+            else Nothing)
+          (const Nothing)
       tests = mapMaybe nameTestsOnly $ LBI.pkgComponents pkgDescr
       extraArgs'
         | null extraArgs = tests
         | otherwise = extraArgs
 
-  maybeWithSandboxDirOnSearchPath useSandbox $
-    build verbosity config distPref buildFlags' extraArgs'
+  if null tests
+    then notice verbosity "Package has no buildable test suites."
+    else do
+      maybeWithSandboxDirOnSearchPath useSandbox $
+        build verbosity config distPref buildFlags' extraArgs'
 
-  maybeWithSandboxDirOnSearchPath useSandbox $
-    setupWrapper verbosity setupOptions Nothing
-      Cabal.testCommand (const testFlags) extraArgs'
+      maybeWithSandboxDirOnSearchPath useSandbox $
+        setupWrapper verbosity setupOptions Nothing
+          Cabal.testCommand (const testFlags) extraArgs'
 
 benchmarkAction :: (BenchmarkFlags, BuildFlags, BuildExFlags)
                    -> [String] -> GlobalFlags
@@ -775,21 +784,29 @@ benchmarkAction (benchmarkFlags, buildFlags, buildExFlags)
   -- the package was just configured, so the LBI must be available
   lbi <- getPersistBuildConfig distPref
   let pkgDescr = LBI.localPkgDescr lbi
-      nameBenchsOnly = LBI.foldComponent (const Nothing)
-                                         (const Nothing)
-                                         (const Nothing)
-                                         (Just . benchmarkName)
+      nameBenchsOnly =
+        LBI.foldComponent
+          (const Nothing)
+          (const Nothing)
+          (const Nothing)
+          (\b ->
+            if buildable (benchmarkBuildInfo b)
+              then Just (benchmarkName b)
+            else Nothing)
       benchs = mapMaybe nameBenchsOnly $ LBI.pkgComponents pkgDescr
       extraArgs'
         | null extraArgs = benchs
         | otherwise = extraArgs
 
-  maybeWithSandboxDirOnSearchPath useSandbox $
-    build verbosity config distPref buildFlags' extraArgs'
+  if null benchs
+    then notice verbosity "Package has no buildable benchmarks."
+    else do
+      maybeWithSandboxDirOnSearchPath useSandbox $
+        build verbosity config distPref buildFlags' extraArgs'
 
-  maybeWithSandboxDirOnSearchPath useSandbox $
-    setupWrapper verbosity setupOptions Nothing
-      Cabal.benchmarkCommand (const benchmarkFlags) extraArgs'
+      maybeWithSandboxDirOnSearchPath useSandbox $
+        setupWrapper verbosity setupOptions Nothing
+          Cabal.benchmarkCommand (const benchmarkFlags) extraArgs'
 
 haddockAction :: HaddockFlags -> [String] -> GlobalFlags -> IO ()
 haddockAction haddockFlags extraArgs globalFlags = do