From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.4 required=5.0 tests=SPF_NEUTRAL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id F1F5CBC6B for ; Sun, 19 Aug 2007 08:28:53 +0200 (CEST) Received: from wx-out-0506.google.com (wx-out-0506.google.com [66.249.82.227]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l7J6SqD0023682 for ; Sun, 19 Aug 2007 08:28:53 +0200 Received: by wx-out-0506.google.com with SMTP id h27so862507wxd for ; Sat, 18 Aug 2007 23:28:52 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=lt7H1asnXo++e6+skOcweuEz8jyG+LmRbNsqMIsFhJNzWqIiqun7sQLSADBcJAS20pmLqdx41XPnOUtP0dECajJ0hazieEYj9FjYZjtd/xCxL3mWwwMQQHtPt1Eem+gFvTNNoL1tdi7o7xQs3WX1Kvp9LYKvETEUZu7Rdlq2RIY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=VvbQSwoa+4inDE5/yBPsOyhy8mR4CsUkNxfH5J2zPSVMBgxeCNb/haDw7Te42dNzcvvDFT4lLnIMaPlkNichz5MCMeryIE0bKX2aUrkSW0flXmgBf0vlwn/0QBZK1nHs96VwCApyc0BaPsUgnkjkDrjwFIPggCLxYR5aFtWIUqI= Received: by 10.70.19.20 with SMTP id 20mr8149949wxs.1187504931706; Sat, 18 Aug 2007 23:28:51 -0700 (PDT) Received: by 10.100.57.6 with HTTP; Sat, 18 Aug 2007 23:28:51 -0700 (PDT) Message-ID: Date: Sun, 19 Aug 2007 01:28:51 -0500 From: "Andrew Gacek" To: "Robert Fischer" Subject: Re: [Caml-list] Building and Tests Cc: caml-list@yquem.inria.fr In-Reply-To: <46C7A266.6010606@fischerventure.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <46C7A266.6010606@fischerventure.com> X-j-chkmail-Score: MSGID : 46C7E325.000 on discorde : j-chkmail score : X : 0/20 1 0.000 -> 1 X-Miltered: at discorde with ID 46C7E325.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; -verbose:01 beginner's:01 ocaml:01 bug:01 pulled:98 beginners:01 wrote:01 assert:01 assert:01 caml-list:01 caml-list:01 bin:01 explicitly:02 explicitly:02 define:02 One thing I find helpful is to define tests anonymously inside of a single test group. So inside of say list_test.ml I have let tests = "List" >::: [ "Empty list should have size zero" >:: (fun () -> assert_equal 0 (List.length [])) ; "Singleton list should have size one" >:: (fun () -> assert_equal 1 (List.length [0])) ; ... ] Then I have a single file for the project called test.ml which includes all the module tests explicitly and runs them. For example, let tests = "Project Tests" >::: [ List_test.tests ; Array_test.tests ; String_test.tests ; ... ] let _ = run_test_tt_main tests Finally in my OMakefile I have TEST_FILES[] = $(rootname $(find . -name *_test.ml)) test .PHONY: test test: $(OCamlProgram unit_test, $(OUNIT) $(FILES) $(TEST_FILES)) ./unit_test -verbose The end result of all of this is that when I add a new test to an existing module, I don't have to explicitly include it to be run. The only thing I have to do explicitly is list my module tests in the master test.ml file, and this list rarely changes. -Andrew On 8/18/07, Robert Fischer wrote: > Is there any kind of automation that other people have built for OUnit? > I'm wondering if anyone has pulled together OMake or shell scripts to > execute all the tests in multiple different files, or a test-then-build > structure? > > ~~ Robert. > > _______________________________________________ > Caml-list mailing list. Subscription management: > http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list > Archives: http://caml.inria.fr > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs >