aboutsummaryrefslogtreecommitdiffstats
path: root/ci.nix
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2018-09-25 20:38:14 +0200
committertv <tv@krebsco.de>2018-09-25 20:38:14 +0200
commit0660cc1a1169e799bda356c6fadb245a96345816 (patch)
tree74e5443bd152333b50c2d5619926eb31b69513ec /ci.nix
parentc27a9416e8ee04d708b11b48f8cf1a055c0cc079 (diff)
parent79ab2c27f9d7903ff3ed9bcd8de493b1191bbc12 (diff)
Merge remote-tracking branch 'lass/master'v3.1.0ni/master
Diffstat (limited to 'ci.nix')
-rw-r--r--ci.nix27
1 files changed, 27 insertions, 0 deletions
diff --git a/ci.nix b/ci.nix
new file mode 100644
index 0000000..902d43c
--- /dev/null
+++ b/ci.nix
@@ -0,0 +1,27 @@
+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;
+ js = writeTest "function add(n,d){return n+d}" simples.js;
+ 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;
+ }
+