0 | |
From: pineau <francois-xavier.pineau@astro.unistra.fr>
|
1 | |
Date: Tue, 12 Nov 2019 15:14:39 +0100
|
2 | |
Subject: Update build to fail if a test fails, fix test error
|
3 | |
|
4 | |
---
|
5 | |
build.xml | 2 +-
|
6 | |
src/test/java/cds/healpix/common/math/HasckerDelightTestPerf.java | 6 +++---
|
7 | |
2 files changed, 4 insertions(+), 4 deletions(-)
|
8 | |
|
9 | |
diff --git a/build.xml b/build.xml
|
10 | |
index 675b9af..c52588f 100644
|
11 | |
--- a/build.xml
|
12 | |
+++ b/build.xml
|
13 | |
@@ -141,7 +141,7 @@
|
14 | |
<!-- EXEC TESTS -->
|
15 | |
|
16 | |
<target name="test" depends="tcompile">
|
17 | |
- <junit fork="true">
|
18 | |
+ <junit haltonfailure="true" fork="true">
|
19 | |
<classpath>
|
20 | |
<pathelement location="${classes}" />
|
21 | |
<pathelement location="${tclasses}" />
|
22 | |
diff --git a/src/test/java/cds/healpix/common/math/HasckerDelightTestPerf.java b/src/test/java/cds/healpix/common/math/HasckerDelightTestPerf.java
|
23 | |
index b4ee97f..6c67ab0 100644
|
24 | |
--- a/src/test/java/cds/healpix/common/math/HasckerDelightTestPerf.java
|
25 | |
+++ b/src/test/java/cds/healpix/common/math/HasckerDelightTestPerf.java
|
26 | |
@@ -43,7 +43,7 @@ public final class HasckerDelightTestPerf {
|
27 | |
l2 = System.nanoTime();
|
28 | |
System.out.println("HalfClassic: " + s1 + " in " + (l2 - l1) / 1000000.0 + " ms");
|
29 | |
|
30 | |
- assertEquals(s1, s2);
|
31 | |
+ assertEquals(s1, s2, 1e-15);
|
32 | |
|
33 | |
l1 = System.nanoTime();
|
34 | |
s1 = halfOfBits(data);
|
35 | |
@@ -55,7 +55,7 @@ public final class HasckerDelightTestPerf {
|
36 | |
l2 = System.nanoTime();
|
37 | |
System.out.println("HalfClassic: " + s1 + " in " + (l2 - l1) / 1000000.0 + " ms");
|
38 | |
|
39 | |
- assertEquals(s1, s2);
|
40 | |
+ assertEquals(s1, s2, 1e-15);
|
41 | |
}
|
42 | |
|
43 | |
private static double halfOfClassic(final double[] values) {
|
44 | |
@@ -75,7 +75,7 @@ public final class HasckerDelightTestPerf {
|
45 | |
}
|
46 | |
|
47 | |
@Test
|
48 | |
- public void testPerf(final String[] args) {
|
49 | |
+ public void testPerf() {
|
50 | |
// Same exec time: smart compilo ;)
|
51 | |
System.out.println("Check that performances are the same (smart compilo ;) ):");
|
52 | |
halfOfTest(60000000);
|