Skip to content

Commit

Permalink
added logname parser func
Browse files Browse the repository at this point in the history
  • Loading branch information
hellt committed Oct 6, 2023
1 parent 485d6be commit 19dc2f1
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions tests/rf-run.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
# Copyright 2020 Nokia
# Licensed under the BSD 3-Clause License.
# SPDX-License-Identifier: BSD-3-Clause
Expand All @@ -20,4 +20,19 @@ COV_DIR=tests/coverage
# coverage output directory
mkdir -p ${COV_DIR}

GOCOVERDIR=${COV_DIR} robot --consolecolors on -r none --variable CLAB_BIN:${CLAB_BIN} --variable runtime:$1 -l ./tests/out/$(basename $2)-$1-log --output ./tests/out/$(basename $2)-$1-out.xml $2
# parses the dir or file name passed to the rf-run.sh script
# and in case of a directory, it returns the name of the directory
# in case of a file it returns the name of the file's dir catenated with file name without extension
function get_logname() {
path=$1
filename=$(basename "$path")
if [[ "$filename" == *.* ]]; then
dirname=$(dirname "$path")
basename=$(basename "$path" | cut -d. -f1)
echo "${dirname##*/}-${basename}"
else
echo "${filename}"
fi
}

GOCOVERDIR=${COV_DIR} robot --consolecolors on -r none --variable CLAB_BIN:${CLAB_BIN} --variable runtime:$1 -l ./tests/out/$(get_logname $2)-$1-log --output ./tests/out/$(basename $2)-$1-out.xml $2

0 comments on commit 19dc2f1

Please sign in to comment.