diff options
author | John Hodge <tpg@ucc.asn.au> | 2019-11-02 11:07:23 +0800 |
---|---|---|
committer | John Hodge <tpg@ucc.asn.au> | 2019-11-02 11:07:23 +0800 |
commit | 1d02810c3cf908bfba7c15ae50eb5314603b9d85 (patch) | |
tree | 79dd5e4ef4c3ff79db0912ba546f08e61a7a8c10 /src/expand/test.cpp | |
parent | 7111acba04d72fe4084b1a1f3209ff83efe8614d (diff) | |
parent | 8b53b38f40625ab0510f541d69db3f83332a830a (diff) | |
download | mrust-1d02810c3cf908bfba7c15ae50eb5314603b9d85.tar.gz |
Merge branch 'nightly-1.29' - #95 Working support for rustc 1.29
Diffstat (limited to 'src/expand/test.cpp')
-rw-r--r-- | src/expand/test.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/expand/test.cpp b/src/expand/test.cpp index 9497c692..eec1414d 100644 --- a/src/expand/test.cpp +++ b/src/expand/test.cpp @@ -14,7 +14,7 @@ class CTestHandler: { 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 { + void handle(const Span& sp, const AST::Attribute& mi, ::AST::Crate& crate, const AST::Path& path, AST::Module& mod, slice<const AST::Attribute> attrs, AST::Item&i) const override { if( ! i.is_Function() ) { ERROR(sp, E0000, "#[test] can only be put on functions - found on " << i.tag_str()); } @@ -25,7 +25,7 @@ class CTestHandler: for(const auto& node : path.nodes()) { td.name += "::"; - td.name += node.name(); + td.name += node.name().c_str(); } td.path = ::AST::Path(path); @@ -40,15 +40,16 @@ 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 { + void handle(const Span& sp, const AST::Attribute& mi, ::AST::Crate& crate, const AST::Path& path, AST::Module& mod, slice<const AST::Attribute> attrs, 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()); } 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 { + void handle(const Span& sp, const AST::Attribute& mi, ::AST::Crate& crate, const AST::Path& path, AST::Module& mod, slice<const AST::Attribute> attrs, 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 ) |