platform_host_posix.cpp 811 B

123456789101112131415161718192021222324252627282930
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #include <stdio.h> // for freopen
  9. #include <unistd.h> // for getcwd
  10. #include <AzCore/IO/SystemFile.h> // for AZ_MAX_PATH_LEN
  11. namespace AzTestRunner
  12. {
  13. void set_quiet_mode()
  14. {
  15. [[maybe_unused]] auto freopenResult = freopen("/dev/null", "a", stdout);
  16. }
  17. const char* get_current_working_directory()
  18. {
  19. static char cwd_buffer[AZ_MAX_PATH_LEN] = { '\0' };
  20. return getcwd(cwd_buffer, sizeof(cwd_buffer));
  21. }
  22. void pause_on_completion()
  23. {
  24. [[maybe_unused]] auto systemResult = system("pause");
  25. }
  26. }