summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Hodge <tpg@ucc.asn.au>2019-06-30 10:24:09 +0800
committerJohn Hodge <tpg@ucc.asn.au>2019-06-30 10:24:09 +0800
commit575d2ec6503a9cc700e54078b254be1248c6cd88 (patch)
tree8b159ef74693b7f7fdc8195b8bea05c5d87d22ce /src
parent10d87a39f610641ef97aeac1f34c9d041c469909 (diff)
downloadmrust-575d2ec6503a9cc700e54078b254be1248c6cd88.tar.gz
Expand `#[test]` - Fix should_panic/ignore flags
Diffstat (limited to 'src')
-rw-r--r--src/expand/test.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/expand/test.cpp b/src/expand/test.cpp
index ac536228..cc7ddc83 100644
--- a/src/expand/test.cpp
+++ b/src/expand/test.cpp
@@ -40,7 +40,7 @@ class CTestHandler:
class CTestHandler_SP:
public ExpandDecorator
{
- AttrStage stage() const override { return AttrStage::Pre; }
+ AttrStage stage() const override { return AttrStage::Post; }
void handle(const Span& sp, const AST::Attribute& mi, ::AST::Crate& crate, const AST::Path& path, AST::Module& mod, AST::Item&i) const override {
if( ! i.is_Function() ) {
@@ -49,6 +49,7 @@ class CTestHandler_SP:
if( crate.m_test_harness )
{
+ // TODO: If this test doesn't yet exist, create it (but as disabled)?
for(auto& td : crate.m_tests)
{
if( td.path != path )
@@ -73,11 +74,11 @@ class CTestHandler_SP:
class CTestHandler_Ignore:
public ExpandDecorator
{
- AttrStage stage() const override { return AttrStage::Pre; }
+ AttrStage stage() const override { return AttrStage::Post; }
void handle(const Span& sp, const AST::Attribute& mi, ::AST::Crate& crate, const AST::Path& path, AST::Module& mod, AST::Item&i) const override {
if( ! i.is_Function() ) {
- ERROR(sp, E0000, "#[should_panic] can only be put on functions - found on " << i.tag_str());
+ ERROR(sp, E0000, "#[ignore] can only be put on functions - found on " << i.tag_str());
}
if( crate.m_test_harness )