Skip to content
Merged
Show file tree
Hide file tree
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
6 changes: 3 additions & 3 deletions eng/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ while [[ $# > 0 ]]; do
opt="$(echo "${1/#--/-}" | tr "[:upper:]" "[:lower:]")"

if [[ $firstArgumentChecked -eq 0 && $opt =~ ^[a-zA-Z.+]+$ ]]; then
if [ $opt == "help" ]; then
if [[ "$opt" == "help" ]]; then
showSubsetHelp
exit 0
fi
Expand All @@ -190,7 +190,7 @@ while [[ $# > 0 ]]; do
exit 0
else
passedSubset="$(echo "$2" | tr "[:upper:]" "[:lower:]")"
if [ $passedSubset == "help" ]; then
if [[ "$passedSubset" == "help" ]]; then
showSubsetHelp
exit 0
fi
Expand Down Expand Up @@ -461,7 +461,7 @@ if [ ${#actInt[@]} -eq 0 ]; then
arguments="-restore -build $arguments"
fi

if [ "$os" = "Browser" ] && [ "$arch" != "wasm" ]; then
if [[ "$os" == "Browser" && "$arch" != "wasm" ]]; then
# override default arch for Browser, we only support wasm
arch=wasm
fi
Expand Down
5 changes: 2 additions & 3 deletions eng/formatting/format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,19 @@ MANAGED_FILES=$(git diff --cached --name-only --diff-filter=ACM "*.cs" "*.vb" |

exec 1>&2

if [[ -n "$NATIVE_FILES" ]]; then
if [ -n "$NATIVE_FILES" ]; then
# Format all selected files
echo "$NATIVE_FILES" | cat | xargs | sed -e 's/ /,/g' | xargs "./artifacts/tools/clang-format" -style=file -i

# Add back the modified files to staging
echo "$NATIVE_FILES" | xargs git add
fi
if [[ -n "$MANAGED_FILES" ]]; then
if [ -n "$MANAGED_FILES" ]; then
# Format all selected files
echo "$MANAGED_FILES" | cat | xargs | sed -e 's/ /,/g' | dotnet format --include

# Add back the modified files to staging
echo "$MANAGED_FILES" | xargs git add
fi


exit 0
2 changes: 1 addition & 1 deletion eng/install-native-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ if [ "$1" = "Linux" ]; then
if [ "$?" != "0" ]; then
exit 1;
fi
elif [ "$1" = "MacCatalyst" ] || [ "$1" = "OSX" ] || [ "$1" = "tvOS" ] || [ "$1" = "iOS" ]; then
elif [[ "$1" == "MacCatalyst" || "$1" == "OSX" || "$1" == "tvOS" || "$1" == "iOS" ]]; then
engdir=$(dirname "${BASH_SOURCE[0]}")

echo "Installed xcode version: `xcode-select -p`"
Expand Down
2 changes: 1 addition & 1 deletion eng/native/build-commons.sh
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ if [[ "$__CrossBuild" == 1 ]]; then
CROSSCOMPILE=1
export CROSSCOMPILE
# Darwin that doesn't use rootfs
if [[ ! -n "$ROOTFS_DIR" && "$platform" != "Darwin" ]]; then
if [[ -z "$ROOTFS_DIR" && "$platform" != "Darwin" ]]; then
ROOTFS_DIR="$__RepoRootDir/.tools/rootfs/$__BuildArch"
export ROOTFS_DIR
fi
Expand Down
2 changes: 1 addition & 1 deletion eng/native/init-distro-rid.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ initNonPortableDistroRid()
# We have forced __PortableBuild=0. This is because -portablebuld
# has been passed as false.
if (( isPortable == 0 )); then
if [ "${ID}" = "rhel" ] || [ "${ID}" = "rocky" ]; then
if [[ "${ID}" == "rhel" || "${ID}" == "rocky" ]]; then
# remove the last version digit
VERSION_ID="${VERSION_ID%.*}"
fi
Expand Down
4 changes: 2 additions & 2 deletions eng/pipelines/evaluate-changed-paths.sh
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ probePaths() {
echo "******* Probing $_subset exclude paths *******";
for _path in "${exclude_paths[@]}"; do
echo "$_path"
if [[ "$exclude_path_string" == "" ]]; then
if [[ -z "$exclude_path_string" ]]; then
exclude_path_string=":!$_path"
else
exclude_path_string="$exclude_path_string :!$_path"
Expand All @@ -159,7 +159,7 @@ probePaths() {
echo "******* Probing $_subset include paths *******";
for _path in "${include_paths[@]}"; do
echo "$_path"
if [[ "$include_path_string" == "" ]]; then
if [[ -z "$include_path_string" ]]; then
include_path_string=":$_path"
else
include_path_string="$include_path_string :$_path"
Expand Down
28 changes: 10 additions & 18 deletions eng/run-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -236,35 +236,30 @@ done

# Compute paths to the binaries if they haven't already been computed

if [ -z "$Runtime" ]
then
if [[ -z "$Runtime" ]]; then
Runtime="$ProjectRoot/artifacts/bin/testhost/netcoreapp-$OS-$Configuration-$__Arch"
fi

if [ -z "$CoreFxTests" ]
then
if [[ -z "$CoreFxTests" ]]; then
CoreFxTests="$ProjectRoot/artifacts/bin"
fi

# Check parameters up front for valid values:

if [ "$Configuration" != "Debug" ] && [ "$Configuration" != "Release" ]
then
if [[ "$Configuration" != "Debug" && "$Configuration" != "Release" ]]; then
echo "error: Configuration should be Debug or Release"
exit 1
fi

if [ "$OS" != "FreeBSD" ] && [ "$OS" != "Linux" ] && [ "$OS" != "NetBSD" ] && [ "$OS" != "illumos" ] && [ "$OS" != "Solaris" ]
then
if [[ "$OS" != "FreeBSD" && "$OS" != "Linux" && "$OS" != "NetBSD" && "$OS" != "illumos" && "$OS" != "Solaris" ]]; then
echo "error: OS should be FreeBSD, Linux, NetBSD or Linux"
exit 1
fi

export CORECLR_SERVER_GC="$serverGC"
export PAL_OUTPUTDEBUGSTRING="1"

if [ -z "$LANG" ]
then
if [[ -z "$LANG" ]]; then
export LANG="en_US.UTF-8"
fi

Expand All @@ -281,29 +276,26 @@ ensure_binaries_are_present
TestsFailed=0
numberOfProcesses=0

if [ $RunTestSequential -eq 1 ]
then
if [[ $RunTestSequential -eq 1 ]]; then
maxProcesses=1;
else
platform="$(uname)"
if [ "$platform" = "FreeBSD" ]; then
if [[ "$platform" == "FreeBSD" ]]; then
maxProcesses=$(($(sysctl -n hw.ncpu)+1))
if [ "$platform" = "NetBSD" ] || [ "$platform" = "SunOS" ] ; then
if [[ "$platform" == "NetBSD" || "$platform" == "SunOS" ]]; then
maxProcesses=$(($(getconf NPROCESSORS_ONLN)+1))
else
maxProcesses=$(($(getconf _NPROCESSORS_ONLN)+1))
fi
fi

if [ -n "$TestDirFile" ] || [ -n "$TestDir" ]
then
if [[ -n "$TestDirFile" || -n "$TestDir" ]]; then
run_selected_tests
else
run_all_tests "$CoreFxTests/tests/"*.Tests
fi

if [ "$TestsFailed" -gt 0 ]
then
if [[ "$TestsFailed" -gt 0 ]]; then
echo "$TestsFailed test(s) failed"
else
echo "All tests passed."
Expand Down
4 changes: 2 additions & 2 deletions eng/testing/AndroidRunnerTemplate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ TARGET_OS=$3
TEST_NAME=$4
XHARNESS_OUT="$EXECUTION_DIR/xharness-output"

if [ -n "$5" ]; then
if [[ -n "$5" ]]; then
ADDITIONAL_ARGS=${@:5}
fi

Expand All @@ -27,7 +27,7 @@ while true; do
fi
done

if [ ! -z "$XHARNESS_CLI_PATH" ]; then
if [[ -n "$XHARNESS_CLI_PATH" ]]; then
# Allow overriding the path to the XHarness CLI DLL,
# we need to call it directly via dotnet exec
HARNESS_RUNNER="dotnet exec $XHARNESS_CLI_PATH"
Expand Down
4 changes: 2 additions & 2 deletions eng/testing/AppleRunnerTemplate.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bash
#!/usr/bin/env bash

# NOTE: this script is only used locally, on CI we use the Helix SDK from arcade

Expand Down Expand Up @@ -54,7 +54,7 @@ while true; do
fi
done

if [ ! -z "$XHARNESS_CLI_PATH" ]; then
if [[ -n "$XHARNESS_CLI_PATH" ]]; then
# Allow overriding the path to the XHarness CLI DLL,
# we need to call it directly via dotnet exec
HARNESS_RUNNER="dotnet exec $XHARNESS_CLI_PATH"
Expand Down
14 changes: 7 additions & 7 deletions eng/testing/RunnerTemplate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ while [[ $# > 0 ]]; do
shift
done

if [ "$RUNTIME_PATH" == "" ]; then
if [[ -z "$RUNTIME_PATH" ]]; then
echo "error: -r|--runtime-path argument is required."
usage
exit -1
Expand Down Expand Up @@ -127,15 +127,15 @@ function copy_core_file_to_temp_location {
}

# ========================= BEGIN Core File Setup ============================
if [ "$(uname -s)" == "Darwin" ]; then
if [[ "$(uname -s)" == "Darwin" ]]; then
# On OS X, we will enable core dump generation only if there are no core
# files already in /cores/ at this point. This is being done to prevent
# inadvertently flooding the CI machines with dumps.
if [[ ! -d "/cores" || ! "$(ls -A /cores)" ]]; then
ulimit -c unlimited
fi

elif [ "$(uname -s)" == "Linux" ]; then
elif [[ "$(uname -s)" == "Linux" ]]; then
# On Linux, we'll enable core file generation unconditionally, and if a dump
# is generated, we will print some useful information from it and delete the
# dump immediately.
Expand Down Expand Up @@ -163,7 +163,7 @@ test_exitcode=$?
popd
echo ----- end $(date) ----- exit code $test_exitcode ----------------------------------------------------------

if [ "${exitcode_list[$test_exitcode]}" != "" ]; then
if [[ -n "${exitcode_list[$test_exitcode]}" ]]; then
echo exit code $test_exitcode means ${exitcode_list[$test_exitcode]}
fi
# ========================= END Test Execution ===============================
Expand Down Expand Up @@ -200,11 +200,11 @@ if [[ "$(uname -s)" == "Linux" && $test_exitcode -ne 0 ]]; then
# or "core.<PID>" by default. We read /proc/sys/kernel/core_uses_pid to
# determine which it is.
core_name_uses_pid=0
if [ -e /proc/sys/kernel/core_uses_pid ] && [ "1" == $(cat /proc/sys/kernel/core_uses_pid) ]; then
if [[ -e /proc/sys/kernel/core_uses_pid && "1" == $(cat /proc/sys/kernel/core_uses_pid) ]]; then
core_name_uses_pid=1
fi

if [ $core_name_uses_pid == "1" ]; then
if [[ "$core_name_uses_pid" == "1" ]]; then
# We don't know what the PID of the process was, so let's look at all core
# files whose name matches core.NUMBER
echo Looking for files matching core.* ...
Expand All @@ -224,7 +224,7 @@ popd >/dev/null
# ======================== END Core File Inspection ==========================
# The helix work item should not exit with non-zero if tests ran and produced results
# The special console runner for runtime returns 1 when tests fail
if [ "$test_exitcode" == "1" ]; then
if [[ "$test_exitcode" == "1" ]]; then
if [ -n "$HELIX_WORKITEM_PAYLOAD" ]; then
exit 0
fi
Expand Down
4 changes: 2 additions & 2 deletions eng/testing/WasmRunnerAOTTemplate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ else
XHARNESS_OUT="$HELIX_WORKITEM_UPLOAD_ROOT/xharness-output"
fi

if [ ! -z "$XHARNESS_CLI_PATH" ]; then
if [[ -n "$XHARNESS_CLI_PATH" ]]; then
# When running in CI, we only have the .NET runtime available
# We need to call the XHarness CLI DLL directly via dotnet exec
HARNESS_RUNNER="dotnet exec $XHARNESS_CLI_PATH"
else
HARNESS_RUNNER="dotnet xharness"
fi

if [ "$SCENARIO" == "WasmTestOnBrowser" ]; then
if [[ "$SCENARIO" == "WasmTestOnBrowser" ]]; then
XHARNESS_COMMAND="test-browser"
elif [ -z "$XHARNESS_COMMAND" ]; then
XHARNESS_COMMAND="test"
Expand Down
8 changes: 4 additions & 4 deletions eng/testing/WasmRunnerTemplate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,23 @@ SCENARIO=$3

cd $EXECUTION_DIR

if [ -z "$HELIX_WORKITEM_UPLOAD_ROOT" ]; then
if [[ -z "$HELIX_WORKITEM_UPLOAD_ROOT" ]]; then
XHARNESS_OUT="$EXECUTION_DIR/xharness-output"
else
XHARNESS_OUT="$HELIX_WORKITEM_UPLOAD_ROOT/xharness-output"
fi

if [ ! -z "$XHARNESS_CLI_PATH" ]; then
if [[ -n "$XHARNESS_CLI_PATH" ]]; then
# When running in CI, we only have the .NET runtime available
# We need to call the XHarness CLI DLL directly via dotnet exec
HARNESS_RUNNER="dotnet exec $XHARNESS_CLI_PATH"
else
HARNESS_RUNNER="dotnet xharness"
fi

if [ "$SCENARIO" == "WasmTestOnBrowser" ]; then
if [[ "$SCENARIO" == "WasmTestOnBrowser" ]]; then
XHARNESS_COMMAND="test-browser"
elif [ -z "$XHARNESS_COMMAND" ]; then
elif [[ -z "$XHARNESS_COMMAND" ]]; then
XHARNESS_COMMAND="test"
fi

Expand Down
Loading