Path: blob/main_old/util/test_utils_unittest_helper.cpp
1693 views
//1// Copyright 2019 The ANGLE Project Authors. All rights reserved.2// Use of this source code is governed by a BSD-style license that can be3// found in the LICENSE file.45// system_utils_unittest_helper.cpp: Helper to the SystemUtils.RunApp unittest67#include "test_utils_unittest_helper.h"89#include "../src/tests/test_utils/runner/TestSuite.h"10#include "common/system_utils.h"1112#include <string.h>1314// This variable is also defined in angle_unittest_main.15bool gVerbose = false;1617int main(int argc, char **argv)18{19bool runTestSuite = false;2021for (int argIndex = 1; argIndex < argc; ++argIndex)22{23if (strcmp(argv[argIndex], kRunTestSuite) == 0)24{25runTestSuite = true;26}27}2829if (runTestSuite)30{31angle::TestSuite testSuite(&argc, argv);32return testSuite.run();33}3435if (argc != 3 || strcmp(argv[1], kRunAppTestArg1) != 0 || strcmp(argv[2], kRunAppTestArg2) != 0)36{37fprintf(stderr, "Expected command line:\n%s %s %s\n", argv[0], kRunAppTestArg1,38kRunAppTestArg2);39return EXIT_FAILURE;40}4142std::string env = angle::GetEnvironmentVar(kRunAppTestEnvVarName);43if (env == "")44{45printf("%s", kRunAppTestStdout);46fflush(stdout);47fprintf(stderr, "%s", kRunAppTestStderr);48}49else50{51fprintf(stderr, "%s", env.c_str());52}5354return EXIT_SUCCESS;55}565758