4 Commits

Author SHA1 Message Date
Daniel Hofstetter 29c644fc72 tests/common/mod.rs: adapt to change in ctor 2026-05-07 10:47:04 +02:00
Jesse Rosenstock 41778576e2 tests: port to uutests (#645)
Replaces assert_cmd/predicates/pretty_assertions/serial_test with uutests and
ctor in dev-dependencies.

Closes https://github.com/uutils/findutils/issues/537.

- Port tests/find_cmd_tests.rs → tests/test_find.rs (uutests API)
- Port tests/xargs_tests.rs → tests/test_xargs.rs (uutests API)
- Centralize UUTESTS_BINARY_PATH init via #[ctor::ctor] in tests/common/mod.rs

Implementation notes:
- Use TestScenario::cmd(BINARY_PATH) rather than ucmd(): find/xargs are
  dedicated binaries, not multi-call, so ucmd() would prepend the utility name
  as a spurious first argument
- Set CWD to CARGO_MANIFEST_DIR in find's ucmd() so relative test_data/ paths
  resolve correctly regardless of where cargo runs
- delete_on_dot_dir sets the child process CWD via UCommand::current_dir()
  instead of mutating the process-wide CWD, removing the need for serial_test
  and all #[serial(working_dir)] attributes

Also fixes find_samefile, find_fprinter, and find_fprintf, which were writing
temporary files directly into test_data/. They now use isolated temp
directories, eliminating a source of test pollution when running in parallel.
2026-04-03 10:21:47 +02:00
Alex Lyon 73d4ad5b8f Format using rustfmt 2019-04-24 03:06:42 -07:00
mcharsley 8b3842b1f9 Added support for -exec[dir] (#17)
* Deleted vertical whitespace

In an attempt to get around a mistake I made when merging from the
master fork

* Added a default implementation for has_side_effects

And removed all the "return false" implementations (as specified by most
of the Matchers).

* Added support for -exec and -execdir

* Fixed path_to_testing_commandline

* Minor tweaks from code review
2017-03-17 17:02:45 +00:00