1;;; ----------------------------------------------------------------------
2;;;    unit test
3;;;    Copyright (C) 2007 Andy Wingo
4;;;
5;;;    This program is free software; you can redistribute it and/or modify
6;;;    it under the terms of the GNU General Public License as published by
7;;;    the Free Software Foundation; either version 2 of the License, or
8;;;    (at your option) any later version.
9;;;
10;;;    This program is distributed in the hope that it will be useful,
11;;;    but WITHOUT ANY WARRANTY; without even the implied warranty of
12;;;    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13;;;    GNU General Public License for more details.
14;;;
15;;;    You should have received a copy of the GNU General Public License
16;;;    along with this program; if not, write to the Free Software
17;;;    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18;;; ----------------------------------------------------------------------
19(use-modules (unit-test)
20             (apicheck)
21             (ice-9 pretty-print)
22             (oop goops))
23
24(define-class <test-wrapset-api> (<test-case>))
25
26(define *modules*
27  (call-with-input-string (getenv "WRAPSET_MODULES") read))
28(define *api-file*
29  (getenv "WRAPSET_API_FILE"))
30
31(define-method (test-wrapset-api (self <test-wrapset-api>))
32  (apicheck-validate
33   (call-with-input-file *api-file* read)
34   *modules*))
35
36(define (main args)
37  (exit-with-summary (run-all-defined-test-cases)))
38
39(define (update-api args)
40  (with-output-to-file *api-file*
41    (lambda ()
42      (pretty-print
43       (apicheck-generate
44        *modules*)))))
45