Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ runCommand, autoprefixer }:
2
3let
4 inherit (autoprefixer) packageName version;
5in
6
7runCommand "${packageName}-tests" { meta.timeout = 60; }
8 ''
9 # get version of installed program and compare with package version
10 claimed_version="$(${autoprefixer}/bin/autoprefixer --version | awk '{print $2}')"
11 if [[ "$claimed_version" != "${version}" ]]; then
12 echo "Error: program version does not match package version ($claimed_version != ${version})"
13 exit 1
14 fi
15
16 # run dummy commands
17 ${autoprefixer}/bin/autoprefixer --help > /dev/null
18 ${autoprefixer}/bin/autoprefixer --info > /dev/null
19
20 # Testing the actual functionality is done in the test for postcss
21 # because autoprefixer is a postcss plugin
22
23 # needed for Nix to register the command as successful
24 touch $out
25 ''