mirror of
https://gitlab.com/TECHNOFAB/nixtest.git
synced 2025-12-12 02:00:18 +01:00
test: nest sample tests as fixtures in real tests
also use new test helpers
This commit is contained in:
parent
bed029f4a9
commit
006537e6ab
4 changed files with 186 additions and 142 deletions
|
|
@ -1,44 +0,0 @@
|
|||
{
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
ntlib = import ./. {inherit pkgs lib;};
|
||||
in {
|
||||
suites."Lib Tests".tests = [
|
||||
{
|
||||
name = "autodiscovery";
|
||||
type = "script";
|
||||
script = let
|
||||
actual = builtins.toFile "actual" (builtins.toJSON (ntlib.autodiscover {
|
||||
dir = ./.;
|
||||
}));
|
||||
in
|
||||
# sh
|
||||
''
|
||||
export PATH="${pkgs.gnugrep}/bin"
|
||||
grep -q lib_test.nix ${actual}
|
||||
grep -q "\"base\":\"/nix/store/.*-source/lib/" ${actual}
|
||||
'';
|
||||
}
|
||||
{
|
||||
name = "binary";
|
||||
type = "script";
|
||||
script = let
|
||||
binary =
|
||||
(ntlib.mkBinary {
|
||||
nixtests = "stub";
|
||||
extraParams = "--pure";
|
||||
})
|
||||
+ "/bin/nixtests:run";
|
||||
in
|
||||
# sh
|
||||
''
|
||||
export PATH="${pkgs.gnugrep}/bin"
|
||||
grep -q nixtest ${binary}
|
||||
grep -q -- "--pure" ${binary}
|
||||
grep -q -- "--tests=stub" ${binary}
|
||||
'';
|
||||
}
|
||||
];
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue