Skip to content

src/test/bench: restructure - #8458

Closed
emberian wants to merge 3 commits into
rust-lang:masterfrom
emberian:test-restructure
Closed

src/test/bench: restructure#8458
emberian wants to merge 3 commits into
rust-lang:masterfrom
emberian:test-restructure

Conversation

@emberian

Copy link
Copy Markdown
Contributor

This should make benchmarks easier to understand. But, it doesn't work.
BENCH_RS in mk/tests.mk has everything, from what I can tell in remake, but
only those that are direct children of src/test/bench get build and run.
@graydon, can you lend your expertise? I can't make heads or tails of this
makefile.

@brson

Copy link
Copy Markdown
Contributor

The code that configures the compiletest driver to run the benchmarks is https://github.com/cmr/rust/blob/2272fa28b29c588068a05580afd800fb77a027ff/mk/tests.mk#L505

These variables are plugged into this macro: https://github.com/cmr/rust/blob/2272fa28b29c588068a05580afd800fb77a027ff/mk/tests.mk#L505

This says to run all the .rs files in src/test/bench, but now the benchmarks are no longer in that directory. The compiletest driver accepts a single --src-base argument and runs files in that directory (if it descended into subdirectories then it would end up trying to run some non-test files under test/run-pass/*/).

There are probably three ways to make this work: 1) teach compiletest to accept multilpe src-basees, then adjust tests.mk to support that; 2) split the benchmark test runs into bench, bench-rt, bench-shootout, etc., add the appropriate new configs to tests.mk; 3) teach compiletest to descend into subdirectories to find tests, xfail all the non-tests that would be discovered under this scheme.

My preference is 1, but it's also the hardest. I don't like 3 that much because it will create even more 'xfail-test not a test'-type comments.

@emberian

Copy link
Copy Markdown
ContributorAuthor

@brson I'll take a shot at compiletest in the morning. thanks!

@emberian

Copy link
Copy Markdown
ContributorAuthor

@brson So the compiletest bits are done, but I can't figure out what to do to the makefile.

I pushed my attempt, but it outputs:

x86_64-unknown-linux-gnu/stage1/bin/compiletest --compile-lib-path x86_64-unknown-linux-gnu/stage1/lib --run-lib-path x86_64-unknown-linux-gnu/stage1/lib/rustc/x86_64-unknown-linux-gnu/lib --rustc-path x86_64-unknown-linux-gnu/stage1/bin/rustc --clang-path /usr/bin/clang++ --llvm-bin-path /home/cmr/hacking/rust/build/llvm/x86_64-unknown-linux-gnu/Release+Asserts/bin --aux-base /home/cmr/hacking/rust/src/test/auxiliary/ --stage-id stage1-x86_64-unknown-linux-gnu --target x86_64-unknown-linux-gnu --adb-path=/usr/bin/adb --adb-test-dir= --rustcflags " -O --target=x86_64-unknown-linux-gnu" --verbose --src-base /home/cmr/hacking/rust/src/test/bench bench/rt bench/shootout bench/std/ --build-base x86_64-unknown-linux-gnu/test/bench/ --ratchet-metrics tmp/check-stage1-T-x86_64-unknown-linux-gnu-H-x86_64-unknown-linux-gnu-bench-metrics.json --mode run-pass --logfile tmp/check-stage1-T-x86_64-unknown-linux-gnu-H-x86_64-unknown-linux-gnu-bench.log && touch tmp/check-stage1-T-x86_64-unknown-linux-gnu-H-x86_64-unknown-linux-gnu-bench.ok

Which, as you can see, has the wrong src-base except for the first one. I don't really know make at all.

@brson

Copy link
Copy Markdown
Contributor

@cmr: here's a diff against your patch:

- $(foreach base,$$(CTEST_SRC_BASE_$(4)), \
- --src-base $$(S)src/test/$(base))/ \
+ $$(foreach base,$$(CTEST_SRC_BASE_$(4)), \
+ --src-base $$(S)src/test/$$(base))/ \

@catamorphism

Copy link
Copy Markdown
Contributor

@cmr: Needs a rebase.

@catamorphism

Copy link
Copy Markdown
Contributor

One of the pretty printer tests segfaulted -- could this be a stack size issue?

@catamorphismcatamorphism mentioned this pull request Aug 28, 2013
@alexcrichton

Copy link
Copy Markdown
Member

That's odd, it's the second case of segfaulting during pretty printing:

http://buildbot.rust-lang.org/builders/auto-mac-64-nopt-t/builds/256/steps/test/logs/stdio

@emberian

Copy link
Copy Markdown
ContributorAuthor

Seems there might be some latent OS X issues?

@huonw

Copy link
Copy Markdown
Contributor

(I've seen more than 2 segfaults there in the day, fwiw.)

bors added a commit that referenced this pull request Aug 30, 2013
This should make benchmarks easier to understand. But, it doesn't work.
BENCH_RS in mk/tests.mk has everything, from what I can tell in remake, but
only those that are direct children of src/test/bench get build and run.
@graydon, can you lend your expertise? I can't make heads or tails of this
makefile.
@borsbors closed this Aug 30, 2013
U007D pushed a commit to U007D/rust-mos that referenced this pull request Aug 21, 2026
8458: Respect test style guidelines in tests::traits r=Veykril a=Veykril
bors r+
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

@emberian@brson@catamorphism@alexcrichton@huonw@bors