Skip to content

Commit

Permalink
nix-on-droid: allow passing args to on-device-test
Browse files Browse the repository at this point in the history
  • Loading branch information
t184256 committed Feb 17, 2024
1 parent 3aab6a9 commit f7c9beb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions nix-on-droid/nix-on-droid.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!@bash@/bin/bash

# Copyright (c) 2019-2022, see AUTHORS. Licensed under MIT License, see LICENSE.
# Copyright (c) 2019-2024, see AUTHORS. Licensed under MIT License, see LICENSE.

PATH=@coreutils@/bin:@nix@/bin:${PATH:+:}$PATH

Expand Down Expand Up @@ -97,7 +97,7 @@ function doOnDeviceTest() {
fi

exec "$(nix-instantiate --eval --expr \
"<nix-on-droid/tests/on-device/.run.sh>")"
"<nix-on-droid/tests/on-device/.run.sh>")" "$@"
}

function doSwitch() {
Expand Down Expand Up @@ -180,7 +180,7 @@ while [[ $# -gt 0 ]]; do
;;
*)
case $COMMAND in
switch-generation)
switch-generation|on-device-test)
COMMAND_ARGS+=("$opt")
;;
*)
Expand Down Expand Up @@ -211,7 +211,7 @@ case $COMMAND in
doHelp
;;
on-device-test)
doOnDeviceTest
doOnDeviceTest "${COMMAND_ARGS[@]}"
;;
rollback)
if [[ $(readlink $PROFILE_DIRECTORY) =~ ^nix-on-droid-([0-9]+)-link$ ]]; then
Expand Down
4 changes: 2 additions & 2 deletions tests/on-device/.run.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env nix-shell
#! nix-shell -i bash -p bats ncurses

# Copyright (c) 2019-2021, see AUTHORS. Licensed under MIT License, see LICENSE.
# Copyright (c) 2019-2024, see AUTHORS. Licensed under MIT License, see LICENSE.

set -ueo pipefail

Expand Down Expand Up @@ -41,6 +41,6 @@ fi

mkdir -p ~/.config/nixpkgs

bats "${SCRIPT_DIR}" --verbose-run --timing --pretty
bats "${SCRIPT_DIR}" --verbose-run --timing --pretty "$@"

_cleanup

0 comments on commit f7c9beb

Please sign in to comment.