/*
- * 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;
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());
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;