diff options
| author | lassulus <lassulus@lassul.us> | 2018-09-12 22:26:41 +0200 | 
|---|---|---|
| committer | lassulus <lass@blue.r> | 2018-09-16 23:29:17 +0200 | 
| commit | 16b43f218d142de49fbd8fae77e6e2c057bfb9d6 (patch) | |
| tree | 42dc87b7044a1d2ee685e0ace52cf399131aaeac | |
| parent | 9cd634f650551080b01e06763c11836ce33e0613 (diff) | |
add ci.nix
| -rw-r--r-- | ci.nix | 26 | 
1 files changed, 26 insertions, 0 deletions
| @@ -0,0 +1,26 @@ +let +  pkgs = import <nixpkgs> {}; + +  hello_worlds = import examples/hello_world.nix; +  simples = import examples/simple.nix; + +  writeTest = expectedValue: test: pkgs.writeScript "test" '' +    #!/bin/sh +    if test "$(${test})" != "${expectedValue}"; then +      echo 'test ${test} failed' +      exit 1 +    fi +  ''; + +in +  pkgs.lib.mapAttrs' (n: v: pkgs.lib.nameValuePair "hello_${n}" (writeTest "hello world" v)) hello_worlds // +  pkgs.lib.mapAttrs' (n: v: pkgs.lib.nameValuePair "simple_${n}" v) { +    bash = writeTest "bash features" simples.bash; +    dash = writeTest "dash features" simples.dash; +    haskell = writeTest "Rolf" simples.haskell; +    perl = writeTest "Howdy!" simples.perl; +    python2 = writeTest "['some', 'random', 'variables']" simples.python2; +    python3 = writeTest "['some', 'random', 'variables']" simples.python3; +    sed = writeTest "hello world" simples.sed; +  } + | 
