src/HOL/Library/code_test.ML
changeset 59323 468bd3aedfa1
parent 58832 ec9550bd5fd7
child 59720 f893472fff31
equal deleted inserted replaced
59322:8ccecf1415b0 59323:468bd3aedfa1
   569 val _ = 
   569 val _ = 
   570   Outer_Syntax.command @{command_spec "test_code"}
   570   Outer_Syntax.command @{command_spec "test_code"}
   571     "compile test cases to target languages, execute them and report results"
   571     "compile test cases to target languages, execute them and report results"
   572       (test_codeP >> (fn (raw_ts, targets) => Toplevel.keep (test_code_cmd raw_ts targets)))
   572       (test_codeP >> (fn (raw_ts, targets) => Toplevel.keep (test_code_cmd raw_ts targets)))
   573 
   573 
   574 val _ = Context.>> (Context.map_theory (
   574 val _ = Theory.setup (fold add_driver
   575   fold add_driver
   575   [(polymlN, (evaluate_in_polyml, Code_ML.target_SML)),
   576     [(polymlN, (evaluate_in_polyml, Code_ML.target_SML)),
   576    (mltonN, (evaluate_in_mlton, Code_ML.target_SML)),
   577      (mltonN, (evaluate_in_mlton, Code_ML.target_SML)),
   577    (smlnjN, (evaluate_in_smlnj, Code_ML.target_SML)),
   578      (smlnjN, (evaluate_in_smlnj, Code_ML.target_SML)),
   578    (ocamlN, (evaluate_in_ocaml, Code_ML.target_OCaml)),
   579      (ocamlN, (evaluate_in_ocaml, Code_ML.target_OCaml)),
   579    (ghcN, (evaluate_in_ghc, Code_Haskell.target)),
   580      (ghcN, (evaluate_in_ghc, Code_Haskell.target)),
   580    (scalaN, (evaluate_in_scala, Code_Scala.target))]
   581      (scalaN, (evaluate_in_scala, Code_Scala.target))]
   581   #> fold (fn target => Value.add_evaluator (target, eval_term target))
   582     #> fold (fn target => Value.add_evaluator (target, eval_term target))
   582     [polymlN, mltonN, smlnjN, ocamlN, ghcN, scalaN]);
   583       [polymlN, mltonN, smlnjN, ocamlN, ghcN, scalaN]
   583 
   584     ))
       
   585 end
   584 end
   586 
   585