nixpkgs/nixos/tests/agda.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

48 lines
1,019 B
Nix
Raw Normal View History

{ pkgs, ... }:
2020-04-19 20:01:37 +02:00
let
hello-world = pkgs.writeText "hello-world" ''
{-# OPTIONS --guardedness #-}
open import IO
open import Level
2020-04-19 20:01:37 +02:00
main = run {0} (putStrLn "Hello World!")
'';
in
{
name = "agda";
meta = with pkgs.lib.maintainers; {
maintainers = [
alexarice
turion
];
};
nodes.machine =
{ pkgs, ... }:
{
environment.systemPackages = [
(pkgs.agda.withPackages {
pkgs = p: [ p.standard-library ];
})
2020-04-19 20:01:37 +02:00
];
virtualisation.memorySize = 2000; # Agda uses a lot of memory
2020-04-19 20:01:37 +02:00
};
testScript = ''
# Minimal script that typechecks
machine.succeed("touch TestEmpty.agda")
machine.succeed("agda TestEmpty.agda")
2020-04-19 20:01:37 +02:00
# Hello world
machine.succeed(
"cp ${hello-world} HelloWorld.agda"
)
machine.succeed("agda -l standard-library -i . -c HelloWorld.agda")
# Check execution
assert "Hello World!" in machine.succeed(
"./HelloWorld"
), "HelloWorld does not run properly"
'';
}