aboutsummaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)Author
2018-05-30Modularize config settingsEelco Dolstra
Allow global config settings to be defined in multiple Config classes. For example, this means that libutil can have settings and evaluator settings can be moved out of libstore. The Config classes are registered in a new GlobalConfig class to which config files etc. are applied. Relevant to https://github.com/NixOS/nix/issues/2009 in that it removes the need for ad hoc handling of useCaseHack, which was the underlying cause of that issue.
2018-05-24add docs and testsvolth
2018-05-11Don't return negative numbers from the flex tokenizerEelco Dolstra
Fixes #1374. Closes #2129.
2018-05-02Fix builtins.add testEelco Dolstra
Nix prints the floating point number 4.0 as "4".
2018-04-29add tests for builtins.addTim Sears
2018-04-23Merge branch 'pos-crash-fix' of git://github.com/dezgeg/nixShea Levy
2018-04-23Merge branch 'add-test-eval-okay-nested-with' of ↵Shea Levy
git://github.com/ryantrinkle/nix
2018-04-18add tests for multi searchDaniel Poelzleithner
2018-04-09Merge branch 'fix/ruby-shebang' of git://github.com/samueldr/nixShea Levy
2018-04-09Hardcodes `nix-shell` instead of `/usr/bin/env nix-shell`...Samuel Dionne-Riel
... in the ruby shebang test.
2018-04-08Adds `nix-shell` test for special-cased ruby interpreter.Samuel Dionne-Riel
The test fakes the interpreter only to verify the arguments it would be given.
2018-04-06Add missing eval-okay-regex-split.exp test fileDoug Beardsley
2018-04-03libexpr: Make unsafeGetAttrPos not crash on noPosTuomas Tynkkynen
Currently e.g. `builtins.unsafeGetAttrPos "abort" builtins` will eventually segfault because pos->file is an unset Symbol. Found by afl-fuzz.
2018-03-30Add test eval-okay-nested-withRyan Trinkle
2018-03-16nix-shell: allow symlinks to .drvsLinus Heckemann
This makes persistent shell environments easier to use.
2018-03-16Merge pull request #1939 from dezgeg/lexer-fixEelco Dolstra
libexpr: Recognize newline in more places in lexer
2018-03-14Use boost::format from the boost packageEelco Dolstra
Note that this only requires headers from boost so it doesn't add a runtime dependency. Also, use Nixpkgs 18.03.
2018-03-13Merge pull request #1906 from dtzWill/fix/nix-searchShea Levy
nix search: tests and fix #1893 and part of #1892
2018-03-02Merge branch 'write-failure-fixes' of git://github.com/lheckemann/nixShea Levy
2018-03-02libexpr: Recognize newline in more places in lexerTuomas Tynkkynen
Flex's regexes have an annoying feature: the dot matches everything except a newline. This causes problems for expressions like: "${0}\ " where the backslash-newline combination matches this rule instead of the intended one mentioned in the comment: <STRING>\$|\\|\$\\ { /* This can only occur when we reach EOF, otherwise the above (...|\$[^\{\"\\]|\\.|\$\\.)+ would have triggered. This is technically invalid, but we leave the problem to the parser who fails with exact location. */ return STR; } However, the parser actually accepts the resulting token sequence ('"' DOLLAR_CURLY 0 '}' STR '"'), which is a problem because the lexer rule didn't assign anything to yylval. Ultimately this leads to a crash when dereferencing a NULL pointer in ExprConcatStrings::bindVars(). The fix does change the syntax of the language in some corner cases but I think it's only turning previously invalid (or crashing) syntax to valid syntax. E.g. "a\ b" and ''a''\ b'' were previously syntax errors but now both result in "a\nb". Found by afl-fuzz.
2018-03-01tests/search.sh: simplify, don't rely on consistent orderingWill Dietz
2018-02-26libexpr: Fix prim_replaceStrings() to work on an empty source stringTuomas Tynkkynen
Otherwise, running e.g. nix-instantiate --eval -E --strict 'builtins.replaceStrings [""] ["X"] "abc"' would just hang in an infinite loop. Found by afl-fuzz. First attempt of this was reverted in e2d71bd1862cdda because it caused another infinite loop, which is fixed now and a test added.
2018-02-25tests: test nix search behaviorWill Dietz
2018-02-22Merge branch 'fix/dry-run-partially' of https://github.com/dtzWill/nixEelco Dolstra
2018-02-21Revert "libexpr: Fix prim_replaceStrings() to work on an empty source string"Eelco Dolstra
This reverts commit 4ea9707591beceacf9988b3c185faf50da238403. It causes an infinite loop in Nixpkgs evaluation, e.g. "nix-instantiate -A hello" hung. PR #1886.
2018-02-19libexpr: Fix prim_replaceStrings() to work on an empty source stringTuomas Tynkkynen
Otherwise, running e.g. nix-instantiate --eval -E --strict 'builtins.replaceStrings [""] ["X"] "abc"' would just hang in an infinite loop. Found by afl-fuzz.
2018-02-19Merge branch 'register-settings' of https://github.com/shlevy/nixEelco Dolstra
2018-02-14Add splitVersion primop.Shea Levy
Fixes #1868.
2018-02-13Allow plugins to define new settings.Shea Levy
2018-02-13Fix plugin tests on darwinShea Levy
2018-02-13Fix #1762Linus Heckemann
nix-store --export, nix-store --dump, and nix dump-path would previously fail silently if writing the data out failed, because a) FdSink::write ignored exceptions, and b) the commands relied on FdSink's destructor, which ignores exceptions, to flush the data out. This could cause rather opaque issues with installing nixos, because nix-store --export would happily proceed even if it couldn't write its data out (e.g. if nix-store --import on the other side of the pipe failed). This commit adds tests that expose these issues in the nix-store commands, and fixes them for all three.
2018-02-13Allow includes from nix.confShea Levy
2018-02-13Merge branch 'register-constant' of https://github.com/shlevy/nixEelco Dolstra
2018-02-13Merge branch 'plugins' of https://github.com/shlevy/nixEelco Dolstra
2018-02-08Allow using RegisterPrimop to define constants.Shea Levy
This enables plugins to add new constants, as well as new primops.
2018-02-08Add plugins to make Nix more extensible.Shea Levy
All plugins in plugin-files will be dlopened, allowing them to statically construct instances of the various Register* types Nix supports.
2018-02-08nix-env: Fix parsing of --systemEelco Dolstra
https://hydra.nixos.org/build/68827814
2018-02-08dsa -> ed25519Eelco Dolstra
DSS is disabled by default in NixOS 18.03. https://hydra.nixos.org/build/68788560
2018-02-07build-dry: disable failing portion of test until issue is fixedWill Dietz
2018-02-07tests: Add (failing) tests for reported --dry-run issues.Will Dietz
2018-02-07builtins.path test: Don't rely on shlevy's XDG_RUNTIME_DIRShea Levy
2018-02-07Improve filtering of ANSI escape sequences in build logsEelco Dolstra
All ANSI sequences except color setting are now filtered out. In particular, terminal resets (such as from NixOS VM tests) are filtered out. Also, fix the completely broken tab character handling.
2018-02-07Merge pull request #1816 from shlevy/add-pathEelco Dolstra
Add path primop.
2018-02-06Add path primop.Shea Levy
builtins.path allows specifying the name of a path (which makes paths with store-illegal names now addable), allows adding paths with flat instead of recursive hashes, allows specifying a filter (so is a generalization of filterSource), and allows specifying an expected hash (enabling safe path adding in pure mode).
2018-02-06realiseContext(): Add derivation outputs to the allowed pathsEelco Dolstra
This makes import-from-derivation work in restricted mode again.
2018-02-05Fix evaluationEelco Dolstra
2018-02-03Remove nix-build --hashEelco Dolstra
Instead, if a fixed-output derivation produces has an incorrect output hash, we now unconditionally move the outputs to the path corresponding with the actual hash and register it as valid. Thus, after correcting the hash in the Nix expression (e.g. in a fetchurl call), the fixed-output derivation doesn't have to be built again. It would still be good to have a command for reporting the actual hash of a fixed-output derivation (instead of throwing an error), but "nix-build --hash" didn't do that.
2018-02-01Remove obsolete references to manifestsEelco Dolstra
Closes #323.
2018-01-24Merge pull request #1797 from dezgeg/userns-tests-fixEelco Dolstra
Fix tests using user namespaces on kernels that don't have it
2018-01-22Fix testEelco Dolstra
https://hydra.nixos.org/build/67806811