From 16b43f218d142de49fbd8fae77e6e2c057bfb9d6 Mon Sep 17 00:00:00 2001 From: lassulus Date: Wed, 12 Sep 2018 22:26:41 +0200 Subject: add ci.nix --- ci.nix | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 ci.nix (limited to 'ci.nix') diff --git a/ci.nix b/ci.nix new file mode 100644 index 0000000..545121e --- /dev/null +++ b/ci.nix @@ -0,0 +1,26 @@ +let + pkgs = import {}; + + 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; + } + -- cgit v1.2.3 From 79ab2c27f9d7903ff3ed9bcd8de493b1191bbc12 Mon Sep 17 00:00:00 2001 From: lassulus Date: Sun, 23 Sep 2018 13:05:11 +0200 Subject: pkgs: add writeJS{,Bin} --- ci.nix | 1 + 1 file changed, 1 insertion(+) (limited to 'ci.nix') diff --git a/ci.nix b/ci.nix index 545121e..902d43c 100644 --- a/ci.nix +++ b/ci.nix @@ -18,6 +18,7 @@ in 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; -- cgit v1.2.3