mirror of
https://codeberg.org/iff/pay-respects.git
synced 2025-10-06 00:22:43 +02:00
tests: passing in environments without sudo
This commit is contained in:
10
Makefile
10
Makefile
@@ -4,8 +4,14 @@ build:
|
||||
release:
|
||||
cargo build --release
|
||||
|
||||
test-rust: build
|
||||
cargo test --verbose
|
||||
build-all:
|
||||
cargo build --workspace
|
||||
|
||||
release-all:
|
||||
cargo build --release --workspace
|
||||
|
||||
test-rust:
|
||||
cargo test --workspace --verbose
|
||||
|
||||
install:
|
||||
echo "Installing pay-respects core. Use `install-all` to install all modules."
|
||||
|
@@ -2,3 +2,5 @@ case="privilege"
|
||||
command="pacman -Syu"
|
||||
error="you cannot perform this operation unless you are root"
|
||||
expect="sudo pacman -Syu"
|
||||
|
||||
export _PR_EXECUTABLES="sudo doas"
|
||||
|
6
tests/main.sh
Normal file → Executable file
6
tests/main.sh
Normal file → Executable file
@@ -28,8 +28,10 @@ run_test() {
|
||||
}
|
||||
|
||||
run_case() {
|
||||
source $1
|
||||
run_test "$case" "$command" "$error" "$expect"
|
||||
(
|
||||
source $1
|
||||
run_test "$case" "$command" "$error" "$expect"
|
||||
)
|
||||
|
||||
if [[ $? == 0 ]]; then
|
||||
PASSED=$((PASSED + 1))
|
||||
|
Reference in New Issue
Block a user