tests: Rename capitests -> tests/c-api.
[libguestfs.git] / generator / generator_main.ml
index bf1e8e0..7e4e4ed 100644 (file)
@@ -1,5 +1,5 @@
 (* libguestfs
- * Copyright (C) 2009-2010 Red Hat Inc.
+ * Copyright (C) 2009-2011 Red Hat Inc.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -28,7 +28,7 @@ open Generator_api_versions
 open Generator_c
 open Generator_xdr
 open Generator_daemon
-open Generator_capitests
+open Generator_tests_c_api
 open Generator_fish
 open Generator_ocaml
 open Generator_perl
@@ -38,6 +38,7 @@ open Generator_java
 open Generator_haskell
 open Generator_csharp
 open Generator_php
+open Generator_erlang
 open Generator_bindtests
 open Generator_errnostring
 
@@ -50,7 +51,7 @@ let perror msg = function
 (* Main program. *)
 let () =
   let lock_fd =
-    try openfile "HACKING" [O_RDWR] 0
+    try openfile "BUGS" [O_RDWR] 0
     with
     | Unix_error (ENOENT, _, _) ->
         eprintf "\
@@ -60,7 +61,7 @@ Run it from the top source directory using the command
 ";
         exit 1
     | exn ->
-        perror "open: HACKING" exn;
+        perror "open: BUGS" exn;
         exit 1 in
 
   (* Acquire a lock so parallel builds won't try to run the generator
@@ -70,7 +71,7 @@ Run it from the top source directory using the command
    *)
   (try lockf lock_fd F_LOCK 1
    with exn ->
-     perror "lock: HACKING" exn;
+     perror "lock: BUGS" exn;
      exit 1);
 
   (* Read the API versions file. *)
@@ -94,10 +95,12 @@ Run it from the top source directory using the command
   output_to "daemon/names.c" generate_daemon_names;
   output_to "daemon/optgroups.c" generate_daemon_optgroups_c;
   output_to "daemon/optgroups.h" generate_daemon_optgroups_h;
-  output_to "capitests/tests.c" generate_tests;
+  output_to "tests/c-api/tests.c" generate_tests;
   output_to "fish/cmds_gperf.gperf" generate_fish_cmds_gperf;
   output_to "fish/cmds.c" generate_fish_cmds;
   output_to "fish/completion.c" generate_fish_completion;
+  output_to "fish/event-names.c" generate_fish_event_names;
+  output_to "fish/fish-cmds.h" generate_fish_cmds_h;
   output_to "fish/guestfish-commands.pod" generate_fish_commands_pod;
   output_to "fish/guestfish-actions.pod" generate_fish_actions_pod;
   output_to "fish/prepopts.c" generate_fish_prep_options_c;
@@ -131,12 +134,18 @@ Run it from the top source directory using the command
   output_to "csharp/Libguestfs.cs" generate_csharp;
   output_to "php/extension/php_guestfs_php.h" generate_php_h;
   output_to "php/extension/guestfs_php.c" generate_php_c;
+  output_to "erlang/guestfs.erl" generate_erlang_erl;
+  output_to "erlang/erl-guestfs.c" generate_erlang_c;
+
+  (* Generate the list of files generated -- last. *)
+  printf "generated %d lines of code\n" (get_lines_generated ());
+  let files = List.sort compare (get_files_generated ()) in
+  output_to "generator/files-generated.txt"
+    (fun () -> List.iter (pr "%s\n") files);
 
   (* Always generate this file last, and unconditionally.  It's used
    * by the Makefile to know when we must re-run the generator.
    *)
   let chan = open_out "generator/stamp-generator" in
   fprintf chan "1\n";
-  close_out chan;
-
-  printf "generated %d lines of code\n" (get_lines_generated ())
+  close_out chan