Skip to content

Commit

Permalink
scripts cosmetics, updated achive collector
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-aladev committed Jan 27, 2021
1 parent b2581fc commit dd77967
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 9 deletions.
2 changes: 1 addition & 1 deletion archive-collector
6 changes: 4 additions & 2 deletions scripts/coverage_toolchains.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,12 @@ while read -r toolchain; do

if ([ -n "$CI" ]); then
if (echo "$toolchain" | grep -q "clang/coverage.cmake$") && (command -v "llvm-cov" > /dev/null 2>&1); then
./codecov.sh -x "llvm-cov gcov" || continue
cov="llvm-cov gcov"
else
./codecov.sh -x "gcov" || continue
cov="gcov"
fi

./codecov.sh -x "$cov" || continue
fi

some_test_passed=true
Expand Down
6 changes: 4 additions & 2 deletions scripts/temp/mount.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ echo "need to mount tmp"

# "sudo" may be required for ramfs.
if command -v "sudo" > /dev/null 2>&1; then
sudo ./ramfs.sh "$TMP_PATH" "$TMP_SIZE" || true
sudo_prefix="sudo"
else
./ramfs.sh "$TMP_PATH" "$TMP_SIZE" || true
sudo_prefix=""
fi

$sudo_prefix ./ramfs.sh "$TMP_PATH" "$TMP_SIZE" || true
4 changes: 2 additions & 2 deletions scripts/temp/ramfs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ cd "$DIR"
TMP_PATH=$1
TMP_SIZE=$2 # MB

umount -f "$TMP_PATH" || true

kernel_name=$(uname -s)

if [ $kernel_name = "Darwin" ]; then
umount -f "$TMP_PATH" || true
hdiutil detach "$TMP_PATH" || true

sectors=$((2048 * $TMP_SIZE))
disk_id=$(hdiutil attach -nomount "ram://${sectors}")
diskutil erasevolume HFS+ "$TMP_PATH" "$disk_id"
else
umount -f "$TMP_PATH" || true
mount -t ramfs -o size=${TMP_SIZE}M,mode=777 ramfs "$TMP_PATH"
fi

Expand Down
6 changes: 4 additions & 2 deletions scripts/toolchains.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,12 @@ while read -r toolchain; do

if ([ "$COVERAGE_TOOLCHAIN" = true ] && [ -n "$CI" ]); then
if (echo "$toolchain" | grep -q "clang/coverage.cmake$") && (command -v "llvm-cov" > /dev/null 2>&1); then
./codecov.sh -x "llvm-cov gcov" || continue
cov="llvm-cov gcov"
else
./codecov.sh -x "gcov" || continue
cov="gcov"
fi

./codecov.sh -x "$cov" || continue
fi

some_test_passed=true
Expand Down

0 comments on commit dd77967

Please sign in to comment.