aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rwxr-xr-xtests/function-trace.sh1
-rw-r--r--tests/gc-auto.sh20
2 files changed, 14 insertions, 7 deletions
diff --git a/tests/function-trace.sh b/tests/function-trace.sh
index f7d93b435..182a4d5c2 100755
--- a/tests/function-trace.sh
+++ b/tests/function-trace.sh
@@ -8,7 +8,6 @@ expect_trace() {
actual=$(
nix-instantiate \
--trace-function-calls \
- -vvvv \
--expr "$expr" 2>&1 \
| grep "function-trace" \
| sed -e 's/ [0-9]*$//'
diff --git a/tests/gc-auto.sh b/tests/gc-auto.sh
index 54ead227e..de1e2cfe4 100644
--- a/tests/gc-auto.sh
+++ b/tests/gc-auto.sh
@@ -17,42 +17,50 @@ expr=$(cat <<EOF
with import ./config.nix; mkDerivation {
name = "gc-A";
buildCommand = ''
+ set -x
[[ \$(ls \$NIX_STORE/*-garbage? | wc -l) = 3 ]]
mkdir \$out
echo foo > \$out/bar
echo 1...
sleep 2
- echo 200 > $fake_free
+ echo 200 > ${fake_free}.tmp1
+ mv ${fake_free}.tmp1 $fake_free
echo 2...
sleep 2
echo 3...
+ sleep 2
+ echo 4...
[[ \$(ls \$NIX_STORE/*-garbage? | wc -l) = 1 ]]
'';
}
EOF
)
-nix build -v -o $TEST_ROOT/result-A -L "($expr)" \
- --min-free 1000 --max-free 2000 --min-free-check-interval 1 &
-pid=$!
-
expr2=$(cat <<EOF
with import ./config.nix; mkDerivation {
name = "gc-B";
buildCommand = ''
+ set -x
mkdir \$out
echo foo > \$out/bar
echo 1...
sleep 2
- echo 200 > $fake_free
+ echo 200 > ${fake_free}.tmp2
+ mv ${fake_free}.tmp2 $fake_free
echo 2...
sleep 2
echo 3...
+ sleep 2
+ echo 4...
'';
}
EOF
)
+nix build -v -o $TEST_ROOT/result-A -L "($expr)" \
+ --min-free 1000 --max-free 2000 --min-free-check-interval 1 &
+pid=$!
+
nix build -v -o $TEST_ROOT/result-B -L "($expr2)" \
--min-free 1000 --max-free 2000 --min-free-check-interval 1