Skip to content

Commit e4e5062

Browse files
committed
Testing fixes + move tests
1 parent b3f798e commit e4e5062

32 files changed

+98
-97
lines changed

bin/test_runner/parallel.ml

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -57,19 +57,14 @@ let build_batch targets =
5757
end
5858

5959
let build_all_tests _config tests =
60-
(* Build test executables one category at a time so that compilation
61-
failures in one category (e.g. wip) don't prevent tests in another
62-
category (e.g. regression) from being built. Within a category dune's
63-
internal parallelism handles concurrent compilation. *)
64-
let by_category = Hashtbl.create 8 in
60+
(* Build each test executable individually so that a compilation failure
61+
in one test cannot prevent other tests from being built. Each call to
62+
dune is a separate process; dune's file-level caching keeps this fast
63+
since shared dependencies (plugin, theories) are only built once. *)
6564
List.iter (fun t ->
6665
let target = Printf.sprintf "tests/%s/%s/%s.t.exe" t.category t.name t.name in
67-
let cur = try Hashtbl.find by_category t.category with Not_found -> [] in
68-
Hashtbl.replace by_category t.category (target :: cur)
69-
) tests;
70-
Hashtbl.iter (fun _category targets ->
71-
ignore (build_batch targets)
72-
) by_category
66+
ignore (build_batch [target])
67+
) tests
7368

7469
let run_test config test =
7570
let test_dir = Printf.sprintf "%s/_build/default/tests/%s/%s" config.project_root test.category test.name in

tests/basics/dune

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,9 @@
276276
(deps int63_arith.t.exe)
277277
(action (run ./int63_arith.t.exe))))
278278

279-
(subdir prim_array
279+
280+
281+
(subdir prim_array_test
280282
(rule
281283
(targets prim_array_test.t.exe)
282284
(deps PrimArrayTest.vo prim_array_test.t.cpp (source_tree .))
@@ -286,5 +288,3 @@
286288
(alias runtest)
287289
(deps prim_array_test.t.exe)
288290
(action (run ./prim_array_test.t.exe))))
289-
290-
File renamed without changes.

tests/basics/prim_array/prim_array_test.cpp renamed to tests/basics/prim_array_test/prim_array_test.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
// Copyright 2026 Bloomberg Finance L.P.
2-
// Distributed under the terms of the GNU LGPL v2.1 license.
31
#include <algorithm>
42
#include <any>
53
#include <cassert>
4+
#include <cstdint>
65
#include <functional>
76
#include <iostream>
8-
#include <prim_array_test.h>
97
#include <memory>
108
#include <optional>
9+
#include <persistent_array.h>
10+
#include <prim_array_test.h>
1111
#include <stdexcept>
1212
#include <string>
1313
#include <utility>

tests/basics/prim_array/prim_array_test.h renamed to tests/basics/prim_array_test/prim_array_test.h

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,15 @@ template <class... Ts> Overloaded(Ts...) -> Overloaded<Ts...>;
2222

2323
struct PrimArrayTest {
2424
static inline const persistent_array<unsigned int> arr5 =
25-
persistent_array<unsigned int>(5, 0);
25+
persistent_array<unsigned int>(int64_t(5), 0);
2626

27-
static inline const unsigned int get_default = arr5.get(0);
27+
static inline const unsigned int get_default = arr5.get(int64_t(0));
2828

2929
static inline const int64_t arr5_len = arr5.length();
3030

3131
static inline const persistent_array<unsigned int> arr5_modified = arr5.set(
32-
2, ((((((((((((((((((((((((((((((((((((((((((0 + 1) + 1) + 1) + 1) + 1) +
33-
1) +
34-
1) +
35-
1) +
32+
int64_t(2),
33+
((((((((((((((((((((((((((((((((((((((((((0 + 1) + 1) + 1) + 1) + 1) +
3634
1) +
3735
1) +
3836
1) +
@@ -66,15 +64,19 @@ struct PrimArrayTest {
6664
1) +
6765
1) +
6866
1) +
69-
1));
67+
1) +
68+
1) +
69+
1) +
70+
1));
7071

71-
static inline const unsigned int get_modified = arr5_modified.get(2);
72+
static inline const unsigned int get_modified = arr5_modified.get(int64_t(2));
7273

73-
static inline const unsigned int get_original = arr5.get(2);
74+
static inline const unsigned int get_original = arr5.get(int64_t(2));
7475

7576
static inline const persistent_array<unsigned int> arr_chain =
76-
arr5.set(0, ((((((((((0 + 1) + 1) + 1) + 1) + 1) + 1) + 1) + 1) + 1) + 1))
77-
.set(1,
77+
arr5.set(int64_t(0),
78+
((((((((((0 + 1) + 1) + 1) + 1) + 1) + 1) + 1) + 1) + 1) + 1))
79+
.set(int64_t(1),
7880
((((((((((((((((((((0 + 1) + 1) + 1) + 1) + 1) + 1) + 1) + 1) +
7981
1) +
8082
1) +
@@ -88,7 +90,7 @@ struct PrimArrayTest {
8890
1) +
8991
1) +
9092
1))
91-
.set(2,
93+
.set(int64_t(2),
9294
((((((((((((((((((((((((((((((0 + 1) + 1) + 1) + 1) + 1) + 1) +
9395
1) +
9496
1) +
@@ -115,18 +117,18 @@ struct PrimArrayTest {
115117
1) +
116118
1));
117119

118-
static inline const unsigned int chain_0 = arr_chain.get(0);
120+
static inline const unsigned int chain_0 = arr_chain.get(int64_t(0));
119121

120-
static inline const unsigned int chain_1 = arr_chain.get(1);
122+
static inline const unsigned int chain_1 = arr_chain.get(int64_t(1));
121123

122-
static inline const unsigned int chain_2 = arr_chain.get(2);
124+
static inline const unsigned int chain_2 = arr_chain.get(int64_t(2));
123125

124-
static inline const unsigned int chain_3 = arr_chain.get(3);
126+
static inline const unsigned int chain_3 = arr_chain.get(int64_t(3));
125127

126128
static inline const persistent_array<unsigned int> arr_copy =
127129
arr5_modified.copy();
128130

129-
static inline const unsigned int copy_val = arr_copy.get(2);
131+
static inline const unsigned int copy_val = arr_copy.get(int64_t(2));
130132

131-
static inline const unsigned int oob_get = arr5.get(99);
133+
static inline const unsigned int oob_get = arr5.get(int64_t(99));
132134
};
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)