author | wenzelm |
Sun, 02 Dec 2018 13:29:40 +0100 | |
changeset 69385 | be9f187dcd50 |
parent 69383 | 747f8b052e59 |
child 69444 | c3c9440cbf9b |
permissions | -rw-r--r-- |
69241 | 1 |
(* Title: Tools/Haskell/Test.thy |
69225 | 2 |
Author: Makarius |
3 |
*) |
|
4 |
||
69241 | 5 |
section \<open>Test build of Isabelle/Haskell modules\<close> |
69225 | 6 |
|
69241 | 7 |
theory Test imports Haskell |
69225 | 8 |
begin |
9 |
||
69239
6cd985a78d6e
support sub-directories, i.e. structure module names;
wenzelm
parents:
69225
diff
changeset
|
10 |
ML \<open> |
69225 | 11 |
Isabelle_System.with_tmp_dir "ghc" (fn dir => |
12 |
let |
|
69385
be9f187dcd50
clarified signature: allow to add_files/get_files by other tools;
wenzelm
parents:
69383
diff
changeset
|
13 |
val files = Generated_Files.write_files \<^theory>\<open>Haskell\<close> dir; |
69225 | 14 |
val (out, rc) = |
15 |
Isabelle_System.bash_output |
|
16 |
(cat_lines |
|
17 |
["set -e", |
|
18 |
"cd " ^ File.bash_path dir, |
|
69381
4c9b4e2c5460
more general command 'generate_file' for registered file types, notably Haskell;
wenzelm
parents:
69241
diff
changeset
|
19 |
"\"$ISABELLE_GHC\" " ^ File.bash_paths files]); |
69239
6cd985a78d6e
support sub-directories, i.e. structure module names;
wenzelm
parents:
69225
diff
changeset
|
20 |
in if rc = 0 then writeln out else error out end) |
69225 | 21 |
\<close> |
22 |
||
23 |
end |