(.module: [lux (#- Name) [abstract [monad (#+ do)]] [control [concurrency ["." promise (#+ Promise) ("#\." monad)]] [security ["!" capability]]] [data [text ["%" format (#+ format)]]] [math [number ["i" int]]] [world [program (#+ Program)] ["." file] ["." shell (#+ Shell)] ["." console (#+ Console)]]] ["." // #_ ["#." build] ["/#" // #_ ["#." action] ["#." command (#+ Command)] ["#." runtime] [dependency [resolution (#+ Resolution)]]]]) (def: #export start "[TEST STARTED]") (def: #export success "[TEST ENDED]") (def: #export failure "[TEST FAILED]") (def: #export (do! console program fs shell resolution profile) (-> (Console Promise) (Program Promise) (file.System Promise) (Shell Promise) Resolution (Command Any)) (do promise.monad [environment (\ program environment []) working_directory (\ program directory [])] (do ///action.monad [[compiler program] (//build.do! console program fs shell resolution profile) _ (console.write_line ..start console) #let [[compiler_command compiler_parameters] (case compiler (#//build.JVM artifact) (///runtime.java program) (#//build.JS artifact) (///runtime.node program))] process (!.use (\ shell execute) [environment working_directory compiler_command compiler_parameters]) exit (!.use (\ process await) []) _ (console.write_line (if (i.= shell.normal exit) ..success ..failure) console)] (wrap []))))