mirror of
https://github.com/nmattia/niv.git
synced 2024-11-07 11:28:45 +03:00
Add dummy git test
This commit is contained in:
parent
0a8b4f0ffd
commit
507d759e9c
@ -191,6 +191,7 @@ rec
|
|||||||
inherit niv niv-sdist niv-source niv-devshell niv-cabal-upload;
|
inherit niv niv-sdist niv-source niv-devshell niv-cabal-upload;
|
||||||
|
|
||||||
tests-github = pkgs.callPackage ./tests/github { inherit niv; };
|
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 = pkgs.runCommand "niv-test" { buildInputs = [ niv ]; }
|
||||||
"niv-test && touch $out";
|
"niv-test && touch $out";
|
||||||
|
31
tests/git/default.nix
Normal file
31
tests/git/default.nix
Normal file
@ -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
|
||||||
|
''
|
||||||
|
|
Loading…
Reference in New Issue
Block a user