Skip to content
Permalink
Browse files

Add dummy git test

  • Loading branch information
nmattia committed Nov 30, 2019
1 parent 0a8b4f0 commit 507d759e9c18d14cd539043b0cd0d97c3a46bc62
Showing with 32 additions and 0 deletions.
  1. +1 −0 default.nix
  2. +31 −0 tests/git/default.nix
@@ -191,6 +191,7 @@ rec
inherit niv niv-sdist niv-source niv-devshell niv-cabal-upload;

tests-github = pkgs.callPackage ./tests/github { inherit niv; };
tests-git = pkgs.callPackage ./tests/git { inherit niv; };

niv-test = pkgs.runCommand "niv-test" { buildInputs = [ niv ]; }
"niv-test && touch $out";
@@ -0,0 +1,31 @@
{ pkgs, niv }:

# TODO: this doesn' test anything meaningful yet because "niv git PACKAGE"
# doesn't parse yet
pkgs.runCommand "foo"
{ nativeBuildInputs = [ pkgs.git niv ]; }
''
gitdir=$(mktemp -d)
pushd $gitdir
git init .
echo hello > file
git config user.email "niv@foo.bar"
git config user.name "Niv Niverson"
git add file
git commit -m "Initial commit"
gitrev=$(git rev-parse HEAD)
popd
nivdir=$(mktemp -d)
pushd $nivdir
mkdir -p nix
echo "{}" > nix/sources.json
niv init
# niv add git -n my-git-repo file://$gitdir
# nix eval --json '(import ./nix/sources.nix).my-git-repo.rev'
popd
touch $out
''

0 comments on commit 507d759

Please sign in to comment.
You can’t perform that action at this time.