This change is needed for two reasons:
1) To exit with a non-zero code if a module's tests are invalidated
2) To add any invalidated tests to the FailuresManifest
The bug here was that `config` wasn't being updated with the new
count, so the failures would be output, but the final count would
not be correct.
Note that when updating the count we need to only include the
successful tests, to avoid counting each failed test twice.
This will interpolate the value of module attributes in match assertions
in ExUnit. Basically, the old diff would look like this:
```
1) test assert match with module attribute (ExUnit.AssertionsTest)
test/ex_unit/assertions_test.exs:186
match (=) failed
code: assert {2, @test_mod_attribute} = Value.tuple()
left: {2, @test_mod_attribute}
right: {2, 1}
stacktrace:
test/ex_unit/assertions_test.exs:187: (test)
```
And now it will look like this:
```
1) test assert match with module attribute (ExUnit.AssertionsTest)
test/ex_unit/assertions_test.exs:186
match (=) failed
code: assert {2, @test_mod_attribute} = Value.tuple()
left: {2, 2}
right: {2, 1}
stacktrace:
test/ex_unit/assertions_test.exs:187: (test)
```
setup blocks can return 3 shapes:
- result tuple: {:ok, new_context}
- (keyword) list: [conn: new_conn]
- map: %{conn: conn}
the return values of setup blocks get merge into a map and passed as a map to
test context. users could however make a mistake by using (for example) a
keyword list as pattern for test context, which will return a function clause
error. this commit tries to return a more friendly error instead
By using `Ctrl+\ ` to shutdown the VM, ExUnit will
intercept the sigquit signal and print the tests
currently running. This can be used to see which
test is stuck in a long running test suite:
$ mix test
.^\
Aborting test suite, the following have not completed:
* test greets the world [test/example_test.exs:5]
* AnotherTest [test/another_test.exs]
Showing results so far...
1 doctest, 0 failures
Randomized with seed 825614
As shown above, we also include a summary of the run
so far, alongside the seed and failure reports.