| // Copyright 2018 The Chromium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| // Simple testing command, used to exercise child process launcher calls. |
| // echo_test_helper [-x exit_code] arg0 arg1 arg2... |
| // Prints arg0..n to stdout with space delimiters between args, |
| // returning "exit_code" if -x is specified. |
| // echo_test_helper -e env_var |
| // Prints the environmental variable |env_var| to stdout. |
| int main(int argc, char** argv) { |
| if (strcmp(argv[1], "-e") == 0) { |
| const char* env = getenv(argv[2]); |
| if (strcmp(argv[1], "-x") == 0) { |
| return_code = atoi(argv[2]); |
| for (int i = start_idx; i < argc; ++i) { |
| printf((i < argc - 1 ? "%s " : "%s"), argv[i]); |