#!/bin/bash
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

set -f

basepath=$(dirname "${0}")
files=( $(find . -name '*-test.rb') )

test_suite="${basepath}/all_tests.rb"
touch "${test_suite}"

echo "require \"test/unit\"" > "${test_suite}"
echo "discovered the following files:"
for i in "${files[@]}"
do
    filename="${i#"${basepath}/"}"
    echo "${filename}"
    echo "require_relative \"${filename}\"" >> "${test_suite}"
done

ruby "${test_suite}"

rm "${test_suite}"

#!/bin/bash
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

set -f

basepath=$(dirname "${0}")
files=( $(find . -name '*-test.rb') )

test_suite="${basepath}/all_tests.rb"
touch "${test_suite}"

echo "require \"test/unit\"" > "${test_suite}"
echo "discovered the following files:"
for i in "${files[@]}"
do
    filename="${i#"${basepath}/"}"
    echo "${filename}"
    echo "require_relative \"${filename}\"" >> "${test_suite}"
done

ruby -Itest "${test_suite}"
RES=$?
rm "${test_suite}"
exit $RES

Connect Ruby tests with Sandcastle
Connect Ruby tests with Sandcastle

Summary:
This PR adds a step in the iOS legocastle script to run the ruby tests in the cocoapods folder.

These tests are executed before the pod installation step: this because we would like to fail as fast as possible in case of issues.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D36006781

fbshipit-source-id: 8afbc1ccc751d2dc736bdc23ec382ebd7b5c7f4f
