Make test-all.sh run unit tests in debug mode.

It turns out that "cargo test --release" doesn't use
`[profile.release]`; it uses `[profile.bench]` instead; see
[here](https://doc.rust-lang.org/cargo/reference/manifest.html) for details.
So the plan to run the tests in optimized mode but with debug-assertions
enabled didn't actually work, and we had an actual failing unit test that
was hidden because assertions were disabled.

So, this makes test-all.sh just run the unit tests in debug mode, as is
the norm for Rust packages, and fixes the buggy test.

This also removes the `[profile.release]` override from the top-level
Cargo.toml file too. We don't need it now that we're not running tests
in release mode, and it had confused multiple people because it made
Cretonne's in-tree builds different from how Cretonne is built when used as
a dependency in other projects.
This commit is contained in:
Dan Gohman
2018-04-18 20:59:51 -07:00
parent 947177732a
commit 07576d3ed0
3 changed files with 9 additions and 15 deletions

View File

@@ -144,7 +144,7 @@ mod tests {
fn basic_data_context() {
let mut data_ctx = DataContext::new();
{
let description = data_ctx.description();
let description = &data_ctx.description;
assert_eq!(description.writable, Writability::Readonly);
assert_eq!(description.init, Init::Uninitialized);
assert!(description.function_decls.is_empty());
@@ -177,7 +177,7 @@ mod tests {
data_ctx.clear();
{
let description = data_ctx.description();
let description = &data_ctx.description;
assert_eq!(description.writable, Writability::Readonly);
assert_eq!(description.init, Init::Uninitialized);
assert!(description.function_decls.is_empty());