Skip to content
This repository has been archived by the owner on Jun 27, 2018. It is now read-only.

Detect tests and treat them as tests, not main. #111

Merged
merged 1 commit into from
May 22, 2015

Conversation

chris-morgan
Copy link
Member

See #107 and #32 for some other discussion of this concept.

This approach doesn’t deal with every situation, as it detects a program as either for execution or for testing, but it deals with the most common situation more elegantly than any other approach.

As usual, this code is running at http://temp.chrismorgan.info/rust-playpen/static/web.html, but the actual test functionality won’t work because it’s using play.rust-lang.org for execution and so it doesn’t have the necessary server changes to support it.

@rust-highfive
Copy link

r? @alexcrichton

(rust_highfive has picked a reviewer for you, use r? to override)

@chris-morgan
Copy link
Member Author

cc @badboy @huonw

I’ll rebase this after #110 lands.

@brson
Copy link
Contributor

brson commented May 20, 2015

lgtm. waiting on rebase

See rust-lang#107 and rust-lang#32 for some other discussion of this concept.

This approach doesn’t deal with every situation, as it detects a program
as either for execution or for testing, but it deals with the most
common situation more elegantly than any other approach.
@chris-morgan
Copy link
Member Author

Rebased; http://temp.chrismorgan.info/rust-playpen/static/web.html updated too, same caveats as before.

@badboy
Copy link
Member

badboy commented May 21, 2015

I actually like this over my own PR (#107).
It should do the right thing™ for most people out-of-the-box without adding anymore settings.

brson added a commit that referenced this pull request May 22, 2015
Detect tests and treat them as tests, not main.
@brson brson merged commit e6239f1 into rust-lang:master May 22, 2015
chris-morgan added a commit to chris-morgan/rust-playpen that referenced this pull request May 22, 2015
Hopefully this is the last missing piece of rust-lang#111.
chris-morgan added a commit to chris-morgan/rust-playpen that referenced this pull request May 22, 2015
Hopefully this is the last missing piece of rust-lang#111.
chris-morgan added a commit to chris-morgan/rust-playpen that referenced this pull request May 27, 2015
This reverts commits b43d164 and
6f3858c, returning to the state of
c7a1ef4.

I’ve tried it out locally and it all works; I’m not sure what precisely
went wrong in the deployment process (after @brson had deployed it, test
mode simply didn’t activate), but I’m now moderately confident it wasn’t
a problem in these changes. Now that @acrichto is back, can we try it
again now?
chris-morgan added a commit to chris-morgan/rust-playpen that referenced this pull request May 27, 2015
This reverts commits b43d164 and
6f3858c, returning to the state of
c7a1ef4 plus a little bit more pointed
out by @acrichto (evaluate.json’s test parameter should default to
`False`, not `True`).

I’ve tried it out locally and it all works; I’m not sure what precisely
went wrong in the deployment process (after @brson had deployed it, test
mode simply didn’t activate), but I’m now moderately confident it wasn’t
a problem in these changes. Now that @acrichto is back, can we try it
again now?
alexcrichton added a commit that referenced this pull request May 27, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants