19 Commits

Author SHA1 Message Date
Ross Sullivan
92d9a94d02
chore: Migrated testsuite to testsuite::prelude 2025-06-25 22:37:24 +09:00
Ed Page
c13453ffda fix(toml): Report '<target>.edition' deprecation to users
In hindsight, the use of this is rare enough that we can go ahead and
warn without user controllable lints.
2025-03-15 03:04:18 -05:00
jyn
00d4e3d1ad Remove unused -C link-arg=-fuse-ld=lld
That's a gcc flag. lld is a linker, not a C compiler, and doesn't accept
a `use-ld` flag. `-C linker` (which is already present in the test) is
enough.

This fixes the following warning found in rust-lang/rust#119286:
```
---- expected: tests\testsuite\freshness.rs:2822:27
++++ actual:   stderr
   1    1 | [FRESH] foo v0.1.0 ([ROOT]/foo)
        2 + [WARNING] linker stderr: rust-lld: ignoring unknown argument '-fuse-ld=lld'␍
        3 +   |
        4 +   = [NOTE] `#[warn(linker_messages)]` on by default
        5 +
        6 + [WARNING] `foo` (lib) generated 1 warning
   2    7 | [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
```
2025-01-24 11:44:49 -05:00
ranger-ross
3d7b154d15
Moved manifest metadata tracking from fingerprint to dep info
This change moves the manifest metadata track to dep-info files
with the goal of reduce unneeded rebuilds when metadata is changed as
well fixing issues where builds are not retrigged due to metadata
changes when they should (ie. #14154)
2024-12-24 16:52:51 +09:00
Ed Page
306d515c08 fix(fingerprint): Don't throwaway the cache on RUSTFLAGS changes
Fixes #8716
2024-12-05 16:11:11 -06:00
Ed Page
b2aa08bbc6 test(fingerprint): Verify rustc extra flags like RUSTFLAGS
I almost overlooked these
2024-12-05 16:10:47 -06:00
Weihang Lo
ddc63f2575
test: simplify rebuild tests to address nondeterminism
```
---- freshness::rebuild_tests_if_lib_changes stdout ----
running `/home/runner/work/cargo/cargo/target/debug/cargo build`
running `/home/runner/work/cargo/cargo/target/debug/cargo test`
running `/home/runner/work/cargo/cargo/target/debug/cargo build -v`
running `/home/runner/work/cargo/cargo/target/debug/cargo test -v`
error: test failed, to rerun pass `-p cargo --test testsuite`
thread 'freshness::rebuild_tests_if_lib_changes' panicked at tests/testsuite/freshness.rs:633:10:

---- expected: tests/testsuite/freshness.rs:623:27
++++ actual:   stderr
   1    1 | [DIRTY] foo v0.0.1 ([ROOT]/foo): the dependency foo was rebuilt ([TIME_DIFF_AFTER_LAST_BUILD])
   2    2 | [COMPILING] foo v0.0.1 ([ROOT]/foo)
   3    3 | [RUNNING] `rustc --crate-name foo [..]
   4      - [RUNNING] `rustc --crate-name foo [..]
   5    4 | error[E0425]: cannot find function `foo` in crate `foo`
        5 +  --> tests/foo.rs:4:34
   6    6 | ...
   7    7 | [ERROR] could not compile `foo` (test "foo") due to 1 previous error
   8    8 | ...∅
```
2024-11-23 11:05:15 -05:00
Ed Page
55350fc670 test: Switch from 'exec_with_output' to 'run'
This is a follow up to #14846 which changed `run` to return the
`RawOutput`.

Reasons I didn't "update" some code to the new `run` return value
- We were actually using `ProcessBuilder::exec_with_output` and I didn't
  want to disentangle what it would take to switch to `Execs`
- We did processing on the `Result` and I didn't want to check how that
  could be updated
2024-11-21 13:48:27 -06:00
Ed Page
6ba83152e5 test(freshness): Update remaining unordered tests to snapbox
`compare.rs` gives priority based on expected-line length.
`snapbox` gives priority according to the expected line order.
2024-11-04 16:03:39 -06:00
Jacob Kiesel
cf893c1695
test(freshness_checksum): verify cargo depinfo is properly encoded 2024-10-08 16:30:54 -04:00
Jacob Kiesel
c0e550ee5b
test(freshness_checksum): different fingeprint methods are compatible
This ensures that users can switch between different fingerprint
freshness methods and still correctly rebuild stuff.
2024-10-08 16:29:46 -04:00
Jacob Kiesel
0d08e19661
test(freshness_checksum): verify unstable flag is gated correctly 2024-10-08 16:29:45 -04:00
Weihang Lo
66998ea24a
test(freshness_checksum): verify checksum works
Two new tests:

* checksum_actually_uses_checksum: chekcsum works when mtime forwards
* same_size_different_content: checksum does check content
2024-10-08 16:29:45 -04:00
Weihang Lo
b48fe7354f
test(freshness_checksum): remove unnecessary sleep
We don't rely on mtime anymore for checksum-based fingerprint
2024-10-08 16:29:45 -04:00
Weihang Lo
74cc1deb51
test(freshness_checksum): enable -Zfreshness-checksum
These tests are modified or renamed to reflect the switch to
checksum fingerprint:

* bust_patched_dep
* modifying_and_moving
* rebuild_on_mid_build_file_modification
* rebuild_sub_package_then_while_package
* skip_mtime_check_in_selected_cargo_home_subdirs
* use_mtime_cache_in_cargo_home
2024-10-08 16:29:45 -04:00
Weihang Lo
e5a44e24a1
test(freshness_checksum): requires nightly rustc 2024-10-08 16:29:45 -04:00
Weihang Lo
eea5fe9b00
test(freshness_checksum): remove unnecessary tests
* cargo_env_changes
* fingerprint_cleaner_does_not_rebuild
* modify_only_some_files
* rebuild_if_build_artifacts_move_forward_in_time
* simulated_docker_deps_stay_cached
* update_dependency_mtime_does_not_rebuild
2024-10-08 16:29:45 -04:00
Weihang Lo
9b17115534
test(freshness_checksum): update test module description 2024-10-08 16:29:45 -04:00
Weihang Lo
ad7d33d893
test: copy freshness tests in preparation of checksum tests 2024-10-08 16:29:44 -04:00