From ec1dc3542bd5122db57f4459f63a6040f5e3ab20 Mon Sep 17 00:00:00 2001 From: John Hodge Date: Sun, 7 May 2017 14:52:28 +0800 Subject: Main - Load test crate when compiling a test --- src/main.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index f06ee545..83fd5ac3 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -314,6 +314,10 @@ int main(int argc, char *argv[]) // - `mrustc-main` lang item default crate.m_lang_items.insert(::std::make_pair( ::std::string("mrustc-main"), ::AST::Path("", {AST::PathNode("main")}) )); } + if( params.test_harness ) + { + crate.load_extern_crate(Span(), "test"); + } // Resolve names to be absolute names (include references to the relevant struct/global/function) // - This does name checking on types and free functions. -- cgit v1.2.3