Skip to content

Commit b50d4d5

Browse files
committed
Make sure all helper programs are built in CI
1 parent 6f3469d commit b50d4d5

File tree

5 files changed

+28
-13
lines changed

5 files changed

+28
-13
lines changed

.github/workflows/build-test.yml

+2-3
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
../configure --with-llvm=/usr/bin/llvm-config \
4242
--enable-tcl
4343
- name: Build
44-
run: ASAN_OPTIONS=detect_leaks=0 make -C build -j $(nproc)
44+
run: ASAN_OPTIONS=detect_leaks=0 make -C build -j $(nproc) everything
4545
- name: Test
4646
run: ASAN_OPTIONS=detect_leaks=0 make -C build check
4747
- name: Test in JIT mode
@@ -75,9 +75,8 @@ jobs:
7575
ASAN_OPTIONS=detect_leaks=0 ./bin/run_regr ieee
7676
- name: JIT benchmarks
7777
run: |
78-
make -C build bin/jitperf
7978
export ASAN_OPTIONS=detect_leaks=0 # XXX: remove this
80-
./build/bin/jitperf -L build/lib/ test/perf/simple.vhd
79+
./build/bin/jitperf -L build/lib/ test/perf/simple.vhd -f add2
8180
- name: Check for orphan tests
8281
if: ${{ matrix.mode == 'debug' }}
8382
run: make -C build orphan-tests

Makefile.am

+5-3
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,14 @@ clean-local: clean-libs
7676
rm -f src/vlog/vlog-parse.c
7777
-test ! -d logs || rm -r logs
7878

79+
everything: $(BUILT_SOURCES) config.h
80+
$(MAKE) $(AM_MAKEFLAGS) all-am $(check_PROGRAMS) $(EXTRA_PROGRAMS)
81+
7982
if MAINTAINER_MODE
8083

8184
compile-commands:
8285
$(MAKE) -C $(top_builddir) clean
83-
bear -- $(MAKE) -k -j$$(nproc) -C $(top_builddir) $(bin_PROGRAMS) \
84-
$(check_PROGRAMS) $(EXTRA_PROGRAMS) $(pkglibexec_PROGRAMS)
86+
bear -- $(MAKE) -k -j$$(nproc) -C $(top_builddir) everything
8587

8688
release: update-test-dist
8789
echo $(PACKAGE_VERSION) | grep -E "^[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+$$"
@@ -137,5 +139,5 @@ upload-artifacts:
137139

138140
endif # MAINTAINER_MODE
139141

140-
.PHONY: cov-reset cov-report compile-commands
142+
.PHONY: cov-reset cov-report compile-commands everything
141143
.PHONY: release sync-branch upload-artifacts

test/lockbench.c

+3
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ typedef struct {
6060

6161
#define N_COUNTERS 8
6262

63+
const char copy_string[] = "";
64+
const char version_string[] = "";
65+
6366
static counter_t counter[N_COUNTERS];
6467

6568
STATIC_ASSERT(sizeof(counter) == N_COUNTERS * 64);

test/mtstress.c

+15-7
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,14 @@
3131
#include <stdio.h>
3232
#include <time.h>
3333

34+
#define CHECK(expr) do { \
35+
if (unlikely(!(expr))) \
36+
fatal_trace("check " #expr " failed"); \
37+
} while (0)
38+
39+
const char copy_string[] = "";
40+
const char version_string[] = "";
41+
3442
static volatile int start = 0;
3543

3644
static void run_test(thread_fn_t fn, void *arg)
@@ -208,7 +216,7 @@ static void gc_alloc_loop(mspace_t *m)
208216

209217
for (int i = 0; i < 100000; i++) {
210218
int32_t *mem = mspace_alloc(m, 4 + (rand() % 1000));
211-
ck_assert_ptr_nonnull(mem);
219+
CHECK(mem != NULL);
212220

213221
if (nsaved < ARRAY_LEN(saved) && (rand() % 2 == 0)) {
214222
saved[nsaved++] = mem;
@@ -217,7 +225,7 @@ static void gc_alloc_loop(mspace_t *m)
217225
}
218226

219227
for (int i = 0; i < ARRAY_LEN(saved); i++)
220-
ck_assert_int_eq(*saved[i], (i + 1) | (thread_id() << 16));
228+
CHECK(*saved[i] == ((i + 1) | (thread_id() << 16)));
221229
}
222230

223231
static void *test_gc_thread(void *arg)
@@ -259,7 +267,7 @@ static void *test_mir_types_thread(void *arg)
259267

260268
for (int i = 0; i < ARRAY_LEN(types); i++) {
261269
types[i] = mir_int_type(mu, 0, fast_rand(&rng) % (i + 1));
262-
assert(!mir_is_null(types[i]));
270+
CHECK(!mir_is_null(types[i]));
263271
}
264272

265273
rng = rng_init;
@@ -268,14 +276,14 @@ static void *test_mir_types_thread(void *arg)
268276
const uint32_t max = fast_rand(&rng) % (i + 1);
269277
const mir_repr_t repr = mir_get_repr(mu, types[i]);
270278

271-
assert(mir_get_class(mu, types[i]) == MIR_TYPE_INT);
279+
CHECK(mir_get_class(mu, types[i]) == MIR_TYPE_INT);
272280

273281
if (max <= 1)
274-
assert(repr == MIR_REPR_U1);
282+
CHECK(repr == MIR_REPR_U1);
275283
else if (max <= UINT8_MAX)
276-
assert(repr == MIR_REPR_U8);
284+
CHECK(repr == MIR_REPR_U8);
277285
else if (max <= UINT16_MAX)
278-
assert(repr == MIR_REPR_U16);
286+
CHECK(repr == MIR_REPR_U16);
279287
}
280288

281289
mir_unit_free(mu);

test/workqbench.c

+3
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@
2626
#include <limits.h>
2727
#include <assert.h>
2828

29+
const char copy_string[] = "";
30+
const char version_string[] = "";
31+
2932
#define NUM_JOBS 100000
3033
static int *results;
3134

0 commit comments

Comments
 (0)