diff options
author | Alyssa Ross <hi@alyssa.is> | 2021-06-22 15:01:47 +0000 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2021-06-22 16:57:59 +0000 |
commit | 633cab0ecb07627706c6b523e219490f019eaab5 (patch) | |
tree | 4fb472bdfe2723037dad53dc1b8a87c939015f5e /nixpkgs/pkgs/build-support/writers | |
parent | ffb691c199e7e0cbc4e45e5310779c9e3f7c2a73 (diff) | |
parent | 432fc2d9a67f92e05438dff5fdc2b39d33f77997 (diff) | |
download | nixlib-633cab0ecb07627706c6b523e219490f019eaab5.tar nixlib-633cab0ecb07627706c6b523e219490f019eaab5.tar.gz nixlib-633cab0ecb07627706c6b523e219490f019eaab5.tar.bz2 nixlib-633cab0ecb07627706c6b523e219490f019eaab5.tar.lz nixlib-633cab0ecb07627706c6b523e219490f019eaab5.tar.xz nixlib-633cab0ecb07627706c6b523e219490f019eaab5.tar.zst nixlib-633cab0ecb07627706c6b523e219490f019eaab5.zip |
Merge commit '432fc2d9a67f92e05438dff5fdc2b39d33f77997'
# Conflicts: # nixpkgs/pkgs/applications/editors/emacs/elisp-packages/elpa-generated.nix # nixpkgs/pkgs/applications/networking/mailreaders/thunderbird/default.nix # nixpkgs/pkgs/applications/window-managers/sway/default.nix # nixpkgs/pkgs/build-support/rust/default.nix # nixpkgs/pkgs/development/go-modules/generic/default.nix
Diffstat (limited to 'nixpkgs/pkgs/build-support/writers')
-rw-r--r-- | nixpkgs/pkgs/build-support/writers/test.nix | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/nixpkgs/pkgs/build-support/writers/test.nix b/nixpkgs/pkgs/build-support/writers/test.nix index 689b45a126ff..d0824b17bd1b 100644 --- a/nixpkgs/pkgs/build-support/writers/test.nix +++ b/nixpkgs/pkgs/build-support/writers/test.nix @@ -13,11 +13,11 @@ with writers; let bin = { - bash = writeBashBin "test_writers" '' + bash = writeBashBin "test-writers-bash-bin" '' if [[ "test" == "test" ]]; then echo "success"; fi ''; - c = writeCBin "test_writers" { libraries = [ ]; } '' + c = writeCBin "test-writers-c" { libraries = [ ]; } '' #include <stdio.h> int main() { printf("success\n"); @@ -25,17 +25,17 @@ let } ''; - dash = writeDashBin "test_writers" '' + dash = writeDashBin "test-writers-dash-bin" '' test '~' = '~' && echo 'success' ''; - rust = writeRustBin "test_writers" {} '' + rust = writeRustBin "test-writers-rust-bin" {} '' fn main(){ println!("success") } ''; - haskell = writeHaskellBin "test_writers" { libraries = [ haskellPackages.acme-default ]; } '' + haskell = writeHaskellBin "test-writers-haskell-bin" { libraries = [ haskellPackages.acme-default ]; } '' import Data.Default int :: Int @@ -47,7 +47,7 @@ let _ -> print "fail" ''; - js = writeJSBin "test_writers" { libraries = [ nodePackages.semver ]; } '' + js = writeJSBin "test-writers-js-bin" { libraries = [ nodePackages.semver ]; } '' var semver = require('semver'); if (semver.valid('1.2.3')) { @@ -57,12 +57,12 @@ let } ''; - perl = writePerlBin "test_writers" { libraries = [ perlPackages.boolean ]; } '' + perl = writePerlBin "test-writers-perl-bin" { libraries = [ perlPackages.boolean ]; } '' use boolean; print "success\n" if true; ''; - python2 = writePython2Bin "test_writers" { libraries = [ python2Packages.enum ]; } '' + python2 = writePython2Bin "test-writers-python2-bin" { libraries = [ python2Packages.enum ]; } '' from enum import Enum @@ -73,7 +73,7 @@ let print Test.a ''; - python3 = writePython3Bin "test_writers" { libraries = [ python3Packages.pyyaml ]; } '' + python3 = writePython3Bin "test-writers-python3-bin" { libraries = [ python3Packages.pyyaml ]; } '' import yaml y = yaml.load(""" @@ -84,11 +84,11 @@ let }; simple = { - bash = writeBash "test_bash" '' + bash = writeBash "test-writers-bash" '' if [[ "test" == "test" ]]; then echo "success"; fi ''; - c = writeC "test_c" { libraries = [ glib.dev ]; } '' + c = writeC "test-writers-c" { libraries = [ glib.dev ]; } '' #include <gio/gio.h> #include <stdio.h> int main() { @@ -106,11 +106,11 @@ let } ''; - dash = writeDash "test_dash" '' + dash = writeDash "test-writers-dash" '' test '~' = '~' && echo 'success' ''; - haskell = writeHaskell "test_haskell" { libraries = [ haskellPackages.acme-default ]; } '' + haskell = writeHaskell "test-writers-haskell" { libraries = [ haskellPackages.acme-default ]; } '' import Data.Default int :: Int @@ -122,7 +122,7 @@ let _ -> print "fail" ''; - js = writeJS "test_js" { libraries = [ nodePackages.semver ]; } '' + js = writeJS "test-writers-js" { libraries = [ nodePackages.semver ]; } '' var semver = require('semver'); if (semver.valid('1.2.3')) { @@ -132,12 +132,12 @@ let } ''; - perl = writePerl "test_perl" { libraries = [ perlPackages.boolean ]; } '' + perl = writePerl "test-writers-perl" { libraries = [ perlPackages.boolean ]; } '' use boolean; print "success\n" if true; ''; - python2 = writePython2 "test_python2" { libraries = [ python2Packages.enum ]; } '' + python2 = writePython2 "test-writers-python2" { libraries = [ python2Packages.enum ]; } '' from enum import Enum @@ -148,7 +148,7 @@ let print Test.a ''; - python3 = writePython3 "test_python3" { libraries = [ python3Packages.pyyaml ]; } '' + python3 = writePython3 "test-writers-python3" { libraries = [ python3Packages.pyyaml ]; } '' import yaml y = yaml.load(""" @@ -157,21 +157,21 @@ let print(y[0]['test']) ''; - python2NoLibs = writePython2 "test_python2_no_libs" {} '' + python2NoLibs = writePython2 "test-writers-python2-no-libs" {} '' print("success") ''; - python3NoLibs = writePython3 "test_python3_no_libs" {} '' + python3NoLibs = writePython3 "test-writers-python3-no-libs" {} '' print("success") ''; }; path = { - bash = writeBash "test_bash" (writeText "test" '' + bash = writeBash "test-writers-bash-path" (writeText "test" '' if [[ "test" == "test" ]]; then echo "success"; fi ''); - haskell = writeHaskell "test_haskell" { libraries = [ haskellPackages.acme-default ]; } (writeText "test" '' + haskell = writeHaskell "test-writers-haskell-path" { libraries = [ haskellPackages.acme-default ]; } (writeText "test" '' import Data.Default int :: Int @@ -184,8 +184,8 @@ let ''); }; - writeTest = expectedValue: test: - writeDash "test-writers" '' + writeTest = expectedValue: name: test: + writeDash "run-${name}" '' if test "$(${test})" != "${expectedValue}"; then echo 'test ${test} failed' exit 1 @@ -196,9 +196,9 @@ in runCommand "test-writers" { passthru = { inherit writeTest bin simple; }; meta.platforms = lib.platforms.all; } '' - ${lib.concatMapStringsSep "\n" (test: writeTest "success" "${test}/bin/test_writers") (lib.attrValues bin)} - ${lib.concatMapStringsSep "\n" (test: writeTest "success" test) (lib.attrValues simple)} - ${lib.concatMapStringsSep "\n" (test: writeTest "success" test) (lib.attrValues path)} + ${lib.concatMapStringsSep "\n" (test: writeTest "success" test.name "${test}/bin/${test.name}") (lib.attrValues bin)} + ${lib.concatMapStringsSep "\n" (test: writeTest "success" test.name test) (lib.attrValues simple)} + ${lib.concatMapStringsSep "\n" (test: writeTest "success" test.name test) (lib.attrValues path)} echo 'nix-writers successfully tested' >&2 touch $out |