Skip to content

Commit b3dadb3

Browse files
authored
Merge pull request #26 from njelich/main
Add cargo-llvm-cov feature
2 parents 19d06da + 9761d59 commit b3dadb3

File tree

7 files changed

+61
-0
lines changed

7 files changed

+61
-0
lines changed

.github/workflows/test.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ jobs:
4343
- dexterous_developer
4444
- rust_windows_msvc
4545
- sccache
46+
- cargo-llvm-cov
4647
# NEXT
4748
baseImage:
4849
- debian:latest
@@ -89,6 +90,7 @@ jobs:
8990
- dexterous_developer
9091
- rust_windows_msvc
9192
- sccache
93+
- cargo-llvm-cov
9294
# NEXT
9395
steps:
9496
- uses: actions/checkout@v3

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ Note that all these images depend on having the rust feature set up (`ghcr.io/de
2626
| Honggfuzz | ghcr.io/lee-orr/rusty-dev-containers/honggfuzz:0 | Installs [Honggfuzz](https://github.com/rust-fuzz/honggfuzz-rs/blob/master/README.md) - a security oriented fuzzer |
2727
| Cargo Web | ghcr.io/lee-orr/rusty-dev-containers/cargo-web:0 | Installs [Cargo Web](https://github.com/koute/cargo-web) - a toolset for client side web |
2828
| sccache | ghcr.io/lee-orr/rusty-dev-containers/sccache:0 | Installs [sccache](https://github.com/mozilla/sccache) - a tool to speed up recompilation by caching previous compilations.|
29+
| Cargo LLVm Cov | ghcr.io/lee-orr/rusty-dev-containers/cargo-llvm-cov:0 | Install [cargo-llvm-cov](https://github.com/taiki-e/cargo-llvm-cov) - a cargo subcommand to easily use LLVM source-based code coverage (-C instrument-coverage). |
2930
| | **Terminal Tools** | |
3031
| Bacon | ghcr.io/lee-orr/rusty-dev-containers/bacon:0 | Intalls [Bacon](https://github.com/Canop/bacon) - a terminal based rust code checker that can watch & run check, flippy, fmt, and tests in the background |
3132
| Mprocs | ghcr.io/lee-orr/rusty-dev-containers/mprocs:0 | Installs [mprocs](https://github.com/pvolok/mprocs) - a command line tool for running multiple commands in parallel. |

src/cargo-llvm-cov/README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Cargo LLVM Cov (cargo-llvm-cov)
2+
3+
A feature to install cargo llvm-cov
4+
5+
## Example Usage
6+
7+
```json
8+
"features": {
9+
"ghcr.io/lee-orr/rusty-dev-containers/cargo-llvm-cov:0": {}
10+
}
11+
```
12+
13+
## Options
14+
15+
| Options Id | Description | Type | Default Value |
16+
| ---------- | ----------- | ---- | ------------- |
17+
18+
---
19+
20+
_Note: This file was auto-generated from the [devcontainer-feature.json](https://github.com/lee-orr/rusty-dev-containers/blob/main/src/cargo-expand/devcontainer-feature.json). Add additional notes to a `NOTES.md`._
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"name": "Cargo LLVM Cov",
3+
"id": "cargo-llvm-cov",
4+
"version": "0.1.0",
5+
"description": "A feature to install cargo-llvm-cov",
6+
"options": {},
7+
"installsAfter": ["ghcr.io/devcontainers/features/rust", "ghcr.io/lee-orr/rusty-dev-containers/cargo-binstall"]
8+
}

src/cargo-llvm-cov/install.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/bash
2+
set -e
3+
4+
if ! (which rustup > /dev/null && which cargo > /dev/null); then
5+
which curl > /dev/null || (apt update && apt install curl -y -qq)
6+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
7+
source $HOME/.cargo/env
8+
fi
9+
10+
dpkg -l | grep build-essential || (apt update && apt install build-essential -y -qq)
11+
12+
if ! cargo install --list | grep "cargo-binstall" > /dev/null; then
13+
curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
14+
fi
15+
16+
umask 002
17+
cargo binstall cargo-llvm-cov --locked -y

template/src/install.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@ if ! cargo install --list | grep "cargo-binstall" > /dev/null; then
1313
curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
1414
fi
1515

16+
umask 002
1617
cargo binstall feature_id --locked -y

test/cargo-llvm-cov/test.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
# Optional: Import test library
6+
source dev-container-features-test-lib
7+
8+
# Definition specific tests
9+
check "installed" cargo install --list | grep "cargo-llvm-cov"
10+
11+
# Report result
12+
reportResults

0 commit comments

Comments
 (0)