Skip to content
This repository has been archived by the owner on Apr 12, 2021. It is now read-only.

Commit

Permalink
bazel: add tests for boostrap script behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
andyscott authored and Profpatsch committed Nov 8, 2018
1 parent 02b2f62 commit e4fbd57
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions pkgs/development/tools/build-managers/bazel/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,29 @@ stdenv.mkDerivation rec {
cp scripts/zsh_completion/_bazel $out/share/zsh/site-functions/
'';

doInstallCheck = true;
installCheckPhase = ''
export TEST_TMPDIR=$(pwd)
mkdir -p tools
touch tools/bazel
chmod +x tools/bazel
echo "#!/bin/bash -e" > tools/bazel
echo "exit 1" >> tools/bazel
! $out/bin/bazel test --test_output=errors \
examples/cpp:hello-success_test \
examples/java-native/src/test/java/com/example/myproject:hello
echo "#!/bin/bash -e" > tools/bazel
echo "exec \"\$BAZEL_REAL\" \"\$@\"" >> tools/bazel
$out/bin/bazel test --test_output=errors \
examples/cpp:hello-success_test \
examples/java-native/src/test/java/com/example/myproject:hello
'';

# Save paths to hardcoded dependencies so Nix can detect them.
postFixup = ''
mkdir -p $out/nix-support
Expand Down

0 comments on commit e4fbd57

Please sign in to comment.