/*
- * 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/portability/GTest.h>
#include <folly/portability/Unistd.h>
+FOLLY_GCC_DISABLE_WARNING(deprecated-declarations)
+
using namespace folly;
TEST(SimpleSubprocessTest, ExitsSuccessfully) {
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;