folly/test/TimeseriesTest.cpp: avoid shadowing warnings
[folly.git] / folly / test / SubprocessTest.cpp
index 0b0bb9ae4eddf6481c0af18d9c65079ab4171b4b..b3a0cf6de7f14113739308c5c406756ca78766f4 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016 Facebook, Inc.
+ * Copyright 2017 Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 
 #include <folly/Subprocess.h>
 
-#include <unistd.h>
 #include <sys/types.h>
 
 #include <boost/container/flat_set.hpp>
 #include <glog/logging.h>
-#include <gtest/gtest.h>
 
 #include <folly/Exception.h>
 #include <folly/Format.h>
 #include <folly/gen/String.h>
 #include <folly/experimental/TestUtil.h>
 #include <folly/experimental/io/FsUtil.h>
-#include <folly/portability/Dirent.h>
+#include <folly/portability/GTest.h>
+#include <folly/portability/Unistd.h>
+
+FOLLY_GCC_DISABLE_WARNING(deprecated-declarations)
 
 using namespace folly;
 
@@ -198,7 +199,7 @@ TEST(SimpleSubprocessTest, FdLeakTest) {
   checkFdLeak([] {
     try {
       Subprocess proc(std::vector<std::string>({"/no/such/file"}),
-                      Subprocess::pipeStdout().stderr(Subprocess::PIPE));
+                      Subprocess::pipeStdout().stderrFd(Subprocess::PIPE));
       ADD_FAILURE() << "expected an error when running /no/such/file";
     } catch (const SubprocessSpawnError& ex) {
       EXPECT_EQ(ENOENT, ex.errnoValue());
@@ -235,7 +236,7 @@ TEST(ParentDeathSubprocessTest, ParentDeathSignal) {
 TEST(PopenSubprocessTest, PopenRead) {
   Subprocess proc("ls /", Subprocess::pipeStdout());
   int found = 0;
-  gen::byLine(File(proc.stdout())) |
+  gen::byLine(File(proc.stdoutFd())) |
     [&] (StringPiece line) {
       if (line == "etc" || line == "bin" || line == "usr") {
         ++found;