(.module: [library [lux (#- Name) [abstract [monad (#+ do)]] [control [concurrency ["." promise (#+ Promise) ("#\." monad)]]] [math [number ["i" int]]] [world ["." program (#+ Program)] ["." file] ["." shell (#+ Exit Shell)] ["." console (#+ Console)]]]] ["." // #_ ["#." build] ["/#" // #_ ["#" profile] ["#." 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 [Exit Any])) (do promise.monad [environment (program.environment promise.monad program) #let [working_directory (\ program directory)]] (do {! ///action.monad} [#let [home (\ program home)] [build_exit compiler program] (//build.do! console program fs shell resolution (set@ #///.program (get@ #///.test profile) profile))] (if (i.= shell.normal build_exit) (do ! [_ (console.write_line ..start console) #let [host_dependencies (//build.host_dependencies fs home resolution) [test_command test_parameters] (case compiler (#//build.JVM dependency) (|> program (///runtime.for (get@ #///.java profile)) (//build.with_jvm_class_path host_dependencies)) (^template [ ] [( artifact) (///runtime.for (get@ profile) program)]) ([#//build.JVM #///.java] [#//build.JS #///.js] [#//build.Python #///.python] [#//build.Lua #///.lua] [#//build.Ruby #///.ruby]))] process (\ shell execute [environment working_directory test_command test_parameters]) _ (//build.log_output! console process) _ (//build.log_error! console process) exit (\ process await []) _ (console.write_line (if (i.= shell.normal exit) ..success ..failure) console)] (wrap [exit []])) (wrap [build_exit []])))))