From 2bec05caffc9241b77d83c72593150215e24b37a Mon Sep 17 00:00:00 2001 From: aminya Date: Thu, 12 Dec 2019 13:22:41 +0330 Subject: [PATCH] default runtests for @snoopiBot --- src/utilities.jl | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/utilities.jl b/src/utilities.jl index 0c688aa48..a8b88f2e6 100644 --- a/src/utilities.jl +++ b/src/utilities.jl @@ -101,12 +101,7 @@ end macro that generates precompile files and includes them in the package. Calls other utitlities. """ -macro snoopiBot(packageName::String, snoopScript) - -# by default run "runtests" -# = :(using MatLang; include(joinpath(dirname(dirname(pathof(MatLang))), "test","runtests.jl")); ) - - +macro snoopiBot(packageName::String, snoopScript::Expr) ################################################################ package = Symbol(packageName) packageSym = QuoteNode(package) @@ -129,7 +124,7 @@ macro snoopiBot(packageName::String, snoopScript) ################################################################ ### Parse the compiles and generate precompilation scripts pc = SnoopCompile.parcel(data) - onlypackage = Dict( $packageSym => sort(pc[$packageSym] ) ) + onlypackage = Dict( $packageSym => sort( pc[$packageSym] ) ) SnoopCompile.write("$(pwd())/precompile",onlypackage) ################################################################ cd(rootPath) @@ -137,3 +132,14 @@ macro snoopiBot(packageName::String, snoopScript) end end + +macro snoopiBot(packageName::String) + package = Symbol(packageName) + packageSym = QuoteNode(package) + snoopScript = :(QuoteNode( + using packageSym; include(joinpath(dirname(dirname(pathof(packageSym))), "test","runtests.jl")); + )) + return quote + @snoopiBot $packageName $snoopScript + end +end