From d83e8fe34b94acbed123afb1ee1de5c06c0c2562 Mon Sep 17 00:00:00 2001 From: Adam Dobrowolski Date: Thu, 16 Sep 2021 15:43:34 +0200 Subject: [PATCH] [EGD-7445] Removed dead scripts Removed dead scripts --- .github/actions/build/action.yml | 47 ------------ .github/workflows/main.yml | 93 ------------------------ .github/workflows/releases.yaml | 84 --------------------- PurePhone JLink Debug.launch | 91 ----------------------- doc/adding_unittests.md | 23 +----- print_last_changes.sh | 17 ----- tools/check_unittests.sh | 121 ------------------------------- tools/daily_release.sh | 116 ----------------------------- tools/get_unittests.sh | 77 -------------------- tools/last_changelog.awk | 17 ----- tools/run_unittests.sh | 77 -------------------- tools/upload_release.sh | 53 -------------- 12 files changed, 1 insertion(+), 815 deletions(-) delete mode 100644 .github/actions/build/action.yml delete mode 100644 .github/workflows/main.yml delete mode 100644 .github/workflows/releases.yaml delete mode 100644 PurePhone JLink Debug.launch delete mode 100755 print_last_changes.sh delete mode 100755 tools/check_unittests.sh delete mode 100755 tools/daily_release.sh delete mode 100755 tools/get_unittests.sh delete mode 100755 tools/last_changelog.awk delete mode 100755 tools/run_unittests.sh delete mode 100755 tools/upload_release.sh diff --git a/.github/actions/build/action.yml b/.github/actions/build/action.yml deleted file mode 100644 index 8b15f7ee26c6997452eecacf7ba5ee989dde4fc4..0000000000000000000000000000000000000000 --- a/.github/actions/build/action.yml +++ /dev/null @@ -1,47 +0,0 @@ -name: 'Style Check' -description: 'Checking style for last commit' -branding: - icon: 'align-left' - color: 'white' -inputs: - action: - description: 'Describes action to be taken: style|configure|build|c&b|check|package' - required: true - default: 'style' - target: - description: 'Defines on destination target, should be one of: rt1051|linux' - required: false - default: 'rt1051' - build_type: - destination: 'Defines build type, must be one of: Debug|Release|RelWithDebInfo' - required: false - default: 'RelWithDebInfo' - build_generator: - description: 'Define kind of generator, must be one of make|Ninja' - required: false - default: 'make' - jobs: - description: 'Defines how many parallel jobs to run, default is to number of cpus' - required: false - default: 'nproc' -outputs: - build_dir: # name of the vaiable - description: "Build directory name" - package: - description: "Name of the package" - package_path: - description: "Full path to the package" - mime_type: - description: "Mime type of the package" - release_notes: - description: "Content of changelog.md" -runs: - using: 'docker' - image: 'docker://muditadocker/pure_phone_build:v1.2' - args: - - ${{ inputs.action }} - - ${{ inputs.target }} - - ${{ inputs.build_type }} - - ${{ inputs.build_generator}} - - ${{ inputs.jobs}} - diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index 677b743131c264f228ea46cf07242a1d4cb519c2..0000000000000000000000000000000000000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,93 +0,0 @@ -name: CI - -on: - pull_request: - types: - - opened - - synchronize - - reopened - - ready_for_review - -jobs: - check_commit_messages: - name: check commit messages - if: github.event.pull_request.draft == false - runs-on: self-hosted - steps: - - name: clone repository - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - name: check commit messages - run: ./tools/check_commit_messages.py - - check_copyright_and_style: - name: check copyright and style - if: github.event.pull_request.draft == false - runs-on: self-hosted - steps: - - name: clone repository - uses: actions/checkout@v2 - with: - token: ${{ secrets.GitHub_PAT }} - fetch-depth: 0 - submodules: recursive - - name: Copyright notice check - run: config/license_header_check.sh --ci --check-only - - name: Style checking - run: ./config/style_check_hook.sh --last - - name: Clang tidy check - run: ./config/clang_check.sh - - build_rt1051_binary: - name: build rt1051 binary - if: github.event.pull_request.draft == false - needs: - - check_copyright_and_style - runs-on: self-hosted - steps: - - name: clone repository - uses: actions/checkout@v2 - with: - token: ${{ secrets.GitHub_PAT }} - submodules: recursive - - name: Build for RT1051 - run: | - export JOBS=${JOBS:-$(nproc)} && \ - echo "JOBS=${JOBS}" && \ - ./configure.sh pure rt1051 Release -G Ninja && \ - pushd build-purephone-rt1051-Release && \ - ninja -j ${JOBS} && \ - popd - - build_linux_binary_and_run_tests: - name: build linux binary and run tests - if: github.event.pull_request.draft == false - needs: - - check_copyright_and_style - runs-on: self-hosted - steps: - - name: clone repository - uses: actions/checkout@v2 - with: - token: ${{ secrets.GitHub_PAT }} - submodules: recursive - - name: build Linux Debug - run: | - export JOBS=${JOBS:-$(nproc)} && \ - echo "JOBS=${JOBS}" && \ - ./configure.sh pure linux Debug -G Ninja && \ - pushd build-purephone-linux-Debug && \ - ninja -j ${JOBS} unittests && \ - ninja -j ${JOBS} && \ - popd - - name: run unit tests - run: | - ./tools/run_unittests.sh enabled_unittests - - name: Check for statics - run: | - ./tools/find_global_data.py build-purephone-linux-Debug/PurePhone.elf - - name: check if all Unit Tests where run - run: | - ./tools/check_unittests.sh enabled_unit_tests - diff --git a/.github/workflows/releases.yaml b/.github/workflows/releases.yaml deleted file mode 100644 index b2b82c5dd0ac3c1ab5395df50b0f140aa9ee7b04..0000000000000000000000000000000000000000 --- a/.github/workflows/releases.yaml +++ /dev/null @@ -1,84 +0,0 @@ -name: Build Release -on: - push: - tags: - - 'release-*' - -jobs: - build: - runs-on: self-hosted - steps: - - name: "Check Out" - uses: actions/checkout@v2 - with: - token: ${{ secrets.RELEASE_TOKEN }} - submodules: recursive - fetch-depth: 0 - - name: "Style checking" - run: | - ./config/pre-commit.hook --last - - name: Build Unit Tests - run: | - export JOBS=${JOBS:-$(nproc)} && \ - echo "JOBS=${JOBS}" && \ - ./configure.sh pure linux Debug -G Ninja && \ - pushd build-purephone-linux-Debug && \ - ninja unittests && \ - popd - - name: Run unit tests - run: | - export JOBS=${JOBS:-$(nproc)} && \ - echo "JOBS=${JOBS}" && \ - pushd build-purephone-linux-Debug && \ - ninja check -j ${JOBS} && \ - popd - - name: "Build and package for RT1051" - id: build_release_package - env: - ASSETS_LOGIN: ${{ secrets.ASSETS_LOGIN }} - ASSETS_TOKEN: ${{ secrets.ASSETS_TOKEN }} - run: | - export JOBS=${JOBS:-$(nproc)} && \ - echo "JOBS=${JOBS}" && \ - ./configure.sh pure rt1051 RelWithDebInfo -DWITH_BOARD_REVISION=6 -G Ninja && \ - pushd build-purephone-rt1051-RelWithDebInfo && \ - ninja -j ${JOBS} Pure&& \ - ninja -j ${JOBS} PurePhone-UpdatePackage && \ - ninja -j ${JOBS} PurePhone-StandaloneImage && \ - popd && \ - ./print_last_changes.sh && \ - uptime - - name: Create Release - id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} - with: - tag_name: ${{ github.ref }} - release_name: ${{ github.ref }} - draft: true - prerelease: true - body: ${{steps.build_release_package.outputs.release_notes }} - - name: Upload Standalone Package - id: upload-stanalone-package - uses: actions/upload-release-asset@v1.0.2 - env: - GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - # here we have to use relative path with starting "./" - asset_path: ./${{ steps.build_release_package.outputs.package_path }}/${{ steps.build_release_package.outputs.package-standalone }} - asset_name: ${{ steps.build_release_package.outputs.package-standalone }} - asset_content_type: ${{ steps.build_release_package.outputs.standalone-mime_type }} - - name: Upload Update Package - id: upload-update-package - uses: actions/upload-release-asset@v1.0.2 - env: - GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - # here we have to use relative path with starting "./" - asset_path: ./${{ steps.build_release_package.outputs.package_path }}/${{ steps.build_release_package.outputs.package-update }} - asset_name: ${{ steps.build_release_package.outputs.package-update }} - asset_content_type: ${{ steps.build_release_package.outputs.update-mime_type }} - diff --git a/PurePhone JLink Debug.launch b/PurePhone JLink Debug.launch deleted file mode 100644 index 8961d596333b22c15ca334d343209f54e66d33de..0000000000000000000000000000000000000000 --- a/PurePhone JLink Debug.launch +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/doc/adding_unittests.md b/doc/adding_unittests.md index 0da513dcf76caa79a08936d46744268726699314..33a567d33484d7ca8259ae278da8be97fe542556 100644 --- a/doc/adding_unittests.md +++ b/doc/adding_unittests.md @@ -10,25 +10,16 @@ There are few test written in `gtest` but we focus on using `catch2` In `CMakeLists.txt` use `add_catch2_executable` function for tests based on `catch2`. If you wrote your test in `gtest` use `add_gtest_executable` function. Both functions are defined in `test/CMakeLists.txt` and there described parameters. -Then to make sure that test is run add it to `enabled_unittests`. Each binary has it's own section, and in section we each test in separate line, each test name have to end with; -## disable unit test - -If for some reason you need to disable some unit test, find it in `enabled_unittests` and -put # before it's name - ## checking what tests are run On our CI, we check what tests are available in binaries and if they where run. If some tests are not run, job called "Check run unit tests" will fail, this check is not required for PR to pass, it is just indicator that some tests are not working. -## running tests - -Locally we may run tests in two way by `make check` or by `./tools/run_unittests.sh` ### make check @@ -36,18 +27,6 @@ This will run all defined tests, even disabled ones, what is useful for unit tes This way is not used on CI. ```bash -cd buil-linux-Debug +cd build-purephone-linux-Debug make check ``` - -### run_unittests.sh - -Runs only enabled tests, this how we do it on CI. -All tests must pass, if test doesn't pass PR is blocked. - - -```bash -./tools/run_unittests.sh enabled_unittests -``` - -This script may be used for running set of tests. diff --git a/print_last_changes.sh b/print_last_changes.sh deleted file mode 100755 index 1e36d27272092c6f6cd8f8ab5b01ce953bf3d1bc..0000000000000000000000000000000000000000 --- a/print_last_changes.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash -# Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved. -# For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md - -# prints change log as a GitHub Variable - -CHANGELOG_FILE="changelog.md" - -function printChangeLogForGH() { - CHANGELOG="$(awk -f tools/last_changelog.awk ${CHANGELOG_FILE})" - CHANGELOG="${CHANGELOG//'%'/'%25'}" - CHANGELOG="${CHANGELOG//$'\n'/'%0A'}" - CHANGELOG="${CHANGELOG//$'\r'/'%0D'}" - echo "::set-output name=release_notes::${CHANGELOG}" -} - -printChangeLogForGH diff --git a/tools/check_unittests.sh b/tools/check_unittests.sh deleted file mode 100755 index 3d98f27ccf19a3a1640303806bfcdc326631477e..0000000000000000000000000000000000000000 --- a/tools/check_unittests.sh +++ /dev/null @@ -1,121 +0,0 @@ -#!/bin/bash -# Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved. -# For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md - -root_dir="$(realpath $(dirname $(realpath $0))/..)" -build_dir="${root_dir}/build-linux-Debug" - -ALL_TESTS_FILE=all_unittests -ALL_TESTS_PATH=${build_dir}/${ALL_TESTS_FILE} -ENABLED_TESTS_PATH=${root_dir}/enabled_unittests - -END=0 - -trim() { - local var="$*" - # remove leading whitespace characters - var="${var#"${var%%[![:space:]]*}"}" - # remove trailing whitespace characters - var="${var%"${var##*[![:space:]]}"}" - printf '%s' "$var" -} - - -# get all tests -${root_dir}/tools/get_unittests.sh ${ALL_TESTS_FILE} CHECK_OUT > /dev/null -TEMP_SOURCE=$(mktemp) -sed -e '/^[[:space:]]*#.*/d' ${ALL_TESTS_PATH} > $TEMP_SOURCE -source ${TEMP_SOURCE} - -# get enabled tests -sed -e '/^[[:space:]]*#.*/d' ${ENABLED_TESTS_PATH} > $TEMP_SOURCE -source ${TEMP_SOURCE} - -declare -a BINARY_NOT_RUN -declare -A TESTS_NOT_RUN -echo "--tests--" -for BINARY in ${!CHECK_OUT[@]} -do - #echo BINARY:$BINARY - #echo "TESTS_LIST[${BINARY}]: ${TESTS_LIST[${BINARY}]}" - if [[ -n "${TESTS_LIST[${BINARY}]}" ]]; then - #echo "" - readarray -d\; -t TESTS_FROM_ALL < <(echo ${CHECK_OUT["${BINARY}"]} | tr "\n" " ") - #declare -p TESTS_FROM_ALL - #echo "NO: ${#TESTS_FROM_ALL[@]}" - I=0 - declare -a TEST_NOT_RUN - while [[ ${I} -lt ${#TESTS_FROM_ALL[@]} ]]; - do - CURRENT_TEST=$(trim ${TESTS_FROM_ALL[${I}]}) - if [[ -n "$CURRENT_TEST" ]]; then - #if [[ ${BINARY} == "catch2-gui-text" ]]; then - # echo "--- CURRENT_TEST: ${CURRENT_TEST}" - #fi - CHK=$(echo ${TESTS_LIST["${BINARY}"]} | grep -F "${CURRENT_TEST}") - #echo "#@#@#@# $CHK #@#@##" - if [[ -z "${CHK}" ]]; then - #echo "!!!!!!!!!!${CURRENT_TEST}!!!!!!!!!" - TEST_NOT_RUN+=("${CURRENT_TEST}") - fi - fi - I=$(( $I + 1 )) - done - if [[ "${#TEST_NOT_RUN[@]}" -gt 0 ]]; then - #echo "!@@!@!@!@!@! ${#TEST_NOT_RUN[@]} @!#!@#!@#!" - #declare -p TEST_NOT_RUN - I=0 - TEST_NOT_RUN_STR="" - while [[ $I -lt ${#TEST_NOT_RUN[@]} ]] - do - #TEST_NOT_RUN_STR="${TEST_NOT_RUN[${I}]};${TEST_NOT_RUN_STR}" - TEST_NOT_RUN_STR="${TEST_NOT_RUN_STR};${TEST_NOT_RUN[${I}]}" - I=$(( I + 1 )) - done - TESTS_NOT_RUN["${BINARY}"]="${TEST_NOT_RUN_STR}" - unset TEST_NOT_RUN - fi - else - #echo "######## $BINARY ########" - BINARY_NOT_RUN+=($BINARY) - fi -done - -if [[ -n "${BINARY_NOT_RUN}" ]]; then - END=1 - I=0 - echo "binaries not run:" - while [[ $I -lt ${#BINARY_NOT_RUN[@]} ]] - do - echo " - ${BINARY_NOT_RUN[$I]}" - I=$(( $I + 1 )) - done -fi -pushd ${build_dir} > /dev/null -BINARIES_IN_BUILD=( `ls -1 catch2*` ) -popd > /dev/null -BINARIES_IN_DECLARED=( ${!TESTS_LIST[@]} ) - -if [[ ${#BINARIES_IN_BUILD[@]} -ne ${#BINARIES_IN_DECLARED[@]} ]]; then - END=1 - echo "not all binaries were build:" - printf '\t- %s\n' ${BINARIES_IN_BUILD[@]} ${BINARIES_IN_DECLARED[@]} | sort | uniq -u -fi -#declare -p TESTS_NOT_RUN -#echo ${#TESTS_NOT_RUN[@]} -if [[ "${#TESTS_NOT_RUN[@]}" -gt 0 ]]; then - END=1 - echo "Tests not run:" - for BINARY in ${!TESTS_NOT_RUN[@]} - do - echo -n " - Binary: ${BINARY}" - echo "${TESTS_NOT_RUN[${BINARY}]}" | sed 's/;/\n\t- /g' - done -fi - -case $END in - "0") echo "OK";; - "*") echo "ERROR";; -esac - -exit $END diff --git a/tools/daily_release.sh b/tools/daily_release.sh deleted file mode 100755 index 277c1cfd2e82617102bd46d77b408fcf361f6c75..0000000000000000000000000000000000000000 --- a/tools/daily_release.sh +++ /dev/null @@ -1,116 +0,0 @@ -#!/bin/bash -# Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved. -# For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md - -#script is used on CI for creating daily builds - -#this script should be run in docker container - -set -e - -LOGIN=${LOGIN} -TOKEN=${TOKEN} -IMAGE_NAME=${IMAGE_NAME:-wearemudita/mudita_os_builder:1.9} -WORK_DIR=${WORK_DIR:-MuditaOS} -REPOSITORY_URL=${REPOSITORY_URL:-https://${TOKEN}:x-oauth-basic@github.com/mudita/MuditaOS} -REPOSITORY_BRANCH=${REPOSITORY_BRANCH:-master} -ARTIFACTS_DIR=${ARTIFACTS_DIR:-/artifacts/${REPOSITORY_BRANCH}} -PRODUCT=${PRODUCT:-PurePhone} - -CONFIG_LOG=config.log - -VARS_TO_CHECK=( - PRODUCT - REPOSITORY_URL - REPOSITORY_BRANCH - LOGIN - TOKEN - IMAGE_NAME - ) - -function printVar(){ - echo "$1: '${!1}'" -} - -function checkVariables() { - I=0 - while [[ $I -lt ${#VARS_TO_CHECK[@]} ]] - do - printVar ${VARS_TO_CHECK[$I]} - if [[ -z "${!VARS_TO_CHECK[$I]}" ]]; then - echo "${VARS_TO_CHECK[$I]} is not set - aborting" 1>&2 - exit 1 - fi - I=$(( I + 1 )) - done -} - -function checkIfGit() { - if [[ -d .git ]]; then - echo .git; - else - git rev-parse --git-dir 2> /dev/null; - fi; -} - -function addTokens(){ - git config user.githublogin ${LOGIN} - git config user.apitoken ${TOKEN} -} - -##################### script #################### -checkVariables - -if [ ! -d ${ARTIFACTS_DIR} ]; then - mkdir -p ${ARTIFACTS_DIR} -fi - -if [ ! -d ${WORK_DIR} ]; then - mkdir -p ${WORK_DIR} -fi - -pushd ${WORK_DIR} - -if checkIfGit; then - git clean -ffdx &>/dev/null - git fetch --tags --force &>/dev/null - git checkout ${REPOSITORY_BRANCH} -f - git reset origin/${REPOSITORY_BRANCH} --hard &>/dev/null - git submodule update --init --recursive --force &>/dev/null -else - echo "not a git dir" - git clone --recurse-submodules -b ${REPOSITORY_BRANCH} ${REPOSITORY_URL} . -fi - -if [ ! -d ccache ]; then - mkdir ccache -fi - -CCACHE_DIR=$(pwd)/ccache -export CCACHE_DIR - -DATE=$(date "+%Y.%m.%d") -# gets latest release tag -# please mind that if there are more than one tag - first will be taken -LATEST=$(git tag -l | grep release\- | grep -E '[0-9]{1,2}.[0-9]{1,2}.[0-9]{1,2}' -o | tail -1) -VERSION="${LATEST}-${DATE}" -echo "Creating release with: $VERSION" - -addTokens -git submodule update --init --recursive -git tag -f daily-${VERSION} -git push -f origin daily-${VERSION} -./configure.sh ${PRODUCT} rt1051 RelWithDebInfo -G Ninja -cd build-${PRODUCT,,}-rt1051-RelWithDebInfo -ninja -ninja ${PRODUCT}-StandaloneImage -ninja ${PRODUCT}-UpdatePackage - -PKG_NAME_PREFIX=${PRODUCT}-${LATEST}-RT1051 - -echo "Copy assets to ${ARTIFACTS_DIR}" -cp *-image.tar.xz ${ARTIFACTS_DIR}/${PKG_NAME_PREFIX}-${DATE}-image.tar.xz -cp *-Update.tar ${ARTIFACTS_DIR}/${PKG_NAME_PREFIX}-${DATE}-Update.tar - -/scripts/upload_release.sh tag="daily-${VERSION}" token="$TOKEN" repo="MuditaOS" files="${ARTIFACTS_DIR}/${PKG_NAME_PREFIX}-${DATE}-image.tar.xz,${ARTIFACTS_DIR}/${PKG_NAME_PREFIX}-${DATE}-Update.tar,PurePhone.elf" || { echo "upload failed!"; exit 1; } -popd diff --git a/tools/get_unittests.sh b/tools/get_unittests.sh deleted file mode 100755 index 15464343706426d1d4bc571f7fa8173e3426b9c0..0000000000000000000000000000000000000000 --- a/tools/get_unittests.sh +++ /dev/null @@ -1,77 +0,0 @@ -#!/bin/bash -# Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved. -# For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md - -root_dir="$(realpath $(dirname $(realpath $0))/..)" -build_dir="${root_dir}/build-linux-Debug" - -function help() { - cat <<- EOF - Usage: $0 tests_list [VAR_NAME] - EOF -} - - -if [[ $# -lt 1 ]]; then - help - exit 1 -fi - -TESTS_FILE=$1 - -TESTS_LIST_VAR=${2:-TESTS_LIST} - -function addHeader() { -cat <<- EOF - # Enabled test list - # test format - # TESTS_LIST["catch2-"]=" - # test 1; - # test 1; - # test 3; - #" - # - # each test is in separate line - # to disable test just rem it by putting # in front of it - # - # folowing caracters have to be escaped: - # [], - # \[ \] \, - - declare -A ${TESTS_LIST_VAR} - -EOF -} - -pushd ${build_dir} -addHeader > ${TESTS_FILE} - -for TEST_BINARY in catch2-* -do - echo "${TEST_BINARY}" - echo "${TESTS_LIST_VAR}[\"${TEST_BINARY}\"]=\"" >> ${TESTS_FILE} - - #sed explaind - #:a - lablel 'a' current pattern space to jump to - #N - append next line to pattern space (wiht \n) - #/\n / - search for this pattern - #s/\n // - delete "\n " (can be "replace") - #ta - if we changed something, jump to lable 'a' - #P - print part until new line - #D - delete part until new line - TESTS_LIST_STR=$(./${TEST_BINARY} -l | grep -E "^ .*" | cut -f3- -d\ | sed -e ':a;N;/\n /s/\n //;ta;P;D' ) - - readarray -t TESTS_LIST < <( echo -e "$TESTS_LIST_STR" | tr "\n" "\0" | xargs -0 -i{} echo {} ) - - I=0 - while [[ $I -lt ${#TESTS_LIST[@]} ]] - do - #sed cannot search for single ] to search for it we use ][ patter (and also look for closing ]) - echo -e " ${TESTS_LIST[$I]};" | sed -e 's#[][,]#\\&#g' >> ${TESTS_FILE} - I=$(( $I + 1 )) - done - echo "\"" >> ${TESTS_FILE} - echo "#---------" >> ${TESTS_FILE} -done -popd - diff --git a/tools/last_changelog.awk b/tools/last_changelog.awk deleted file mode 100755 index e4616138dabc97e4f2c02f8466580c7d1e28b1ea..0000000000000000000000000000000000000000 --- a/tools/last_changelog.awk +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/awk -f -# Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved. -# For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md - -BEGIN { - version_count=0 -} - -/^## / { - version_count++ -} - -{ - if(version_count < 2) { - print $0 - } -} diff --git a/tools/run_unittests.sh b/tools/run_unittests.sh deleted file mode 100755 index 2629ef4f5bc373d609373fbd34cb73d0ee9379fd..0000000000000000000000000000000000000000 --- a/tools/run_unittests.sh +++ /dev/null @@ -1,77 +0,0 @@ -#!/bin/bash -# Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved. -# For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md - -root_dir="$(realpath $(dirname $(realpath $0))/..)" -build_dir="${root_dir}/build-linux-Debug" - -run_logs=${build_dir}/ut_run_logs - -function help() { - cat <<- EOF - Usage: $0 tests_list - EOF -} - -trim() { - local var="$*" - # remove leading whitespace characters - var="${var#"${var%%[![:space:]]*}"}" - # remove trailing whitespace characters - var="${var%"${var##*[![:space:]]}"}" - printf '%s' "$var" -} - -if [[ $# -ne 1 ]]; then - help - exit 1 -fi - -source ${root_dir}/config/common_scripsts_lib - -TESTS_FILE=$1 - -if [[ ! -r ${TESTS_FILE} ]]; then - echo "Cannot read: \"${TESTS_FILE}\"" - exit 2 -fi - -TEMP_SOURCE=$(mktemp) - -sed -e '/^[[:space:]]*#.*/d' ${TESTS_FILE} > $TEMP_SOURCE - -source ${TEMP_SOURCE} - -pushd ${build_dir} -for TEST_BINARY in catch2-* -do - echo "= ${TEST_BINARY} =" - readarray -d\; -t TESTS < <(echo ${TESTS_LIST["${TEST_BINARY}"]} | tr "\n" " " ) - I=0 - while [[ $I -lt ${#TESTS[@]} ]] - do - CUR_TEST=$( trim ${TESTS[$I]}) - if [[ -n "${CUR_TEST}" ]]; then - echo -en "${TEST_BINARY} \"${CUR_TEST}\":" - ./${TEST_BINARY} "${CUR_TEST}" --use-colour=yes > ${run_logs} - RESULT=$? - - if [[ ${RESULT} -eq 0 ]]; then - echo -e "${OK}" - else - echo -e "${ERROR}" - cat ${run_logs} - exit 1 - fi - - CHK_IF_RUN=`cat ${run_logs} | grep "No tests ran" || true` - echo "---$CHK_IF_RUN---" - if [[ -n "${CHK_IF_RUN}" ]]; then - echo "no such test: ${TEST_BINARY} ${CUR_TEST}" - exit 1 - fi - fi - I=$(( $I + 1 )) - done -done -popd diff --git a/tools/upload_release.sh b/tools/upload_release.sh deleted file mode 100755 index 92f79ae9a0f6962fdf44a71fcbaf9de5f4ea2ecf..0000000000000000000000000000000000000000 --- a/tools/upload_release.sh +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/bash -# Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved. -# For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md - -# base taken from: https://gist.github.com/stefanbuck/ce788fee19ab6eb0b4447a85fc99f447 and modified -# modman: Adam -# license: mit - -set -eou pipefail - -for line in "$@"; do - eval "$line" -done - -[ -v "tag" ] || { echo "script requires tag as parameter i.e. latest release tag"; exit 1; } -[ -v "token" ] || { echo "script requires token as parameter to access server (please see GitHub tags)"; exit 1; } -[ -v "files" ] || { echo "script requires files as parameters to know what files to upload to server"; exit 1; } -[ -v "repo" ] || { echo "script requires repo to push to"; exit 1; } - -github_api_token="$token" -filenames=( $(echo $files | tr "," " ") ) - -for file in "${filenames[@]}"; do - [ -f "$file" ] || { echo "file '$file' doesn't exist!"; exit 1; } -done - -# Define variables. -GH_REPO="https://api.github.com/repos/mudita/$repo" -GH_TAGS="$GH_REPO/releases/tags/$tag" -GH_RELEASE="$GH_REPO/releases" -AUTH="Authorization: token $github_api_token" - -echo "test token" -curl -o /dev/null -sH "$AUTH" $GH_REPO || { echo "Error: Invalid repo, token or network issue!"; exit 1; } - -echo "create release" -curl -sH "$AUTH" -H "Accept: application/vnd.github.v3+json" -X POST $GH_RELEASE -d '{"tag_name":"'"$tag"'", "prerelease":true, "name":"'"$tag"'","body":"WARNING: this is daily prerelease"}' &>/dev/null - -response=$(curl -sH "$AUTH" $GH_TAGS) -eval $(echo "$response" | grep -m 1 "id.:" | grep -w id | tr : = | tr -cd '[[:alnum:]]=') -[ "$id" ] || { echo "Error: Failed to get release id for tag: $tag"; echo "$response" | awk 'length($0)<100' >&2; exit 1; } - -echo "release ID : ${id}" - - -for filename in "${filenames[@]}"; do - GH_ASSET="https://uploads.github.com/repos/mudita/$repo/releases/$id/assets?name=$(basename $filename)" - [[ "$filename" =~ .*.tar ]] && content_type='Content-Type: application/x-tar' || content_type='Content-Type: application/x-xz' - curl -s --data-binary @"$filename" -H "Authorization: token $github_api_token" -H "$content_type" $GH_ASSET &>/dev/null - echo "asset $filename added to release under: tag $tag" -done - -echo "uploading files done!"