Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Cargo to build and run tests and benchmarks #78

Merged
merged 2 commits into from Feb 16, 2015

Conversation

@aroben
Copy link
Contributor

aroben commented Jan 30, 2015

html5ever-external-test and html5ever-external-bench are now gone. Their custom test runners have moved into the individual test/bench files. We're using the #[start] attribute to define our own entry point (#[main] isn't respected for tests) which generates the test cases and calls through to test::test_main.

tests/util.rs now lives in its own test_util crate. It's the only way I could figure out to share this functionality between the tokenizer and tree builder integration tests.

Makefile.in is now a little simpler because we can just use cargo test to handle building the tests and examples and and running the tests, and cargo bench for building and running the benches. Top-level make targets like build, check, and examples continue to work (though make examples also builds the tests now).

Fixes #31.

@kmcallister
Copy link
Contributor

kmcallister commented Feb 1, 2015

Needs a rebase.

@aroben aroben force-pushed the aroben:cargoize-tests branch 2 times, most recently from d945f1e to 5f91cb8 Feb 2, 2015
@aroben
Copy link
Contributor Author

aroben commented Feb 2, 2015

Updated and passing CI.

@aroben aroben changed the title Use Cargo to build and run tests Use Cargo to build and run tests and benchmarks Feb 3, 2015
@aroben
Copy link
Contributor Author

aroben commented Feb 3, 2015

Just updated to also make cargo bench work.

@kmcallister
Copy link
Contributor

kmcallister commented Feb 4, 2015

Needs a rebase.

@aroben aroben force-pushed the aroben:cargoize-tests branch from 141512f to 75393d1 Feb 4, 2015
@aroben
Copy link
Contributor Author

aroben commented Feb 4, 2015

Rebased!

Makefile.in Outdated

.PHONY: clean
clean:
(cd $(VPATH) && cargo clean)
rm -f *.o *.a *.so *.dylib *.dll *.dummy *-test *-bench $(EXAMPLES)
rm -f *.o *.a *.so *.dylib *.dll *.dummy $(EXAMPLES)

This comment has been minimized.

@kmcallister

kmcallister Feb 4, 2015

Contributor

$(EXAMPLES) seems to be an undefined variable now.

This comment has been minimized.

@aroben

aroben Feb 5, 2015

Author Contributor

Fixed! Though of course now we need to rustup again 😒

@aroben aroben force-pushed the aroben:cargoize-tests branch 3 times, most recently from a583489 to 7a39796 Feb 5, 2015
@aroben
Copy link
Contributor Author

aroben commented Feb 11, 2015

Rebased once again.

@aroben
Copy link
Contributor Author

aroben commented Feb 11, 2015

But now phf is failing to build on the latest rustc. We'll get this PR merged someday!

@kmcallister
Copy link
Contributor

kmcallister commented Feb 11, 2015

Yep, I just landed a patch to rustc that breaks all use of compiler plugins ^_^

aroben added 2 commits Jan 30, 2015
html5ever-external-test.rs is now gone. Its custom test runner has moved
into tokenizer.rs and tree_builder.rs. We're using the #[start]
attribute to define our own entry point (#[main] isn't respected for
tests) which generates the test cases and calls through to
test::test_main.

tests/util.rs now lives in its own test_util crate. It's the only way I
could figure out to share this functionality between the tokenizer and
tree builder integration tests.

Makefile.in is now a little simpler because we can just use `cargo test`
to handle building the tests and examples and and running the tests.
Top-level make targets like `build`, `check`, and `examples` continue to
work (though `make examples` also builds the tests now).
This is quite similar to the cargoization of tests in the previous
commit. html5ever-external-bench is now gone. benches/tokenizer.rs
includes its own test harness that calls through to test::test_main.
@aroben aroben force-pushed the aroben:cargoize-tests branch from 7a39796 to b227413 Feb 16, 2015
@aroben
Copy link
Contributor Author

aroben commented Feb 16, 2015

Rebased again.

@kmcallister
Copy link
Contributor

kmcallister commented Feb 16, 2015

Thanks!

kmcallister added a commit that referenced this pull request Feb 16, 2015
Use Cargo to build and run tests and benchmarks
@kmcallister kmcallister merged commit 956c24c into servo:master Feb 16, 2015
1 check passed
1 check passed
continuous-integration/travis-ci The Travis CI build passed
Details
@aroben
Copy link
Contributor Author

aroben commented Feb 16, 2015

Yay!

@aroben aroben deleted the aroben:cargoize-tests branch Feb 16, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

2 participants
You can’t perform that action at this time.