[Libguestfs] [PATCH 1/6] java: Enable assertions when doing 'make check'.

Richard W.M. Jones rjones at redhat.com
Wed Mar 2 05:15:18 UTC 2011


-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming blog: http://rwmj.wordpress.com
Fedora now supports 80 OCaml packages (the OPEN alternative to F#)
http://cocan.org/getting_started_with_ocaml_on_red_hat_and_fedora
-------------- next part --------------
>From db98ac041ec36c4e2ce322d336f5792fa8e6922d Mon Sep 17 00:00:00 2001
From: Richard W.M. Jones <rjones at redhat.com>
Date: Wed, 2 Mar 2011 05:08:20 +0000
Subject: [PATCH 1/6] java: Enable assertions when doing 'make check'.

It turns out that Java assertions are disabled by default.  You have
to add the 'java -ea' flag to the JVM.  Who knew ..?

Because of this oversight, the tests weren't actually performing the
assertions that we wanted (although in fact none of the assertions
were failing).

This change enables assertions when running the tests.
---
 java/run-java-tests |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/java/run-java-tests b/java/run-java-tests
index 8447160..64ce079 100755
--- a/java/run-java-tests
+++ b/java/run-java-tests
@@ -1,6 +1,6 @@
 #!/bin/sh -
 # libguestfs Perl bindings
-# Copyright (C) 2009 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
@@ -20,5 +20,5 @@ set -e
 
 for f in t/*.class; do
   classname=$(basename $f .class)
-  $JAVA -Djava.library.path=.libs $classname
+  $JAVA -Djava.library.path=.libs -ea $classname
 done
\ No newline at end of file
-- 
1.7.4



More information about the Libguestfs mailing list