test-linux.sh 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #!/bin/bash
  2. #
  3. # Copyright (c) Contributors to the Open 3D Engine Project.
  4. # For complete copyright and license terms please see the LICENSE at the root of this distribution.
  5. #
  6. # SPDX-License-Identifier: Apache-2.0 OR MIT
  7. #
  8. #
  9. # Reset any existing test folder
  10. rm -rf temp/build_test
  11. mkdir temp/build_test
  12. # Make sure we are running on the target architecture
  13. TARGET_ARCH=${1:-$(uname -m)}
  14. CURRENT_HOST_ARCH=$(uname -m)
  15. if [ "${CURRENT_HOST_ARCH}" != ${TARGET_ARCH} ]
  16. then
  17. echo "Warning: Tests for packages on target ${TARGET_ARCH} can only be run on ${TARGET_ARCH}. Skipping tests."
  18. exit 0
  19. fi
  20. echo "TEMP=${TEMP_FOLDER}"
  21. TEST_CMAKE_MODULE_PATH="${TEMP_FOLDER}/OpenSSL-1.1.1t-rev1-linux;$PACKAGE_ROOT"
  22. echo "TEST_CMAKE_MODULE_PATH=${TEST_CMAKE_MODULE_PATH}"
  23. # Build the test program
  24. cmake -S test -B temp/build_test -DCMAKE_MODULE_PATH="$TEST_CMAKE_MODULE_PATH" -DCMAKE_BUILD_TYPE=Release
  25. if [ $? -ne 0 ]
  26. then
  27. echo "Error generating the test project"
  28. exit 1
  29. fi
  30. cmake --build temp/build_test -v
  31. if [ $? -ne 0 ]
  32. then
  33. echo "Error building the test project"
  34. exit 1
  35. fi
  36. echo Executing test_AWSGameLift
  37. ./temp/build_test/test_AWSGameLift
  38. if [ $? -ne 0 ]
  39. then
  40. echo "Package test failed"
  41. exit 1
  42. fi
  43. echo "Package test passed"
  44. exit 0