diff --git a/.build.yml b/.build.yml index 2282159..9533ba7 100644 --- a/.build.yml +++ b/.build.yml @@ -3,6 +3,6 @@ environment: NIX_CONFIG: "experimental-features = nix-command flakes" tasks: - setup: "sudo ln -s /etc/zoneinfo/EST /etc/localtime" - - test-jail-nix: "cd jail.nix/tests && nix run .#runTests" - - check-format: "cd jail.nix/tests && nix run .#checkFmt" - - build-website: "cd jail.nix/website && nix build -L .#default" + - test-jail-nix: "cd jail.nix && nix run ./tests#runTests" + - check-format: "cd jail.nix && nix run ./tests#checkFmt" + - build-website: "cd jail.nix && nix build -L ./website#default" diff --git a/tests/flake.nix b/tests/flake.nix index e6acaaf..9a48a94 100644 --- a/tests/flake.nix +++ b/tests/flake.nix @@ -18,7 +18,17 @@ program = lib.getExe ( pkgs.writeShellApplication { inherit name runtimeInputs; - text = script; + text = '' + if ! [ -e jail-nix-tests.cabal ]; then + if [ -e tests/jail-nix-tests.cabal ]; then + cd tests + else + echo "${name} must be called in repo root or tests directory" + exit 1 + fi + fi + ${script} + ''; } ); }; @@ -36,7 +46,7 @@ (lib.concatStringsSep " ") (lib.toShellVar "NIX_PATH") ] - } cabal test + } cabal run spec -- "$@" ''; apps.x86_64-linux.checkFmt = mkApp "check-fmt" [ pkgs.nixfmt-tree ] "treefmt --ci";