diff options
Diffstat (limited to 'pkgs/by-name/au/autoprefixer/tests/simple-execution.nix')
-rw-r--r-- | pkgs/by-name/au/autoprefixer/tests/simple-execution.nix | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/pkgs/by-name/au/autoprefixer/tests/simple-execution.nix b/pkgs/by-name/au/autoprefixer/tests/simple-execution.nix new file mode 100644 index 0000000000000..c889795a2ef59 --- /dev/null +++ b/pkgs/by-name/au/autoprefixer/tests/simple-execution.nix @@ -0,0 +1,25 @@ +{ runCommand, autoprefixer }: + +let + inherit (autoprefixer) packageName version; +in + +runCommand "${packageName}-tests" { meta.timeout = 60; } + '' + # get version of installed program and compare with package version + claimed_version="$(${autoprefixer}/bin/autoprefixer --version | awk '{print $2}')" + if [[ "$claimed_version" != "${version}" ]]; then + echo "Error: program version does not match package version ($claimed_version != ${version})" + exit 1 + fi + + # run dummy commands + ${autoprefixer}/bin/autoprefixer --help > /dev/null + ${autoprefixer}/bin/autoprefixer --info > /dev/null + + # Testing the actual functionality is done in the test for postcss + # because autoprefixer is a postcss plugin + + # needed for Nix to register the command as successful + touch $out + '' |