From e45d36c49b4edf344b71b5d0d531ca1d47ca06cd Mon Sep 17 00:00:00 2001 From: Eric Berquist Date: Wed, 20 Sep 2023 09:09:37 -0600 Subject: [PATCH 1/7] Initial pre-commit configuration --- .pre-commit-config.yaml | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .pre-commit-config.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..9d197716 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,39 @@ +--- +fail_fast: false +repos: + - repo: meta + hooks: + - id: check-hooks-apply + - id: check-useless-excludes + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: "v4.6.0" + hooks: + - id: check-added-large-files + - id: check-case-conflict + - id: check-merge-conflict + - id: check-yaml + - id: end-of-file-fixer + - id: fix-byte-order-marker + - id: mixed-line-ending + args: [--fix, "lf"] + - id: no-commit-to-branch + args: [--branch, main, --branch, master, --branch, devel] + - id: trailing-whitespace + exclude: | + (?x)( + \.diff$| + \.patch$ + ) + - repo: https://github.com/adrienverge/yamllint + rev: "v1.35.1" + hooks: + - id: yamllint + - repo: https://github.com/shellcheck-py/shellcheck-py + rev: v0.10.0.1 + hooks: + - id: shellcheck + exclude: test/utilities/shunit2/ + - repo: https://github.com/Mateusz-Grzelinski/actionlint-py + rev: "v1.7.1.15" + hooks: + - id: actionlint From e5f199b6dd4f1e000e4a325ef1726d7065508d26 Mon Sep 17 00:00:00 2001 From: Eric Berquist Date: Wed, 20 Sep 2023 11:23:01 -0600 Subject: [PATCH 2/7] Initial GitHub CI setup for pre-commit --- .github/workflows/pre-commit.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 .github/workflows/pre-commit.yml diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml new file mode 100644 index 00000000..c2a1ed45 --- /dev/null +++ b/.github/workflows/pre-commit.yml @@ -0,0 +1,16 @@ +--- +# In the absence of using the pre-commit.ci service... +name: pre-commit + +# yamllint disable-line rule:truthy +on: + pull_request: + push: + +jobs: + pre-commit: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v3 + - uses: pre-commit/action@v3.0.0 From 4b90cabc6c4e85dde3000cb320f42b3d031edc0a Mon Sep 17 00:00:00 2001 From: Eric Berquist Date: Fri, 9 Aug 2024 14:04:09 -0600 Subject: [PATCH 3/7] shellcheck fixes on buildsys/deps/include/depsDefinitions.sh --- .pre-commit-config.yaml | 27 +++++++++++++++++++++++- buildsys/deps/include/depsDefinitions.sh | 15 ++++++------- 2 files changed, 33 insertions(+), 9 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9d197716..6f816f58 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -32,7 +32,32 @@ repos: rev: v0.10.0.1 hooks: - id: shellcheck - exclude: test/utilities/shunit2/ + exclude: | + (?x)( + buildsys/bamboo.sh| + buildsys/deps/bin/sstDep_dramsim3_stabledevel.sh| + buildsys/deps/bin/sstDep_dramsim_masterlatest.sh| + buildsys/deps/bin/sstDep_dramsim_r4b00b22.sh| + buildsys/deps/bin/sstDep_dramsim_stabledevel.sh| + buildsys/deps/bin/sstDep_dramsim_static.sh| + buildsys/deps/bin/sstDep_dramsim_v2.2.1.sh| + buildsys/deps/bin/sstDep_dramsim_v2.2.2.sh| + buildsys/deps/bin/sstDep_dramsim_v2.2.sh| + buildsys/deps/bin/sstDependencies.sh| + buildsys/deps/bin/sstDep_goblin_hmcsim_stabledevel.sh| + buildsys/deps/bin/sstDep_GPGPUSim.sh| + buildsys/deps/bin/sstDep_hbm_dramsim2_stabledevel.sh| + buildsys/deps/bin/sstDep_hybridsim.sh| + buildsys/deps/bin/sstDep_nvdimmsim.sh| + buildsys/deps/bin/sstDep_ramulator_stabledevel.sh| + test/utilities/shunit2/| + test/include/testDefinitions.sh| + test/include/testSubroutines.sh| + test/testSuites/testSuite_gpgpu.sh| + test/testSuites/testSuite_macro.sh| + test/utilities/moduleex.sh| + test/utilities/TimeoutEx.sh + ) - repo: https://github.com/Mateusz-Grzelinski/actionlint-py rev: "v1.7.1.15" hooks: diff --git a/buildsys/deps/include/depsDefinitions.sh b/buildsys/deps/include/depsDefinitions.sh index f8f1d09b..809b7e5d 100755 --- a/buildsys/deps/include/depsDefinitions.sh +++ b/buildsys/deps/include/depsDefinitions.sh @@ -16,7 +16,8 @@ if [[ ${SST_ROOT:+isSet} != isSet ]] then # If SST_ROOT has NOT been set, assume SST_ROOT is up 2 levels from # the directory that this file (depsDefinitions.sh) resides in. - export SST_ROOT="$( cd -P "$( dirname "$0" )"/../.. && pwd )" + SST_ROOT="$( cd -P "$( dirname "$0" )"/../.. && pwd )" + export SST_ROOT fi if [[ ${SST_BASE:+isSet} != isSet ]] @@ -79,9 +80,9 @@ export PATH=${PATH}:${SST_DEPS_BIN} # System definitions #=============================================================================== -SST_DEPS_CPU_ARCH=`uname -m` # uname CPU architecture -SST_DEPS_OS_NAME=`uname -s` # uname OS name -SST_DEPS_OS_RELEASE=`uname -r` # uname OS release +# Because this script is sourced, this variable is not actually unused. +# shellcheck disable=SC2034 +SST_DEPS_OS_NAME="$(uname -s)" #=============================================================================== # Global utilities @@ -157,9 +158,9 @@ sstDepsCheckSha1 () done # get SHA1 hash for given file - calculated_hash=`openssl sha1 ${filename} | awk '{ print $NF }'` + calculated_hash="$(openssl sha1 "${filename}" | awk '{ print $NF }')" - if [ ${calculated_hash} = ${expected_hash} ] + if [[ "${calculated_hash}" == "${expected_hash}" ]] then echo "sstDepsSha1IsValid (): Good SHA1 of ${filename}. Expected ${expected_hash}, got ${calculated_hash}" echo "sstDepsSHA1IsValid (): File content consistent with expected SHA1." @@ -184,8 +185,6 @@ sstDepsCheckSha1 () # echo "DBG depsDefinitions.sh: SST_DEPS_SRC_PRISTINE = ${SST_DEPS_SRC_PRISTINE}" # echo "DBG depsDefinitions.sh: SST_DEPS_SRC_STAGING = ${SST_DEPS_SRC_STAGING}" # echo "DBG depsDefinitions.sh: SST_DEPS_PATCHFILES = ${SST_DEPS_PATCHFILES}" -# echo "DBG depsDefinitions.sh: SST_DEPS_CPU_ARCH = ${SST_DEPS_CPU_ARCH}" # echo "DBG depsDefinitions.sh: PATH = ${PATH}" # echo "DBG depsDefinitions.sh: SST_DEPS_OS_NAME = ${SST_DEPS_OS_NAME}" -# echo "DBG depsDefinitions.sh: SST_DEPS_OS_RELEASE = ${SST_DEPS_OS_RELEASE}" # DEBUG From 117ae7ee565c3cc9cfe7da83c2e4792f7f4e835c Mon Sep 17 00:00:00 2001 From: Eric Berquist Date: Fri, 9 Aug 2024 14:55:20 -0600 Subject: [PATCH 4/7] shellcheck fixes on buildsys/deps/bin/sstDependencies.sh --- .pre-commit-config.yaml | 1 - .shellcheckrc | 2 + buildsys/deps/bin/sstDependencies.sh | 156 ++++++++++++++------------- 3 files changed, 82 insertions(+), 77 deletions(-) create mode 100644 .shellcheckrc diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6f816f58..ac8f99bf 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -43,7 +43,6 @@ repos: buildsys/deps/bin/sstDep_dramsim_v2.2.1.sh| buildsys/deps/bin/sstDep_dramsim_v2.2.2.sh| buildsys/deps/bin/sstDep_dramsim_v2.2.sh| - buildsys/deps/bin/sstDependencies.sh| buildsys/deps/bin/sstDep_goblin_hmcsim_stabledevel.sh| buildsys/deps/bin/sstDep_GPGPUSim.sh| buildsys/deps/bin/sstDep_hbm_dramsim2_stabledevel.sh| diff --git a/.shellcheckrc b/.shellcheckrc new file mode 100644 index 00000000..0b1ebe03 --- /dev/null +++ b/.shellcheckrc @@ -0,0 +1,2 @@ +disable=SC2164 +external-sources=true diff --git a/buildsys/deps/bin/sstDependencies.sh b/buildsys/deps/bin/sstDependencies.sh index 10b9790d..6b07ab34 100755 --- a/buildsys/deps/bin/sstDependencies.sh +++ b/buildsys/deps/bin/sstDependencies.sh @@ -1,5 +1,4 @@ #!/bin/bash -# sstDependencies.sh # Description: @@ -23,7 +22,8 @@ # 4) The directory ${SST_DEPS_INSTALL_DEPS} is writeable PARENT_DIR="$( cd -P "$( dirname "$0" )"/.. && pwd )" -. ${PARENT_DIR}/include/depsDefinitions.sh +# shellcheck source=buildsys/deps/include/depsDefinitions.sh +. "${PARENT_DIR}"/include/depsDefinitions.sh #------------------------------------------------------------------------------- @@ -47,7 +47,7 @@ sstDepsDoStaging () # staging. Staging order should not matter here. # - if [ ! -z "${SST_BUILD_DRAMSIM}" ] + if [ -n "${SST_BUILD_DRAMSIM}" ] then #----------------------------------------------------------------------- # DRAMSim @@ -62,7 +62,7 @@ sstDepsDoStaging () fi fi - if [ ! -z "${SST_BUILD_DRAMSIM3}" ] + if [ -n "${SST_BUILD_DRAMSIM3}" ] then #----------------------------------------------------------------------- # DRAMsim3 @@ -77,7 +77,7 @@ sstDepsDoStaging () fi fi - if [ ! -z "${SST_BUILD_GPGPUSIM}" ] + if [ -n "${SST_BUILD_GPGPUSIM}" ] then #----------------------------------------------------------------------- # GPGPUSim @@ -92,7 +92,7 @@ sstDepsDoStaging () fi fi - if [ ! -z "${SST_BUILD_NVDIMMSIM}" ] + if [ -n "${SST_BUILD_NVDIMMSIM}" ] then #----------------------------------------------------------------------- # NVDIMMSim @@ -107,7 +107,7 @@ sstDepsDoStaging () fi fi - if [ ! -z "${SST_BUILD_HYBRIDSIM}" ] + if [ -n "${SST_BUILD_HYBRIDSIM}" ] then #----------------------------------------------------------------------- # HybridSim @@ -122,7 +122,7 @@ sstDepsDoStaging () fi fi - if [ ! -z "${SST_BUILD_GOBLIN_HMCSIM}" ] + if [ -n "${SST_BUILD_GOBLIN_HMCSIM}" ] then #----------------------------------------------------------------------- # GOBLIN_HMCSIM @@ -137,7 +137,7 @@ sstDepsDoStaging () fi fi - if [ ! -z "${SST_BUILD_HBM_DRAMSIM2}" ] + if [ -n "${SST_BUILD_HBM_DRAMSIM2}" ] then #----------------------------------------------------------------------- # HBM_DRAMSIM2 @@ -152,7 +152,7 @@ sstDepsDoStaging () fi fi - if [ ! -z "${SST_BUILD_RAMULATOR}" ] + if [ -n "${SST_BUILD_RAMULATOR}" ] then #----------------------------------------------------------------------- # RAMULATOR @@ -188,17 +188,17 @@ sstDepsPatchSource () # Patch source packages in the staging area as needed # - if [ ! -z "${SST_BUILD_DRAMSIM}" ] + if [ -n "${SST_BUILD_DRAMSIM}" ] then #----------------------------------------------------------------------- # DRAMSim #----------------------------------------------------------------------- - if [ $SST_DEPS_OS_NAME = "Linux" ] && [ ! -z $SST_BUILD_DRAMSIM_STATIC ] + if [[ "${SST_DEPS_OS_NAME}" == "Linux" ]] && [ -n "${SST_BUILD_DRAMSIM_STATIC}" ] then # Patching to build static version for Linux - pushd ${SST_DEPS_SRC_STAGING} - sstDepsAnnounce -h $FUNCNAME -m "Patching DRAMSim" - patch -p0 -i ${SST_DEPS_PATCHFILES}/DRAMSim-sst.linux.patch + pushd "${SST_DEPS_SRC_STAGING}" + sstDepsAnnounce -h "${FUNCNAME[0]}" -m "Patching DRAMSim" + patch -p0 -i "${SST_DEPS_PATCHFILES}"/DRAMSim-sst.linux.patch retval=$? if [ $retval -ne 0 ] then @@ -206,7 +206,6 @@ sstDepsPatchSource () echo "ERROR: sstDependencies.sh: DRAMSim (Linux) patch failure" return $retval fi - popd fi # if [ $SST_DEPS_OS_NAME = "Darwin" ] @@ -230,7 +229,7 @@ sstDepsPatchSource () if [ -n "${SST_BUILD_NVDIMMSIM}" ] then pushd "${SST_DEPS_SRC_STAGED_NVDIMMSIM}" - sstDepsAnnounce -h $FUNCNAME -m "Patching NVDIMMSim" + sstDepsAnnounce -h "${FUNCNAME[0]}" -m "Patching NVDIMMSim" patch -p0 -i "${SST_DEPS_PATCHFILES}"/NVDIMMSim.patch retval=$? if [ $retval -ne 0 ] @@ -244,7 +243,7 @@ sstDepsPatchSource () if [ -n "${SST_BUILD_HYBRIDSIM}" ] then pushd "${SST_DEPS_SRC_STAGED_HYBRIDSIM}" - sstDepsAnnounce -h $FUNCNAME -m "Patching HybridSim" + sstDepsAnnounce -h "${FUNCNAME[0]}" -m "Patching HybridSim" patch -p0 -i "${SST_DEPS_PATCHFILES}"/HybridSim.patch retval=$? if [ $retval -ne 0 ] @@ -255,7 +254,7 @@ sstDepsPatchSource () popd fi - if [ ! -z ${SST_BUILD_RAMULATOR_STABLEDEVEL} ] + if [ -n "${SST_BUILD_RAMULATOR_STABLEDEVEL}" ] then #----------------------------------------------------------------------- # Ramulator-stabledevel @@ -264,12 +263,12 @@ sstDepsPatchSource () # Patch ramulator sha 7d2e72306c6079768e11a1867eb67b60cee34a1c # Patching to build static version for Linux - sstDepsAnnounce -h $FUNCNAME -m "Patching ramulator " - pushd ${SST_DEPS_SRC_STAGING}/ramulator + sstDepsAnnounce -h "${FUNCNAME[0]}" -m "Patching ramulator " + pushd "${SST_DEPS_SRC_STAGING}"/ramulator ls -lia - patch -p1 -i ${SST_DEPS_PATCHFILES}/ramulator_gcc48Patch.patch + patch -p1 -i "${SST_DEPS_PATCHFILES}"/ramulator_gcc48Patch.patch retval=$? if [ $retval -ne 0 ] then @@ -278,7 +277,7 @@ sstDepsPatchSource () return $retval fi - patch -p0 -i ${SST_DEPS_PATCHFILES}/ramulator_include.patch + patch -p0 -i "${SST_DEPS_PATCHFILES}"/ramulator_include.patch retval=$? if [ $retval -ne 0 ] then @@ -287,7 +286,7 @@ sstDepsPatchSource () return $retval fi - patch -p1 -i ${SST_DEPS_PATCHFILES}/ramulator_libPatch.patch + patch -p1 -i "${SST_DEPS_PATCHFILES}"/ramulator_libPatch.patch retval=$? if [ $retval -ne 0 ] then @@ -320,7 +319,7 @@ sstDepsDeploy () # Deploy each dependency # - if [ ! -z "${SST_BUILD_DRAMSIM}" ] + if [ -n "${SST_BUILD_DRAMSIM}" ] then #----------------------------------------------------------------------- # DRAMSim @@ -335,7 +334,7 @@ sstDepsDeploy () fi fi - if [ ! -z "${SST_BUILD_DRAMSIM3}" ] + if [ -n "${SST_BUILD_DRAMSIM3}" ] then #----------------------------------------------------------------------- # DRAMsim3 @@ -350,7 +349,7 @@ sstDepsDeploy () fi fi - if [ ! -z "${SST_BUILD_GPGPUSIM}" ] + if [ -n "${SST_BUILD_GPGPUSIM}" ] then #----------------------------------------------------------------------- # GPGPUSim @@ -365,7 +364,7 @@ sstDepsDeploy () fi fi - if [ ! -z "${SST_BUILD_NVDIMMSIM}" ] + if [ -n "${SST_BUILD_NVDIMMSIM}" ] then #----------------------------------------------------------------------- # NVDIMMSim @@ -380,7 +379,7 @@ sstDepsDeploy () fi fi - if [ ! -z "${SST_BUILD_HYBRIDSIM}" ] + if [ -n "${SST_BUILD_HYBRIDSIM}" ] then #----------------------------------------------------------------------- # HybridSim @@ -396,7 +395,7 @@ sstDepsDeploy () fi - if [ ! -z "${SST_BUILD_GOBLIN_HMCSIM}" ] + if [ -n "${SST_BUILD_GOBLIN_HMCSIM}" ] then #----------------------------------------------------------------------- # GOBLIN_HMCSIM @@ -411,7 +410,7 @@ sstDepsDeploy () fi fi - if [ ! -z "${SST_BUILD_HBM_DRAMSIM2}" ] + if [ -n "${SST_BUILD_HBM_DRAMSIM2}" ] then #----------------------------------------------------------------------- # HBM_DRAMSIM2 @@ -426,7 +425,7 @@ sstDepsDeploy () fi fi - if [ ! -z "${SST_BUILD_RAMULATOR}" ] + if [ -n "${SST_BUILD_RAMULATOR}" ] then #----------------------------------------------------------------------- # RAMULATOR @@ -463,7 +462,7 @@ sstDepsDoQuery () # Query each dependency # - if [ ! -z "${SST_BUILD_DRAMSIM}" ] + if [ -n "${SST_BUILD_DRAMSIM}" ] then #----------------------------------------------------------------------- # DRAMSim @@ -471,7 +470,7 @@ sstDepsDoQuery () sstDepsQuery_dramsim fi - if [ ! -z "${SST_BUILD_DRAMSIM3}" ] + if [ -n "${SST_BUILD_DRAMSIM3}" ] then #----------------------------------------------------------------------- # DRAMsim3 @@ -479,7 +478,7 @@ sstDepsDoQuery () sstDepsQuery_dramsim3 fi - if [ ! -z "${SST_BUILD_GPGPUSIM}" ] + if [ -n "${SST_BUILD_GPGPUSIM}" ] then #----------------------------------------------------------------------- # GPGPUSim @@ -487,7 +486,7 @@ sstDepsDoQuery () sstDepsQuery_GPGPUSim fi - if [ ! -z "${SST_BUILD_NVDIMMSIM}" ] + if [ -n "${SST_BUILD_NVDIMMSIM}" ] then #----------------------------------------------------------------------- # NVDIMMSim @@ -496,7 +495,7 @@ sstDepsDoQuery () fi - if [ ! -z "${SST_BUILD_HYBRIDSIM}" ] + if [ -n "${SST_BUILD_HYBRIDSIM}" ] then #----------------------------------------------------------------------- # HybridSim @@ -505,7 +504,7 @@ sstDepsDoQuery () fi - if [ ! -z "${SST_BUILD_GOBLIN_HMCSIM}" ] + if [ -n "${SST_BUILD_GOBLIN_HMCSIM}" ] then #----------------------------------------------------------------------- # GOBLIN_HMCSIM @@ -513,7 +512,7 @@ sstDepsDoQuery () sstDepsQuery_goblin_hmcsim fi - if [ ! -z "${SST_BUILD_HBM_DRAMSIM2}" ] + if [ -n "${SST_BUILD_HBM_DRAMSIM2}" ] then #----------------------------------------------------------------------- # HBM_DRAMSIM2 @@ -521,7 +520,7 @@ sstDepsDoQuery () sstDepsQuery_hbm_dramsim2 fi - if [ ! -z "${SST_BUILD_RAMULATOR}" ] + if [ -n "${SST_BUILD_RAMULATOR}" ] then #----------------------------------------------------------------------- # RAMULATOR @@ -537,22 +536,22 @@ sstDepsDoDependencies () { # create staging and installation directories, if needed - if [ ! -d ${SST_DEPS_SRC_STAGING} ] + if [ ! -d "${SST_DEPS_SRC_STAGING}" ] then - mkdir -p ${SST_DEPS_SRC_STAGING} + mkdir -p "${SST_DEPS_SRC_STAGING}" fi - if [ ! -d ${SST_DEPS_INSTALL_DEPS} ] + if [ ! -d "${SST_DEPS_INSTALL_DEPS}" ] then - mkdir -p ${SST_DEPS_INSTALL_DEPS} + mkdir -p "${SST_DEPS_INSTALL_DEPS}" fi - if [ $# -eq 1 ] && [ $1 = "restageDeps" ] + if [ $# -eq 1 ] && [[ "${1}" == "restageDeps" ]] then # Purge deps staging area and deps install area - rm -Rf ${SST_DEPS_SRC_STAGING}/* - rm -Rf ${SST_DEPS_INSTALL_DEPS}/* + rm -Rf "${SST_DEPS_SRC_STAGING:?}"/* + rm -Rf "${SST_DEPS_INSTALL_DEPS:?}"/* # Restage source code from pristine sstDepsDoStaging @@ -574,10 +573,10 @@ sstDepsDoDependencies () return $retval fi - elif [ $# -eq 1 ] && [ $1 = "develBuild" ] + elif [ $# -eq 1 ] && [[ "${1}" == "develBuild" ]] then # Purge deps install area, leave staged area alone - rm -Rf ${SST_DEPS_INSTALL_DEPS}/* + rm -Rf "${SST_DEPS_INSTALL_DEPS:?}"/* # Deploy dependencies (build from staged area and install) sstDepsDeploy @@ -589,11 +588,11 @@ sstDepsDoDependencies () return $retval fi - elif [ $# -eq 1 ] && [ $1 = "cleanBuild" ] + elif [ $# -eq 1 ] && [[ "${1}" == "cleanBuild" ]] then # Purge deps staging area and deps install area - rm -Rf ${SST_DEPS_SRC_STAGING}/* - rm -Rf ${SST_DEPS_INSTALL_DEPS}/* + rm -Rf "${SST_DEPS_SRC_STAGING:?}"/* + rm -Rf "${SST_DEPS_INSTALL_DEPS:?}"/* sstDepsAnnounce -h "sstDepsDoDependencies" -m "Begin Staging " # Restage source code from pristine @@ -628,7 +627,7 @@ sstDepsDoDependencies () return $retval fi - elif [ $# -eq 1 ] && [ $1 = "queryEnv" ] + elif [ $# -eq 1 ] && [[ "${1}" == "queryEnv" ]] then # Print suggested environment echo "# --------------------------------------------------------------------" @@ -681,23 +680,28 @@ do case "$OPTARG" in default|stabledevel) # build latest DRAMSim from repository ("stable development") echo "# (default) stabledevel: build latest DRAMSim from repository" - . ${SST_DEPS_BIN}/sstDep_dramsim_stabledevel.sh + # shellcheck source=buildsys/deps/bin/sstDep_dramsim_stabledevel.sh + . "${SST_DEPS_BIN}"/sstDep_dramsim_stabledevel.sh ;; 2.2.2) # build DRAMSim v2.2.2 echo "# 2.2.2: build DRAMSim v2.2.2 release" - . ${SST_DEPS_BIN}/sstDep_dramsim_v2.2.2.sh + # shellcheck source=buildsys/deps/bin/sstDep_dramsim_v2.2.2.sh + . "${SST_DEPS_BIN}"/sstDep_dramsim_v2.2.2.sh ;; 2.2.1) # build DRAMSim v2.2.1 echo "# 2.2.1: build DRAMSim v2.2.1 release" - . ${SST_DEPS_BIN}/sstDep_dramsim_v2.2.1.sh + # shellcheck source=buildsys/deps/bin/sstDep_dramsim_v2.2.1.sh + . "${SST_DEPS_BIN}"/sstDep_dramsim_v2.2.1.sh ;; 2.2) # build DRAMSim v2.2 (tagged DRAMSim release) echo "# 2.2: build DRAMSim v2.2 tagged release" - . ${SST_DEPS_BIN}/sstDep_dramsim_v2.2.sh + # shellcheck source=buildsys/deps/bin/sstDep_dramsim_v2.2.sh + . "${SST_DEPS_BIN}"/sstDep_dramsim_v2.2.sh ;; r4b00b22) # build DRAMSim commit ID 4b00b228abaa9d9dcd27ffbb48cfa71db53d520f echo "# r4b00b22: build DRAMSim commit ID 4b00b228abaa9d9dcd27ffbb48cfa71db53d520f" - . ${SST_DEPS_BIN}/sstDep_dramsim_r4b00b22.sh + # shellcheck source=buildsys/deps/bin/sstDep_dramsim_r4b00b22.sh + . "${SST_DEPS_BIN}"/sstDep_dramsim_r4b00b22.sh ;; none) # do not build (explicit) echo "# none: will not build DRAMSim" @@ -716,7 +720,8 @@ do if [[ ${SST_WITHOUT_DRAMSIM3:+isSet} == isSet ]] ; then echo " DRAMSIM3 IS NOT ENABLED BY SST_WITHOUT_DRAMSIM3 flag" else - . ${SST_DEPS_BIN}/sstDep_dramsim3_stabledevel.sh + # shellcheck source=buildsys/deps/bin/sstDep_dramsim3_stabledevel.sh + . "${SST_DEPS_BIN}"/sstDep_dramsim3_stabledevel.sh fi ;; none) # do not build (explicit) @@ -733,7 +738,8 @@ do case "$OPTARG" in default|stabledevel) # build latest Goblin_HMCSIM from repository ("stable development") echo "# (default) stabledevel: build latest Goblin_HMCSIM from repository" - . ${SST_DEPS_BIN}/sstDep_goblin_hmcsim_stabledevel.sh + # shellcheck source=buildsys/deps/bin/sstDep_goblin_hmcsim_stabledevel.sh + . "${SST_DEPS_BIN}"/sstDep_goblin_hmcsim_stabledevel.sh ;; none) # do not build (explicit) echo "# none: will not build Goblin_HMCSIM" @@ -749,7 +755,8 @@ do case "$OPTARG" in default|stabledevel) # build latest HBM_DRAMSim2 from repository ("stable development") echo "# (default) stabledevel: build latest HBM_DRAMSim2 from repository" - . ${SST_DEPS_BIN}/sstDep_hbm_dramsim2_stabledevel.sh + # shellcheck source=buildsys/deps/bin/sstDep_hbm_dramsim2_stabledevel.sh + . "${SST_DEPS_BIN}"/sstDep_hbm_dramsim2_stabledevel.sh ;; none) # do not build (explicit) echo "# none: will not build HBM_DRAMSim2" @@ -765,7 +772,8 @@ do case "$OPTARG" in default|stabledevel) # build latest Ramulator from repository ("stable development") echo "# (default) stabledevel: build latest Ramulator from repository" - . ${SST_DEPS_BIN}/sstDep_ramulator_stabledevel.sh + # shellcheck source=buildsys/deps/bin/sstDep_ramulator_stabledevel.sh + . "${SST_DEPS_BIN}"/sstDep_ramulator_stabledevel.sh ;; none) # do not build (explicit) echo "# none: will not build Ramulator" @@ -781,10 +789,12 @@ do case "$OPTARG" in default) echo "# default will be built" - . ${SST_DEPS_BIN}/sstDep_nvdimmsim.sh + # shellcheck source=buildsys/deps/bin/sstDep_nvdimmsim.sh + . "${SST_DEPS_BIN}"/sstDep_nvdimmsim.sh echo "# HybridSim will be built" - . ${SST_DEPS_BIN}/sstDep_hybridsim.sh + # shellcheck source=buildsys/deps/bin/sstDep_hybridsim.sh + . "${SST_DEPS_BIN}"/sstDep_hybridsim.sh ;; none) # Do not build NVDIMMSim echo "# none: will not build NVDIMMSim" @@ -797,11 +807,13 @@ do case "$OPTARG" in 1.1|stabledevel) # Build GPGPUSim echo "# ${OPTARG}: Build GPGPUSim 1.1 tag" - . ${SST_DEPS_BIN}/sstDep_GPGPUSim.sh 1.1 + # shellcheck source=buildsys/deps/bin/sstDep_GPGPUSim.sh + . "${SST_DEPS_BIN}"/sstDep_GPGPUSim.sh 1.1 ;; master) # Build GPGPUSim echo "# ${OPTARG}: Build GPGPUSim master branch" - . ${SST_DEPS_BIN}/sstDep_GPGPUSim.sh master + # shellcheck source=buildsys/deps/bin/sstDep_GPGPUSim.sh + . "${SST_DEPS_BIN}"/sstDep_GPGPUSim.sh master ;; none|default) # Do not build GPGPUSim echo "# default: will not build GPGPUSim" @@ -813,17 +825,9 @@ do esac done -shift $[ $OPTIND - 1 ] - -sstDepsDoDependencies $1 -retval=$? -if [ $retval -ne 0 ] -then - # bail out on error - echo "ERROR: sstDependencies.sh: sstDepsDoDependences code failure" - exit -1 -fi +shift $(( OPTIND - 1 )) +sstDepsDoDependencies "${1}" retval=$? if [ $retval -ne 0 ] then From 9e026cd0166f7f0da67382b2c6a2a383441e50b8 Mon Sep 17 00:00:00 2001 From: Eric Berquist Date: Fri, 9 Aug 2024 15:15:46 -0600 Subject: [PATCH 5/7] shellcheck fixes on test/include/testDefinitions.sh --- .pre-commit-config.yaml | 1 - test/include/testDefinitions.sh | 96 ++++++++++++------------------ test/testSuites/testSuite_gpgpu.sh | 8 +-- 3 files changed, 39 insertions(+), 66 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ac8f99bf..817cce1b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -50,7 +50,6 @@ repos: buildsys/deps/bin/sstDep_nvdimmsim.sh| buildsys/deps/bin/sstDep_ramulator_stabledevel.sh| test/utilities/shunit2/| - test/include/testDefinitions.sh| test/include/testSubroutines.sh| test/testSuites/testSuite_gpgpu.sh| test/testSuites/testSuite_macro.sh| diff --git a/test/include/testDefinitions.sh b/test/include/testDefinitions.sh index cbe88e01..886f48be 100755 --- a/test/include/testDefinitions.sh +++ b/test/include/testDefinitions.sh @@ -7,7 +7,7 @@ set -o pipefail # NOTE: User may override SST installation location by setting the # SST_INSTALL_BIN_USER environment variable to a non-NULL directory. -_SUITE_NAME=`echo $0 | awk -F/ '{print $NF}'` +_SUITE_NAME=$(echo "$0" | awk -F/ '{print $NF}') if [[ $_SUITE_NAME == *testSuite_* ]] ; then echo "SST_BEGIN_NEW_SUITE $_SUITE_NAME" fi @@ -19,7 +19,8 @@ if [[ ${SST_ROOT:+isSet} != isSet ]] then # If SST_ROOT has NOT been set, assume SST_ROOT is up 2 levels from # the directory that this file (testDefinitions.sh) resides in. - export SST_ROOT="$( cd -P "$( dirname "$0" )"/../.. && pwd )" + SST_ROOT="$( cd -P "$( dirname "$0" )"/../.. && pwd )" + export SST_ROOT fi # Check SST installation preferences @@ -96,39 +97,40 @@ export SST_TEST_EXTERNAL_INPUT_FILES_PROSPERO=${SST_TEST_EXTERNAL_INPUT_FILES}/p # System definitions #=============================================================================== -# LEGACY definitions -SST_TEST_CPU_ARCH=`uname -p` # uname CPU architecture -SST_TEST_OS_NAME=`uname -s` # uname OS name -SST_TEST_OS_RELEASE=`uname -r` # uname OS release - - - -export SST_TEST_HOST_OS_KERNEL=`uname -s` -export SST_TEST_HOST_OS_KERNEL_VERSION=`uname -r` -export SST_TEST_HOST_OS_KERNEL_ARCH=`uname -p` +SST_TEST_HOST_OS_KERNEL="$(uname -s)" +SST_TEST_HOST_OS_KERNEL_VERSION="$(uname -r)" +SST_TEST_HOST_OS_KERNEL_ARCH="$(uname -p)" +export SST_TEST_HOST_OS_KERNEL +export SST_TEST_HOST_OS_KERNEL_VERSION +export SST_TEST_HOST_OS_KERNEL_ARCH # Get distrib and version -if [ $SST_TEST_HOST_OS_KERNEL = "Darwin" ] +if [[ "${SST_TEST_HOST_OS_KERNEL}" == "Darwin" ]] then # This is Darwin. Always check for Darwin first, since the checks # for Linux platform information contin GNU-isms that may not be # supported on MacOS export SST_TEST_HOST_OS_DISTRIB="MacOS" - export SST_TEST_HOST_OS_DISTRIB_VERSION=`sw_vers -productVersion` + SST_TEST_HOST_OS_DISTRIB_VERSION="$(sw_vers -productVersion)" + export SST_TEST_HOST_OS_DISTRIB_VERSION export SST_TEST_HOST_OS_DISTRIB_MACOS=1 elif [ -r /etc/centos-release ] then # The presence of this file means this is CentOS, a Red Hat derivative - export SST_TEST_HOST_OS_DISTRIB=`cut -d " " -f1 /etc/centos-release` - export SST_TEST_HOST_OS_DISTRIB_VERSION=`cut -d " " -f3 /etc/centos-release` + SST_TEST_HOST_OS_DISTRIB="$(cut -d " " -f1 /etc/centos-release)" + export SST_TEST_HOST_OS_DISTRIB + SST_TEST_HOST_OS_DISTRIB_VERSION="$(cut -d " " -f3 /etc/centos-release)" + export SST_TEST_HOST_OS_DISTRIB_VERSION export SST_TEST_HOST_OS_DISTRIB_CENTOS=1 elif [ -r /etc/toss-release ] then # The presence of this file means this is TOSS, a Red Hat derivative - export SST_TEST_HOST_OS_DISTRIB=`cat /etc/toss-release | sed 's|\([^-]\+\)\(-release.*\)|\1|'` - export SST_TEST_HOST_OS_DISTRIB_VERSION=`cat /etc/toss-release | sed 's|toss-release-\(.\+\)|\1|'` + SST_TEST_HOST_OS_DISTRIB="$(< /etc/toss-release sed 's|\([^-]\+\)\(-release.*\)|\1|')" + export SST_TEST_HOST_OS_DISTRIB + SST_TEST_HOST_OS_DISTRIB_VERSION="$(< /etc/toss-release sed 's|toss-release-\(.\+\)|\1|')" + export SST_TEST_HOST_OS_DISTRIB_VERSION export SST_TEST_HOST_OS_DISTRIB_TOSS=1 elif [ -r /etc/lsb-release ] @@ -146,9 +148,11 @@ then # !!! the "lsb-release" file! The following logic is only known to # !!! work on Ubuntu's "lsb-release" file. - export SST_TEST_HOST_OS_DISTRIB=`cat /etc/lsb-release | egrep DISTRIB_ID | sed 's|\(^DISTRIB_ID=\)\(.\+\)|\2|'` - export SST_TEST_HOST_OS_DISTRIB_VERSION=`cat /etc/lsb-release | egrep DISTRIB_RELEASE | sed 's|\(^DISTRIB_RELEASE=\)\(.\+\)|\2|'` - if [ $SST_TEST_HOST_OS_DISTRIB = "Ubuntu" ] + SST_TEST_HOST_OS_DISTRIB=$(< /etc/lsb-release grep DISTRIB_ID | sed 's|\(^DISTRIB_ID=\)\(.\+\)|\2|') + export SST_TEST_HOST_OS_DISTRIB + SST_TEST_HOST_OS_DISTRIB_VERSION=$(< /etc/lsb-release grep DISTRIB_RELEASE | sed 's|\(^DISTRIB_RELEASE=\)\(.\+\)|\2|') + export SST_TEST_HOST_OS_DISTRIB_VERSION + if [[ "${SST_TEST_HOST_OS_DISTRIB}" == "Ubuntu" ]] then # Set this if this is Ubuntu, a Debian derivative export SST_TEST_HOST_OS_DISTRIB_UBUNTU=1 @@ -166,26 +170,6 @@ else fi - # ======== Usage example ======== - # if [ -n "${SST_TEST_HOST_OS_DISTRIB_MACOS}" ] - # then - # echo "This OS distribution is MacOS" - # elif [ -n "${SST_TEST_HOST_OS_DISTRIB_UBUNTU}" ] - # then - # echo "This OS distribution is Ubuntu" - # elif [ -n "${SST_TEST_HOST_OS_DISTRIB_CENTOS}" ] - # then - # echo "This OS distribution is CentOS" - # elif [ -n "${SST_TEST_HOST_OS_DISTRIB_TOSS}" ] - # then - # echo "This OS distribution is TOSS" - # else - # echo "This OS distribution is unknown" - # fi - - - - #=============================================================================== # Build type definitions #=============================================================================== @@ -227,9 +211,6 @@ fi # echo "DBG testDefinitions.sh: SST_TEST_UTILITIES = ${SST_TEST_UTILITIES}" # echo "DBG testDefinitions.sh: SHUNIT2_ROOT = ${SHUNIT2_ROOT}" # echo "DBG testDefinitions.sh: SHUNIT2_SRC = ${SHUNIT2_SRC}" -# echo "DBG testDefinitions.sh: SST_TEST_CPU_ARCH = ${SST_TEST_CPU_ARCH}" -# echo "DBG testDefinitions.sh: SST_TEST_OS_NAME = ${SST_TEST_OS_NAME}" -# echo "DBG testDefinitions.sh: SST_TEST_OS_RELEASE = ${SST_TEST_OS_RELEASE}" # DEBUG ############### @@ -245,11 +226,11 @@ multithread_multirank_patch_Suites() { echo "multithread_multirank_patch_Suites: " SET_TL=0 if [[ ${SST_MULTI_THREAD_COUNT:+isSet} == isSet ]] ; then - if [ $SST_MULTI_THREAD_COUNT == 0 ] ; then + if [ "${SST_MULTI_THREAD_COUNT}" -eq 0 ] ; then echo " There is a zero -n count, Set to 1 " export SST_MULTI_THREAD_COUNT=1 else - if [ $SST_MULTI_THREAD_COUNT -gt 1 ] ; then + if [ "${SST_MULTI_THREAD_COUNT}" -gt 1 ] ; then SET_TL=1 fi fi @@ -258,38 +239,37 @@ multithread_multirank_patch_Suites() { if [[ ${SST_MULTI_RANK_COUNT:+isSet} == isSet ]] ; then - if [ $SST_MULTI_RANK_COUNT == 0 ] ; then + if [ "${SST_MULTI_RANK_COUNT}" -eq 0 ] ; then echo " There is a zero rank count, Set to 1 " export SST_MULTI_RANK_COUNT=1 fi - if [ $SST_MULTI_RANK_COUNT -gt 1 ] ; then + if [ "${SST_MULTI_RANK_COUNT}" -gt 1 ] ; then SET_TL=1 fi fi - if [ $SET_TL == 1 ] ; then + if [ $SET_TL -eq 1 ] ; then echo "Set SST_MULTI_CORE=1" export SST_MULTI_CORE=1 - fi } set_map-by_parameter() { - if [ $SST_TEST_HOST_OS_KERNEL = "Darwin" ] ; then - ncores=`sysctl -n hw.ncpu` + if [[ "${SST_TEST_HOST_OS_KERNEL}" == "Darwin" ]] ; then + ncores="$(sysctl -n hw.ncpu)" else - ncores=`cat /proc/cpuinfo |grep processor | wc -l` + ncores="$(< /proc/cpuinfo grep -c processor)" fi - echo " Number of cores = $ncores" + echo " Number of cores = ${ncores}" - if [ $ncores == 1 ] ; then + if [ "$ncores" -eq 1 ] ; then NUMA_PARAM=" " - elif [ $ncores -ge 2 ] && [ $ncores -le 4 ] ; then + elif [ "$ncores" -ge 2 ] && [ "$ncores" -le 4 ] ; then NUMA_PARAM="-map-by numa:pe=2 -oversubscribe" - elif [ $ncores -ge 4 ] ; then + elif [ "$ncores" -ge 4 ] ; then NUMA_PARAM="-map-by numa:pe=2" fi export NUMA_PARAM - echo " NUMA PARAM = $NUMA_PARAM" + echo " NUMA PARAM = ${NUMA_PARAM}" } diff --git a/test/testSuites/testSuite_gpgpu.sh b/test/testSuites/testSuite_gpgpu.sh index 030f868c..48074f5d 100755 --- a/test/testSuites/testSuite_gpgpu.sh +++ b/test/testSuites/testSuite_gpgpu.sh @@ -1,6 +1,4 @@ -# !/bin/bash -# testSuite_gpgpu.sh - +#!/bin/bash TEST_SUITE_ROOT="$( cd -P "$( dirname "$0" )" && pwd )" # Load test definitions @@ -30,10 +28,6 @@ L_TESTFILE=() # Empty list, used to hold test file names echo " Environment Variable INTEL_PIN_DIRECTORY must be defined" preFail "Ariel tests requires PIN DIRECTORY" "skip" fi - if [ "${SST_TEST_HOST_OS_DISTRIB_UBUNTU}" == "1" ] ; then - echo " Temporary patch" - echo "Ariel on Ubuntu not working on Sandy bridge and Ivy bridge tests" - fi mkdir $SSTTESTTEMPFILES/$$gpu_run cd $SSTTESTTEMPFILES/$$gpu_run From 1fbf9b9d7c1d76a1191eaa11ad23e67506103225 Mon Sep 17 00:00:00 2001 From: Eric Berquist Date: Fri, 9 Aug 2024 17:41:44 -0600 Subject: [PATCH 6/7] apply pre-commit fixes --- README.md | 4 +- .../deps/bin/sstDep_dramsim_masterlatest.sh | 2 +- buildsys/deps/bin/sstDep_dramsim_r4b00b22.sh | 4 +- .../deps/bin/sstDep_dramsim_stabledevel.sh | 2 +- buildsys/deps/bin/sstDep_dramsim_static.sh | 2 +- buildsys/deps/bin/sstDep_dramsim_v2.2.1.sh | 2 +- buildsys/deps/bin/sstDep_dramsim_v2.2.2.sh | 4 +- buildsys/deps/bin/sstDep_dramsim_v2.2.sh | 2 +- .../bin/sstDep_goblin_hmcsim_stabledevel.sh | 20 ++--- .../bin/sstDep_hbm_dramsim2_stabledevel.sh | 22 +++--- buildsys/deps/bin/sstDep_hybridsim.sh | 4 +- buildsys/deps/bin/sstDep_nvdimmsim.sh | 6 +- .../deps/bin/sstDep_ramulator_stabledevel.sh | 24 +++--- test/testSuites/testcuda/MakefileVecAdd | 2 - test/testSuites/testcuda/vecAdd.cu | 38 +++++----- test/testSuites/teststream/stream-M5.xml | 2 +- test/testSuites/teststream/stream.c | 54 +++++++------ test/utilities/TimeoutEx.sh | 8 +- test/utilities/difftoxml.pl | 2 +- test/utilities/moduleex.sh | 20 ++--- test/utilities/shunit2/README.wiki | 4 +- test/utilities/shunit2/doc/LGPL-2.1 | 22 +++--- test/utilities/shunit2/lib/versions | 2 +- test/utilities/shunit2/src/shunit2 | 76 +++++++++---------- 24 files changed, 161 insertions(+), 167 deletions(-) diff --git a/README.md b/README.md index a38faa61..6b46f798 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ These tests are used to validate changes to `sst-core` prior to accepting those changes into the development and then master branch of `sst-core`. -All of the tests used for SST are available on github, specifically +All of the tests used for SST are available on github, specifically - this repo, and -- , and +- , and - network traces from diff --git a/buildsys/deps/bin/sstDep_dramsim_masterlatest.sh b/buildsys/deps/bin/sstDep_dramsim_masterlatest.sh index 8950c2c1..e629db07 100644 --- a/buildsys/deps/bin/sstDep_dramsim_masterlatest.sh +++ b/buildsys/deps/bin/sstDep_dramsim_masterlatest.sh @@ -1,7 +1,7 @@ # !/bin/bash # sstDep_dramsim_masterlatest.sh -# Description: +# Description: # A bash script containing functions to process SST's DRAMSim # dependency. diff --git a/buildsys/deps/bin/sstDep_dramsim_r4b00b22.sh b/buildsys/deps/bin/sstDep_dramsim_r4b00b22.sh index 30195984..c384dbdf 100644 --- a/buildsys/deps/bin/sstDep_dramsim_r4b00b22.sh +++ b/buildsys/deps/bin/sstDep_dramsim_r4b00b22.sh @@ -1,7 +1,7 @@ # !/bin/bash # sstDep_dramsim_r4b00b22.sh -# Description: +# Description: # A bash script containing functions to process SST's DRAMSim # dependency. @@ -57,7 +57,7 @@ sstDepsStage_dramsim () pushd ${SST_DEPS_SRC_STAGED_DRAMSIM} git reset --hard 4b00b228abaa9d9dcd27ffbb48cfa71db53d520f - + # local dramsimHeadRevision=`git log -1 HEAD | head -1` popd sstDepsAnnounce -h $FUNCNAME -m "Fetched DRAMSim2 rev 4b00b228abaa9d9dcd27ffbb48cfa71db53d520f" diff --git a/buildsys/deps/bin/sstDep_dramsim_stabledevel.sh b/buildsys/deps/bin/sstDep_dramsim_stabledevel.sh index b9e5388a..c7f76554 100644 --- a/buildsys/deps/bin/sstDep_dramsim_stabledevel.sh +++ b/buildsys/deps/bin/sstDep_dramsim_stabledevel.sh @@ -1,7 +1,7 @@ # !/bin/bash # sstDep_dramsim_stabledevel.sh -# Description: +# Description: # A bash script containing functions to process SST's DRAMSim # dependency. diff --git a/buildsys/deps/bin/sstDep_dramsim_static.sh b/buildsys/deps/bin/sstDep_dramsim_static.sh index eb7cfb01..3f049d5e 100644 --- a/buildsys/deps/bin/sstDep_dramsim_static.sh +++ b/buildsys/deps/bin/sstDep_dramsim_static.sh @@ -1,7 +1,7 @@ # !/bin/bash # sstDep_dramsim_static.sh -# Description: +# Description: # A bash script containing functions to process SST's DRAMSim # dependency. diff --git a/buildsys/deps/bin/sstDep_dramsim_v2.2.1.sh b/buildsys/deps/bin/sstDep_dramsim_v2.2.1.sh index cd9d1b38..94fe1810 100644 --- a/buildsys/deps/bin/sstDep_dramsim_v2.2.1.sh +++ b/buildsys/deps/bin/sstDep_dramsim_v2.2.1.sh @@ -1,7 +1,7 @@ # !/bin/bash # sstDep_dramsim_v2.2.1.sh -# Description: +# Description: # A bash script containing functions to process SST's DRAMSim # dependency. diff --git a/buildsys/deps/bin/sstDep_dramsim_v2.2.2.sh b/buildsys/deps/bin/sstDep_dramsim_v2.2.2.sh index b6b5016c..12e3b553 100644 --- a/buildsys/deps/bin/sstDep_dramsim_v2.2.2.sh +++ b/buildsys/deps/bin/sstDep_dramsim_v2.2.2.sh @@ -1,7 +1,7 @@ # !/bin/bash # sstDep_dramsim_v2.2.2.sh -# Description: +# Description: # A bash script containing functions to process SST's DRAMSim # dependency. @@ -117,7 +117,7 @@ CXX=clang++\ # if using Intel compiler if [[ ${compiler} =~ icpc.* ]] then - # patch Makefile for Intel compiler on Linux + # patch Makefile for Intel compiler on Linux echo "INFO: (${FUNCNAME}) Intel compiler detected in CXX. Patching Makefile for icc/icpc..." sed -i.bak1 -e 's/g++/$(CXX)/' Makefile # I know the alignment looks awful here. diff --git a/buildsys/deps/bin/sstDep_dramsim_v2.2.sh b/buildsys/deps/bin/sstDep_dramsim_v2.2.sh index 90abaa84..556cd047 100644 --- a/buildsys/deps/bin/sstDep_dramsim_v2.2.sh +++ b/buildsys/deps/bin/sstDep_dramsim_v2.2.sh @@ -1,7 +1,7 @@ # !/bin/bash # sstDep_dramsim_v2.2.sh -# Description: +# Description: # A bash script containing functions to process SST's DRAMSim # dependency. diff --git a/buildsys/deps/bin/sstDep_goblin_hmcsim_stabledevel.sh b/buildsys/deps/bin/sstDep_goblin_hmcsim_stabledevel.sh index a1858462..65e223b2 100644 --- a/buildsys/deps/bin/sstDep_goblin_hmcsim_stabledevel.sh +++ b/buildsys/deps/bin/sstDep_goblin_hmcsim_stabledevel.sh @@ -1,7 +1,7 @@ # !/bin/bash # sstDep_goblin_hmcsim_stabledevel.sh -# Description: +# Description: # A bash script containing functions to process SST's Goblin_HMCSIM # dependency. @@ -28,7 +28,7 @@ export SST_BUILD_GOBLIN_HMCSIM_STABLEDEVEL=1 # Outputs: # Pass/fail # Expected Results -# Staged Goblin_HMCSIM code +# Staged Goblin_HMCSIM code # Caveats: # None #------------------------------------------------------------------------------- @@ -36,7 +36,7 @@ export SST_DEPS_SRC_STAGED_GOBLIN_HMCSIM=${SST_DEPS_SRC_STAGING}/goblin_hmcsim sstDepsStage_goblin_hmcsim () { sstDepsAnnounce -h $FUNCNAME -m "Staging goblin_hmcsim stabledevel" - + pushd ${SST_DEPS_SRC_STAGING} Num_Tries_remaing=3 @@ -61,7 +61,7 @@ sstDepsStage_goblin_hmcsim () return $retVal fi done - + if [ $retVal -ne 0 ] # retVal from git clone then # bail out on error @@ -71,7 +71,7 @@ sstDepsStage_goblin_hmcsim () popd return $retVal fi - + # Move into the goblin_hmcsim directory pushd ${SST_DEPS_SRC_STAGED_GOBLIN_HMCSIM} echo "gc64-hmcsim.git" `git log HEAD | sed 4q` >&2 @@ -102,7 +102,7 @@ sstDepsDeploy_goblin_hmcsim () pushd ${SST_DEPS_SRC_STAGED_GOBLIN_HMCSIM} # Build and install GOBLIN_HMCSIM - make + make retval=$? if [ $retval -ne 0 ] then @@ -111,10 +111,10 @@ sstDepsDeploy_goblin_hmcsim () popd return $retval fi - + popd - - # NOTE: There is no "make install" for Goblin_HMCSIM. Instead make a + + # NOTE: There is no "make install" for Goblin_HMCSIM. Instead make a # link to the compilied directory if [ ! -d ${SST_DEPS_INSTALL_DEPS}/packages ] then @@ -122,7 +122,7 @@ sstDepsDeploy_goblin_hmcsim () fi ln -s ${SST_DEPS_SRC_STAGED_GOBLIN_HMCSIM} ${SST_DEPS_INSTALL_DEPS}/packages/Goblin_HMCSIM - + } # Installation location as used by SST's "./configure --with-goblin_hmcsim=..." diff --git a/buildsys/deps/bin/sstDep_hbm_dramsim2_stabledevel.sh b/buildsys/deps/bin/sstDep_hbm_dramsim2_stabledevel.sh index 2041d614..eccd8b20 100644 --- a/buildsys/deps/bin/sstDep_hbm_dramsim2_stabledevel.sh +++ b/buildsys/deps/bin/sstDep_hbm_dramsim2_stabledevel.sh @@ -1,7 +1,7 @@ # !/bin/bash # sstDep_hbm_dramsim2_stabledevel.sh -# Description: +# Description: # A bash script containing functions to process SST's HBM_DRAMSim2 # dependency. @@ -28,7 +28,7 @@ export SST_BUILD_HBM_DRAMSIM2_STABLEDEVEL=1 # Outputs: # Pass/fail # Expected Results -# Staged HBM_DRAMSim2 code +# Staged HBM_DRAMSim2 code # Caveats: # None #------------------------------------------------------------------------------- @@ -36,7 +36,7 @@ export SST_DEPS_SRC_STAGED_HBM_DRAMSIM2=${SST_DEPS_SRC_STAGING}/hbm_dramsim2 sstDepsStage_hbm_dramsim2 () { sstDepsAnnounce -h $FUNCNAME -m "Staging hbm_dramsim2 stabledevel" - + pushd ${SST_DEPS_SRC_STAGING} Num_Tries_remaing=3 @@ -45,7 +45,7 @@ sstDepsStage_hbm_dramsim2 () echo " " echo "git clone https://github.com/tactcomplabs/HBM.git hbm_dramsim2" git clone https://github.com/tactcomplabs/HBM.git hbm_dramsim2 - + retVal=$? if [ $retVal == 0 ] ; then Num_Tries_remaing=-1 @@ -69,12 +69,12 @@ sstDepsStage_hbm_dramsim2 () popd return $retval fi - + # Move into the hbm_dramsim2 directory pushd ${SST_DEPS_SRC_STAGED_HBM_DRAMSIM2} git checkout hbm-1.0.0-release - + echo "HBM.git" `git log HEAD | sed 4q` >&2 popd @@ -103,7 +103,7 @@ sstDepsDeploy_hbm_dramsim2 () pushd ${SST_DEPS_SRC_STAGED_HBM_DRAMSIM2} # Build and install HBM_DRAMSIM2 - make + make retval=$? if [ $retval -ne 0 ] then @@ -112,10 +112,10 @@ sstDepsDeploy_hbm_dramsim2 () popd return $retval fi - + popd - - # NOTE: There is no "make install" for HBM_DRAMSim2. Instead make a + + # NOTE: There is no "make install" for HBM_DRAMSim2. Instead make a # link to the compilied directory if [ ! -d ${SST_DEPS_INSTALL_DEPS}/packages ] then @@ -123,7 +123,7 @@ sstDepsDeploy_hbm_dramsim2 () fi ln -s ${SST_DEPS_SRC_STAGED_HBM_DRAMSIM2} ${SST_DEPS_INSTALL_DEPS}/packages/HBM_DRAMSim2 - + } # Installation location as used by SST's "./configure --with-hbmdramsim=..." diff --git a/buildsys/deps/bin/sstDep_hybridsim.sh b/buildsys/deps/bin/sstDep_hybridsim.sh index 038d91ce..50bf41e1 100644 --- a/buildsys/deps/bin/sstDep_hybridsim.sh +++ b/buildsys/deps/bin/sstDep_hybridsim.sh @@ -1,7 +1,7 @@ # !/bin/bash # sstDep_hybridsim.sh -# Description: +# Description: # A bash script containing functions to process SST's HybridSim # dependency. @@ -143,7 +143,7 @@ CXX=clang++\ # if using Intel compiler if [[ ${compiler} =~ icpc.* ]] then - # patch Makefile for Intel compiler on Linux + # patch Makefile for Intel compiler on Linux echo "INFO: (${FUNCNAME}) Intel compiler detected in CXX. Patching Makefile for icc/icpc..." sed -i.bak1 -e 's/g++/$(CXX)/' Makefile # I know the alignment looks awful here. diff --git a/buildsys/deps/bin/sstDep_nvdimmsim.sh b/buildsys/deps/bin/sstDep_nvdimmsim.sh index e1c281a9..ebe9447b 100644 --- a/buildsys/deps/bin/sstDep_nvdimmsim.sh +++ b/buildsys/deps/bin/sstDep_nvdimmsim.sh @@ -1,7 +1,7 @@ # sstDep_nvdimmsim.sh -# Description: +# Description: # A bash script containing functions to process SST's NVDIMMSim # dependency. @@ -40,7 +40,7 @@ sstDepsStage_nvdimmsim () # New May 5, 2014 using 2.0.0 release - + tarFile="NVDIMMSim-2.0.0.tar.gz" sstDepsAnnounce -h $FUNCNAME -m "Staging ${tarFile}." @@ -119,7 +119,7 @@ sstDepsDeploy_nvdimmsim () # if using Intel compiler if [[ ${compiler} =~ icpc.* ]] then - # patch Makefile for Intel compiler on Linux + # patch Makefile for Intel compiler on Linux echo "INFO: (${FUNCNAME}) Intel compiler detected in CXX. Patching Makefile for icc/icpc..." sed -i.bak1 -e 's/g++/$(CXX)/' Makefile # I know the alignment looks awful here. diff --git a/buildsys/deps/bin/sstDep_ramulator_stabledevel.sh b/buildsys/deps/bin/sstDep_ramulator_stabledevel.sh index 419449dd..c0ddbabe 100644 --- a/buildsys/deps/bin/sstDep_ramulator_stabledevel.sh +++ b/buildsys/deps/bin/sstDep_ramulator_stabledevel.sh @@ -1,7 +1,7 @@ # !/bin/bash # sstDep_ramulator_stabledevel.sh -# Description: +# Description: # A bash script containing functions to process SST's Ramulator # dependency. @@ -28,7 +28,7 @@ export SST_BUILD_RAMULATOR_STABLEDEVEL=1 # Outputs: # Pass/fail # Expected Results -# Staged Ramulator code +# Staged Ramulator code # Caveats: # None #------------------------------------------------------------------------------- @@ -36,7 +36,7 @@ export SST_DEPS_SRC_STAGED_RAMULATOR=${SST_DEPS_SRC_STAGING}/ramulator sstDepsStage_ramulator () { sstDepsAnnounce -h $FUNCNAME -m "Staging ramulator stabledevel" - + pushd ${SST_DEPS_SRC_STAGING} Num_Tries_remaing=3 @@ -65,7 +65,7 @@ sstDepsStage_ramulator () fi done echo " " - + if [ $retVal -ne 0 ] ## retVal from git clone then # bail out on error @@ -75,17 +75,17 @@ sstDepsStage_ramulator () popd return $retVal fi - + # Move into the ramulator directory pushd ${SST_DEPS_SRC_STAGED_RAMULATOR} git checkout 7d2e72306c6079768e11a1867eb67b60cee34a1c echo "ramulator.git" `git log HEAD | sed 4q` >&2 - # NOTE: There are 2 patches to be applied to this sha = 7d2e72 to get + # NOTE: There are 2 patches to be applied to this sha = 7d2e72 to get # ramulator library to build properly on gcc # ramulator_gcc48Patch.patch - Fixes compile for gcc 4.8 # ramulator_libPatch.patch - Adds library build for gcc - + popd popd } @@ -120,7 +120,7 @@ sstDepsDeploy_ramulator () # Linux make CXX=g++ libramulator.so fi - + retval=$? if [ $retval -ne 0 ] then @@ -129,10 +129,10 @@ sstDepsDeploy_ramulator () popd return $retval fi - + popd - - # NOTE: There is no "make install" for Ramulator. Instead make a + + # NOTE: There is no "make install" for Ramulator. Instead make a # link to the compilied directory if [ ! -d ${SST_DEPS_INSTALL_DEPS}/packages ] then @@ -140,7 +140,7 @@ sstDepsDeploy_ramulator () fi ln -s ${SST_DEPS_SRC_STAGED_RAMULATOR} ${SST_DEPS_INSTALL_DEPS}/packages/Ramulator - + } # Installation location as used by SST's "./configure --with-ramulator=..." diff --git a/test/testSuites/testcuda/MakefileVecAdd b/test/testSuites/testcuda/MakefileVecAdd index 69525323..af4262cd 100644 --- a/test/testSuites/testcuda/MakefileVecAdd +++ b/test/testSuites/testcuda/MakefileVecAdd @@ -12,5 +12,3 @@ all: vectorAdd clean: rm vectorAdd.160k vectorAdd.o - - diff --git a/test/testSuites/testcuda/vecAdd.cu b/test/testSuites/testcuda/vecAdd.cu index f95d96e7..bb4cb515 100644 --- a/test/testSuites/testcuda/vecAdd.cu +++ b/test/testSuites/testcuda/vecAdd.cu @@ -1,94 +1,94 @@ #include #include #include -#include +#include // CUDA kernel. Each thread takes care of one element of c __global__ void vecAdd(int *a, int *b, int *c, int n) { // Get our global thread ID int id = blockIdx.x*blockDim.x+threadIdx.x; - + // Make sure we do not go out of bounds if (id < n) c[id] = a[id] + b[id]; } - + int main( int argc, char* argv[] ) { // Size of vectors int n = 163840; - + // Host input vectors int *h_a; int *h_b; printf("init point h_a %p\n",h_a); //Host output vector int *h_c; - + // Device input vectors int *d_a; printf("init point d_a %p\n",d_a); int *d_b; //Device output vector int *d_c; - + // Size, in bytes, of each vector size_t bytes = n*sizeof(int); - + // Allocate memory for each vector on host h_a = (int*)malloc(bytes); printf("malloc point h_a %p\n",h_a); h_b = (int*)malloc(bytes); h_c = (int*)malloc(bytes); - + // Allocate memory for each vector on GPU cudaMalloc(&d_a, bytes); printf("cuda malloc point d_a %p\n",d_a); cudaMalloc(&d_b, bytes); cudaMalloc(&d_c, bytes); - + int i; // Initialize vectors on host for( i = 0; i < n; i++ ) { h_a[i] =3; h_b[i] = 4; } - + // Copy host vectors to device printf("pre cpy point h_a %p\n",h_a); printf("pre cpy point d_a %p\n",d_a); cudaMemcpy( d_a, h_a, bytes, cudaMemcpyHostToDevice); cudaMemcpy( d_b, h_b, bytes, cudaMemcpyHostToDevice); - + int blockSize, gridSize; - + // Number of threads in each thread block blockSize = 256; - + // Number of thread blocks in grid gridSize = (int)ceil((float)n/blockSize); - + // Execute the kernel vecAdd<<>>(d_a, d_b, d_c, n); - + // Copy array back to host cudaMemcpy( h_c, d_c, bytes, cudaMemcpyDeviceToHost ); - + // Sum up vector c and print result divided by n, this should equal 1 within error int sum = 0; for(i=0; i 64 - + 1 diff --git a/test/testSuites/teststream/stream.c b/test/testSuites/teststream/stream.c index a72b5b92..fd02282e 100644 --- a/test/testSuites/teststream/stream.c +++ b/test/testSuites/teststream/stream.c @@ -63,13 +63,13 @@ * Example 1: One Xeon E3 with 8 MB L3 cache * STREAM_ARRAY_SIZE should be >= 4 million, giving * an array size of 30.5 MB and a total memory requirement - * of 91.5 MB. + * of 91.5 MB. * Example 2: Two Xeon E5's with 20 MB L3 cache each (using OpenMP) * STREAM_ARRAY_SIZE should be >= 20 million, giving * an array size of 153 MB and a total memory requirement - * of 458 MB. + * of 458 MB. * (b) The size should be large enough so that the 'timing calibration' - * output by the program is at least 20 clock-ticks. + * output by the program is at least 20 clock-ticks. * Example: most versions of Windows have a 10 millisecond timer * granularity. 20 "ticks" at 10 ms/tic is 200 milliseconds. * If the chip is capable of 10 GB/s, it moves 2 GB in 200 msec. @@ -78,7 +78,7 @@ * Version 5.10 increases the default array size from 2 million * elements to 10 million elements in response to the increasing * size of L3 caches. The new default size is large enough for caches - * up to 20 MB. + * up to 20 MB. * Version 5.10 changes the loop index variables from "register int" * to "ssize_t", which allows array indices >2^32 (4 billion) * on properly configured 64-bit systems. Additional compiler options @@ -115,8 +115,8 @@ #endif /* Users are allowed to modify the "OFFSET" variable, which *may* change the - * relative alignment of the arrays (though compilers may change the - * effective offset by making the arrays non-contiguous on some systems). + * relative alignment of the arrays (though compilers may change the + * effective offset by making the arrays non-contiguous on some systems). * Use of non-zero values for OFFSET can be especially helpful if the * STREAM_ARRAY_SIZE is set to a value close to a large power of 2. * OFFSET can also be set on the compile line without changing the source @@ -128,7 +128,7 @@ /* * 3) Compile the code with optimization. Many compilers generate - * unreasonably bad code before the optimizer tightens things up. + * unreasonably bad code before the optimizer tightens things up. * If the results are unreasonably good, on the other hand, the * optimizer might be too smart for me! * @@ -139,7 +139,7 @@ * To use multiple cores, you need to tell the compiler to obey the OpenMP * directives in the code. This varies by compiler, but a common example is * gcc -O -fopenmp stream.c -o stream_omp - * The environment variable OMP_NUM_THREADS allows runtime control of the + * The environment variable OMP_NUM_THREADS allows runtime control of the * number of threads/cores used when the resulting "stream_omp" program * is executed. * @@ -148,9 +148,9 @@ * to the compile line. * Note that this changes the minimum array sizes required --- see (1) above. * - * The preprocessor directive "TUNED" does not do much -- it simply causes the + * The preprocessor directive "TUNED" does not do much -- it simply causes the * code to call separate functions to execute each kernel. Trivial versions - * of these functions are provided, but they are *not* tuned -- they just + * of these functions are provided, but they are *not* tuned -- they just * provide predefined interfaces to be replaced with tuned code. * * @@ -244,19 +244,19 @@ main(int argc, const char* argv[]) #endif printf("Array size = %llu (elements), Offset = %d (elements)\n" , (unsigned long long) STREAM_ARRAY_SIZE, OFFSET); - printf("Memory per array = %.1f MiB (= %.1f GiB).\n", + printf("Memory per array = %.1f MiB (= %.1f GiB).\n", BytesPerWord * ( (double) STREAM_ARRAY_SIZE / 1024.0/1024.0), BytesPerWord * ( (double) STREAM_ARRAY_SIZE / 1024.0/1024.0/1024.0)); printf("Total memory required = %.1f MiB (= %.1f GiB).\n", (3.0 * BytesPerWord) * ( (double) STREAM_ARRAY_SIZE / 1024.0/1024.), (3.0 * BytesPerWord) * ( (double) STREAM_ARRAY_SIZE / 1024.0/1024./1024.)); printf("Each kernel will be executed %d times.\n", NTIMES); - printf(" The *best* time for each kernel (excluding the first iteration)\n"); + printf(" The *best* time for each kernel (excluding the first iteration)\n"); printf(" will be used to compute the reported bandwidth.\n"); #ifdef _OPENMP printf(HLINE); -#pragma omp parallel +#pragma omp parallel { #pragma omp master { @@ -269,20 +269,20 @@ main(int argc, const char* argv[]) #ifdef _OPENMP k = 0; #pragma omp parallel -#pragma omp atomic +#pragma omp atomic k++; printf ("Number of Threads counted = %i\n",k); #endif /* Get initial value for system clock. */ printf ("Stream Array Size = %i. Initializing Arrays...\n",STREAM_ARRAY_SIZE); - + #pragma omp parallel for for (j=0; j= 1) + if ( (quantum = checktick()) >= 1) printf("Your clock granularity/precision appears to be " "%d microseconds.\n", quantum); else { @@ -343,7 +343,7 @@ main(int argc, const char* argv[]) printf("For best results, please be sure you know the\n"); printf("precision of your system timer.\n"); printf(HLINE); - + /* --- MAIN LOOP --- repeat test cases NTIMES times --- */ scalar = 3.0; @@ -357,7 +357,7 @@ main(int argc, const char* argv[]) for (j=0; j\n"; -# For each result +# For each result for $result (@results) { $outfile = "$outfiledir/$result.$outsuffix"; $chkfile = "$chkfiledir/$result.$chksuffix"; diff --git a/test/utilities/moduleex.sh b/test/utilities/moduleex.sh index ef826f8e..df300116 100755 --- a/test/utilities/moduleex.sh +++ b/test/utilities/moduleex.sh @@ -2,21 +2,21 @@ set -o pipefail -# Utility script to launch `module` command and check for errors. module is slightly funky in that -# it does not return an error when it fails, but does normally output errors to stderr (this is due -# to its odd design of part bash and part tcl). However it can generate errors if the tcl script +# Utility script to launch `module` command and check for errors. module is slightly funky in that +# it does not return an error when it fails, but does normally output errors to stderr (this is due +# to its odd design of part bash and part tcl). However it can generate errors if the tcl script # calls exit [N] (see http://modules.sourceforge.net/man/modulefile.html for more info). # -# This script redirects the output of module to a temp file, and then scans the file for the +# This script redirects the output of module to a temp file, and then scans the file for the # module error signature (indicated by "ERROR:"). It also watches the return value of module -# for any possible error values being returned. It then outputs the temp file and lastly checks -# the results. If an error is detected, it will return an error value. +# for any possible error values being returned. It then outputs the temp file and lastly checks +# the results. If an error is detected, it will return an error value. module_ex() { # Verify that 'module' is runnable local retval=0 2>/dev/null 1>&2 module || retval=$? -if [ $retval -ne 0 ] && [ $retval -ne 1 ]; then +if [ $retval -ne 0 ] && [ $retval -ne 1 ]; then echo "'module' command not found by shell" return $retval fi @@ -45,10 +45,10 @@ if [[ -s "$TEMPERRFILE" ]]; then cat "$TEMPERRFILE"; fi # echo "retval = $retval errcount = $errcount" local final=0 -# Check if the errcount or retval of the module call has indicated an error, +# Check if the errcount or retval of the module call has indicated an error, # return one of them and also echo the stored module cmd results to stderr. if [ $errcount -ne 0 ]; then - if [ $retval -ne 0 ]; then + if [ $retval -ne 0 ]; then final=$retval else final=$errcount @@ -65,7 +65,7 @@ elif [[ "$1" == "avail" ]]; then fi fi -# final cleanup & return +# final cleanup & return \rm "$TEMPOUTFILE" "$TEMPERRFILE" return $final } diff --git a/test/utilities/shunit2/README.wiki b/test/utilities/shunit2/README.wiki index 468426a5..4f294483 100644 --- a/test/utilities/shunit2/README.wiki +++ b/test/utilities/shunit2/README.wiki @@ -9,7 +9,7 @@ shUnit2 was originally developed to provide a consistent testing solution for [http://log4sh.sourceforge.net/ log4sh], a shell based logging framework similar to [http://logging.apache.org/log4j/ log4j]. During the development of that product, I repeatedly ran into the problem of having things work just fine under one shell (`/bin/bash` on Linux to be specific), and then not working under another shell (`/bin/sh` on Solaris). Although I had some simple tests that I ran, I finally decided to develop a more robust unit test framework after releasing multiple brown-bag releases. -Rather than reinvent the wheel again, I chose to base the shUnit2 framework as much as possible on JUnit. I wanted something that was both incredibly easy to use, but that was as well incredibly powerful. I knew that the code would be built only for log4sh at the start, but hoped that someday I could release the code as a separate project. Now that the code is stable and mature enough, I have done just that. +Rather than reinvent the wheel again, I chose to base the shUnit2 framework as much as possible on JUnit. I wanted something that was both incredibly easy to use, but that was as well incredibly powerful. I knew that the code would be built only for log4sh at the start, but hoped that someday I could release the code as a separate project. Now that the code is stable and mature enough, I have done just that. You might ask why I didn't just use the already existing [http://shunit.sourceforge.net/ ShUnit] product. I took a look at it, but wasn't really happy with how it worked or how little it reflected the way JUnit and other unit test frameworks function. As such, I figured that it was probably better just to write my own. @@ -79,4 +79,4 @@ shUnit2 is licensed under the GNU [http://www.gnu.org/licenses/lgpl.html Lesser === Thanks === A list of contributors is provided with each release (found as `doc/contributors.txt`). Many thanks go out to each of these individuals for finding bugs and/or providing patches. -Hosting resources are gracefully provided by [http://code.google.com/ Google Code]. \ No newline at end of file +Hosting resources are gracefully provided by [http://code.google.com/ Google Code]. diff --git a/test/utilities/shunit2/doc/LGPL-2.1 b/test/utilities/shunit2/doc/LGPL-2.1 index b1e3f5a2..56de5de6 100644 --- a/test/utilities/shunit2/doc/LGPL-2.1 +++ b/test/utilities/shunit2/doc/LGPL-2.1 @@ -55,7 +55,7 @@ modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. - + Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a @@ -111,7 +111,7 @@ modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. - + GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION @@ -146,7 +146,7 @@ such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. - + 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an @@ -158,7 +158,7 @@ Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. - + 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 @@ -216,7 +216,7 @@ instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. - + Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. @@ -267,7 +267,7 @@ Library will still fall under Section 6.) distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. - + 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work @@ -329,7 +329,7 @@ restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. - + 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined @@ -370,7 +370,7 @@ subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. - + 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or @@ -422,7 +422,7 @@ conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. - + 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is @@ -456,7 +456,7 @@ SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS - + How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest @@ -500,5 +500,3 @@ necessary. Here is a sample; alter the names: Ty Coon, President of Vice That's all there is to it! - - diff --git a/test/utilities/shunit2/lib/versions b/test/utilities/shunit2/lib/versions index b874d80c..9f0f3026 100755 --- a/test/utilities/shunit2/lib/versions +++ b/test/utilities/shunit2/lib/versions @@ -153,7 +153,7 @@ versions_shell_ksh() |sed 's/.*\([0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]\).*/\1/'` # --version didn't work... look into the binary - if [ $? -ne ${TRUE} ]; then + if [ $? -ne ${TRUE} ]; then _versions_have_strings versions_version_=`strings ${versions_shell_} 2>&1 \ |grep Version \ diff --git a/test/utilities/shunit2/src/shunit2 b/test/utilities/shunit2/src/shunit2 index 9ec6fe7f..33f87d3f 100755 --- a/test/utilities/shunit2/src/shunit2 +++ b/test/utilities/shunit2/src/shunit2 @@ -32,10 +32,10 @@ SHUNIT_STDOUT=${SHUNIT_STDOUT:-${SHUNIT_TRUE}} # Include environment SHUNIT_INCLUDE_ENV=${SHUNIT_INCLUDE_ENV:-${SHUNIT_TRUE}} ### ADDED BY ALevine STARTING HERE - Force SHUNIT_INCLUDE_ENV to equal SHUNIT_FALSE -### Prevents output of environment into XML file +### Prevents output of environment into XML file ### which possibly generates malformed XML syntax. SHUNIT_INCLUDE_ENV=${SHUNIT_FALSE} -### ADDED BY ALevine ENDING HERE +### ADDED BY ALevine ENDING HERE # Maximum failed tests before quit SHUNIT_MAX_FAIL_TESTS=${SHUNIT_MAX_FAIL_TESTS:-10} @@ -56,7 +56,7 @@ _shunit_log_fail() { _shunit_msg_=$1 -### __shunit_case_errors="${__shunit_case_errors}/>/g' )\"/>" ### MODIFIED BY ALevine - Force Each Failure msg to be on a separate line in XML +### __shunit_case_errors="${__shunit_case_errors}/>/g' )\"/>" ### MODIFIED BY ALevine - Force Each Failure msg to be on a separate line in XML __shunit_case_errors="${__shunit_case_errors} />/g' )\">" @@ -64,7 +64,7 @@ _shunit_log_fail() } # log an unexpected failure into the test case error buffer -_shunit_log_error() +_shunit_log_error() { _level_=$1 shift @@ -496,7 +496,7 @@ _ASSERT_FALSE_='eval assertFalse --lineno "${LINENO:-}"' #----------------------------------------------------------------------------- # Skip one test by request from test Suite - + # # Args: # none @@ -598,10 +598,10 @@ failSame() shunit_message_="${shunit_message_}$1" shift fi -### ADDED BY ALevine STARTING HERE - Missing assignment of vars +### ADDED BY ALevine STARTING HERE - Missing assignment of vars shunit_expected_=$1 shunit_actual_=$2 -### ADDED BY ALevine ENDING HERE +### ADDED BY ALevine ENDING HERE ### _shunit_assertFail "${shunit_message_:+${shunit_message_} }expected not same" ### MODIFIED BY ALevine - Cleaned up message a bit to make more readable _shunit_assertFail "${shunit_message_:+${shunit_message_} }expected ${shunit_expected_} not different than ${shunit_actual_}" @@ -862,33 +862,33 @@ _shunit_cleanup() # exit ${SHUNIT_ERROR} ######################### - ### MODIFIED BY ALevine - Added code to generate a failure, and force output - ### to the xml to work correctly with Jenkins. Lastly shut down any timeout + ### MODIFIED BY ALevine - Added code to generate a failure, and force output + ### to the xml to work correctly with Jenkins. Lastly shut down any timeout ### monitors - + ### First Force a failure _shunit_assertFail "Unknown failure encountered while running Test Suite [${__shunit_suite_name}]; Script abnomally exited" - - ### Perform a setup of the __shunit_cases variable due to the error, this + + ### Perform a setup of the __shunit_cases variable due to the error, this ### is normally done at end of _shunit_execSuite(), but abnormal exit prevents ### __shunit_cases from being populated properly so we have to do it here. ### Once __shunit_cases is properly populated, then we can call _shunit_generateFinalReport(). _shunit_generateTestCaseReport - - ### Since Test Script aborted, the output no output was generated; and the - ### files were not populated. So add some general gunk to give the - ### _shunit_generateFinalReport() to chew on. + + ### Since Test Script aborted, the output no output was generated; and the + ### files were not populated. So add some general gunk to give the + ### _shunit_generateFinalReport() to chew on. __shunit_system_out=$(mktemp -u 'shunit-out.XXXX') __shunit_system_err=$(mktemp -u 'shunit-err.XXXX') echo "Unknown failure encountered while running Test Suite [${__shunit_suite_name}]; Script abnomally exited" > $__shunit_system_out echo "Unknown failure encountered while running Test Suite [${__shunit_suite_name}]; Script abnomally exited" > $__shunit_system_err - ### Generate the XML report before we generate the final assert error + ### Generate the XML report before we generate the final assert error _shunit_generateFinalReport - + ### MODIFIED BY ALevine - Done with code additions ######################### - + _shunit_assertError "Unknown failure encountered while running Test Suite [${__shunit_suite_name}]; Script abnomally exited" fi @@ -901,21 +901,21 @@ _shunit_cleanup() # None _shunit_execSuite() { - + # loop over test cases for _shunit_case_ in ${__shunit_suite}; do __shunit_testSuccess=${SHUNIT_TRUE} # reset test cases errors buffer __shunit_case_errors='' - + # reset test cases skips buffer __shunit_case_skips='' # disable skipping endSkipping - # Clear the flag that says that this test should be skipped + # Clear the flag that says that this test should be skipped __shunit_this_test_skipped=${SHUNIT_FALSE} # execute the per-test setup function @@ -935,36 +935,36 @@ _shunit_execSuite() MULT="${MULT} nr=${SST_MULTI_RANK_COUNT}" fi echo "${_shunit_case_} $MULT" - + ## Execute the Test Case eval ${_shunit_case_} - + # Check to see if this Test Case internally decided to skip if [ ${__shunit_this_test_skipped} -eq ${SHUNIT_TRUE} ] ; then _shunit_assertSkip fi - + # Generate the Test Case report _shunit_generateTestCaseReport - + # Update the Total Number of tests __shunit_testsTotal=`expr ${__shunit_testsFailed} + ${__shunit_testsPassed} + ${__shunit_testsSkipped}` - + # Execute the per-test tear-down function tearDown - # Check to see if this Test Case was skipped, if so, stop any additonal Stats processing + # Check to see if this Test Case was skipped, if so, stop any additonal Stats processing if [ ${__shunit_this_test_skipped} -eq ${SHUNIT_TRUE} ] ; then continue fi - + # update stats if [ ${__shunit_testSuccess} -eq ${SHUNIT_TRUE} ]; then __shunit_testsPassed=`expr ${__shunit_testsPassed} + 1` else __shunit_testsFailed=`expr ${__shunit_testsFailed} + 1` fi - + # Check for Test Fail limits if [ ${__shunit_testsFailed} -ge ${SHUNIT_MAX_FAIL_TESTS} ] ; then echo " **************************************" ; echo " " @@ -973,7 +973,7 @@ _shunit_execSuite() __shunit_testsTotal=`expr ${__shunit_testsFailed} + ${__shunit_testsPassed} + ${__shunit_testsSkipped}` break; fi - if [ ${SHUNIT_MAX_TEST_COUNT} -ne 0 -a `expr ${__shunit_testsFailed} + ${__shunit_testsPassed} + ${__shunit_testsSkipped}` -ge ${SHUNIT_MAX_TEST_COUNT} ] + if [ ${SHUNIT_MAX_TEST_COUNT} -ne 0 -a `expr ${__shunit_testsFailed} + ${__shunit_testsPassed} + ${__shunit_testsSkipped}` -ge ${SHUNIT_MAX_TEST_COUNT} ] then echo "Only ${SHUNIT_MAX_TEST_COUNT} tests requested \"\$SHUNIT_MAX_TEST_COUNT\"" __shunit_testsTotal=`expr ${__shunit_testsFailed} + ${__shunit_testsPassed} + ${__shunit_testsSkipped}` @@ -984,7 +984,7 @@ _shunit_execSuite() export __shunit_testsFailed # Update the Total Number of tests export __shunit_testsTotal=`expr ${__shunit_testsFailed} + ${__shunit_testsPassed} + ${__shunit_testsSkipped}` - + # unset _shunit_test_ unset _shunit_case_ } @@ -1012,19 +1012,19 @@ _shunit_generateTestCaseReport() __shunit_cases="${__shunit_cases} " fi - + # Output any Failures (Errors) as sub-elements if [ -n "${__shunit_case_errors}" ] then __shunit_cases="${__shunit_cases}${__shunit_case_errors}" fi - + # Output any Skips as sub-elements if [ -n "${__shunit_case_skips}" ] then __shunit_cases="${__shunit_cases}${__shunit_case_skips}" fi - + # Finally close out the test case Element __shunit_cases="${__shunit_cases} @@ -1052,7 +1052,7 @@ _shunit_generateFinalReport() # && _shunit_ok_=${SHUNIT_FALSE} if [ -n "${SHUNIT_OUTPUTDIR:-}" ]; then -### cat << EOF >> "${SHUNIT_OUTPUTDIR}/TEST-${__shunit_suite_name}.xml" ### MODIFIED BY ALevine - To overwrite xml not append to it +### cat << EOF >> "${SHUNIT_OUTPUTDIR}/TEST-${__shunit_suite_name}.xml" ### MODIFIED BY ALevine - To overwrite xml not append to it touch ${__shunit_system_err} ## Get rid of "cat of noexistent file message" cat << EOF > "${SHUNIT_OUTPUTDIR}/TEST-${__shunit_suite_name}.xml" @@ -1068,7 +1068,7 @@ EOF ### ADDED CODE STARTING HERE - ALevine ## - ADDED CODE TO OUTPUT SOME STATISTIC INFO FOR SST RUNS SINCE WHEN USING - ## NEW SHUNIT2 OPERATION (enabled by setting variable SHUNIT_OUTPUTDIR) + ## NEW SHUNIT2 OPERATION (enabled by setting variable SHUNIT_OUTPUTDIR) ## WILL PREVENT difftoxml.pl FROM RUNNING AND OUTPUTING THE STATS echo "Report from shunit2": echo "====================================================================================================" @@ -1079,7 +1079,7 @@ EOF ### ADDED CODE ENDING HERE - ALevine fi - + if [ ${SHUNIT_STDOUT} -eq ${SHUNIT_TRUE} ]; then echo if [ ${__shunit_testsTotal} -eq 1 ]; then From 3a1b2097339face64af8ac09824b830b2901e8cc Mon Sep 17 00:00:00 2001 From: Eric Berquist Date: Wed, 20 Sep 2023 09:20:12 -0600 Subject: [PATCH 7/7] git blame ignore pre-commit fixes --- .git-blame-ignore-revs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index 545d30b1..923a8f8b 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -8,3 +8,5 @@ e5f8163d5e58fff75ab276418686353a52977727 bf8f1ee98d609edc5b4255eb0f39574ca8392772 # Indentation a278d60eb48a083919b18c1918af574f683e4acc +# pre-commit fixes +1fbf9b9d7c1d76a1191eaa11ad23e67506103225