mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-27 11:07:44 +00:00
squash commit
This commit is contained in:
parent
b485a480cf
commit
93d922f075
5 changed files with 483 additions and 133 deletions
48
util/android-scripts/run-tests.sh
Normal file
48
util/android-scripts/run-tests.sh
Normal file
|
@ -0,0 +1,48 @@
|
|||
#!/bin/bash
|
||||
|
||||
# spell-checker:ignore nextest watchplus PIPESTATUS
|
||||
|
||||
echo "PATH: $PATH"
|
||||
|
||||
export PATH=$HOME/.cargo/bin:$PATH
|
||||
export RUST_BACKTRACE=1
|
||||
export CARGO_TERM_COLOR=always
|
||||
export CARGO_INCREMENTAL=0
|
||||
|
||||
echo "PATH: $PATH"
|
||||
|
||||
run_tests_in_subprocess() (
|
||||
|
||||
# limit virtual memory to 3GB to avoid that OS kills sshd
|
||||
ulimit -v $((1024 * 1024 * 3))
|
||||
|
||||
watchplus() {
|
||||
# call: watchplus <interval> <command>
|
||||
while true; do
|
||||
"${@:2}"
|
||||
sleep "$1"
|
||||
done
|
||||
}
|
||||
|
||||
kill_all_background_jobs() {
|
||||
jobs -p | xargs -I{} kill -- {}
|
||||
}
|
||||
|
||||
# observe (log) every 2 seconds the system resource usage to judge if we are at a limit
|
||||
watchplus 2 df -h &
|
||||
watchplus 2 free -hm &
|
||||
|
||||
# run tests
|
||||
cd ~/coreutils && \
|
||||
timeout --preserve-status --verbose -k 1m 60m \
|
||||
cargo nextest run --profile ci --hide-progress-bar --features feat_os_unix_android
|
||||
|
||||
result=$?
|
||||
|
||||
kill_all_background_jobs
|
||||
|
||||
return $result
|
||||
)
|
||||
|
||||
# run sub-shell to be able to use ulimit without affecting the sshd
|
||||
run_tests_in_subprocess
|
Loading…
Add table
Add a link
Reference in a new issue