Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 5 additions & 18 deletions src/coreclr/pal/tests/palsuite/runpaltests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,26 +19,18 @@ echo "***** Testing PAL *****"
echo

# Store the location of the root of build directory
BUILD_ROOT_DIR=$1
if [ -d "$(pwd)/$BUILD_ROOT_DIR" ]; then
BUILD_ROOT_DIR="$(pwd)/$BUILD_ROOT_DIR"
if [ ! -e "$1" ]; then
echo "Core_Root not found at $1"
exit 1
fi
BUILD_ROOT_DIR="$(cd "$1"; pwd -P)"

# Create path to the compiled PAL tets in the build directory
PAL_TEST_BUILD=$BUILD_ROOT_DIR
echo Running PAL tests from $PAL_TEST_BUILD

pushd $BUILD_ROOT_DIR

export LD_LIBRARY_PATH=$BUILD_ROOT_DIR:$LD_LIBRARY_PATH

# Create absolute path to the file that contains a list of PAL tests to execute.
# This file is located next to this script in the source tree
RELATIVE_PATH_TO_PAL_TESTS=$0
# Remove the name of this script from the path
RELATIVE_PATH_TO_PAL_TESTS=${RELATIVE_PATH_TO_PAL_TESTS%/*.*}
# Change current directory to the location of this script
cd $RELATIVE_PATH_TO_PAL_TESTS
# Environment variable PWD contains absolute path to the current folder
# so use it to create absolute path to the file with a list of tests.
PAL_TEST_LIST=$BUILD_ROOT_DIR/paltestlist.txt
Expand Down Expand Up @@ -79,8 +71,6 @@ then
fi
fi

cd $PAL_TEST_OUTPUT_DIR
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are few other cd xxx and pushd xxx/popd in this script, do we need those?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I remove all what I can. And nothing else matters.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now the log output is much cleaner. 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is important for me as newcomer, is that I should not learn which "errors" are not actual errors. I always trying to assume that infra is right, and I'm wrong. I understand that path which I take to find this issue not that straight 😄

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is always room for improvement. :)
PAL tests are mainly used (and become important) when support for a new platform (OS, architecture, libc) is added. Since that does not happen quite often, so this infra gets stale from time to time. These tests were added in the CI pipeline (namely, innerloop), so it is at least functional.


echo PAL tests will store their temporary files and output in $PAL_TEST_OUTPUT_DIR.
if [ "$COPY_TO_TEST_OUTPUT_DIR" != "$PAL_TEST_OUTPUT_DIR" ]; then
echo Output files will be copied to $COPY_TO_TEST_OUTPUT_DIR at the end.
Expand Down Expand Up @@ -115,7 +105,6 @@ else
COPY_TO_TEST_OUTPUT_DIR=$PAL_TEST_OUTPUT_DIR
fi
fi
cd $PAL_TEST_OUTPUT_DIR

echo
echo "Running tests..."
Expand All @@ -133,7 +122,7 @@ do
# Create a folder with the test name, and use that as the working directory for the test. Many PAL tests don't clean up after
# themselves and may leave files/directories around, but even to handle test failures that result in a dirty state, run each
# test in its own folder.
TEST_WORKING_DIR=$(basename $TEST_NAME)
TEST_WORKING_DIR=$PAL_TEST_OUTPUT_DIR/$(basename $TEST_NAME)
if [ -e $TEST_WORKING_DIR ]; then
rm -f -r $TEST_WORKING_DIR
fi
Expand Down Expand Up @@ -233,8 +222,6 @@ if [ "$COPY_TO_TEST_OUTPUT_DIR" != "$PAL_TEST_OUTPUT_DIR" ]; then
echo Copied PAL test output files to $COPY_TO_TEST_OUTPUT_DIR.
fi

popd

# Set exit code to be equal to the number PAL tests that have failed.
# Exit code 0 indicates success.
exit $NUMBER_OF_FAILED_TESTS