Skip to content

Commit ee3bb88

Browse files
committed
Merge branch 'cxx-all'
* Branch commit log: Makefile.mk, ase/Makefile.mk: cxx-all: separate C++ targets ase/tests/TestList.mk: list all Ase tests ase/main.cc: --list-tests: sort and support custom separator ase/Makefile.mk: add one rule per test and validate TestList.mk doc/Makefile.mk: let uv for mkdocs depend on only Python 3 ase/logging.cc: add missing NDEBUG check Signed-off-by: Tim Janik <timj@gnu.org>
2 parents 7eca4f6 + 55ce446 commit ee3bb88

7 files changed

Lines changed: 87 additions & 20 deletions

File tree

Makefile.mk

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ endif
9898

9999
# == Target Collections ==
100100
ALL_TARGETS ::=
101+
CXX_TARGETS ::=
101102
LATE_TARGETS ::=
102103
ALL_TESTS ::=
103104
CHECK_TARGETS ::=
@@ -453,5 +454,6 @@ help: FORCE
453454
@echo ' checks for e.g. copyright attribution or codegen'
454455

455456
# == all rules ==
457+
cxx-all: $(CXX_TARGETS)
456458
$(eval $(LATE_EVAL))
457-
all: $(ALL_TARGETS) $(ALL_TESTS) $(LATE_TARGETS)
459+
all: cxx-all $(ALL_TARGETS) $(ALL_TESTS) $(LATE_TARGETS)

ase/Makefile.mk

Lines changed: 28 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ $>/codegen/ase/gen/api-jsonipc.g.ts: ase/api.hh jsonipc/jsonipc.ts $(lib/Anklang
108108
$Q echo 'Jsonipc.classes["Ase::SharedBase"] = SharedBase;' >> $@.tmp
109109
$Q echo >> $@.tmp
110110
$Q ASAN_OPTIONS=detect_leaks=0 ASE_JSONTS=1 \
111-
$(lib/AnklangSynthEngine) --norc -P null -M null --jsonts >> $@.tmp
111+
$(lib/AnklangSynthEngine) --norc -P null -M null --jsonts >> $@.tmp
112112
$Q echo '/**@type{ServerImpl}*/' >> $@.tmp
113113
$Q echo -n 'export let server: Promise<Server> | Server =' >> $@.tmp
114114
$Q echo 'Jsonipc.setup_promise_type (Server, s => server = s);' >> $@.tmp
@@ -196,7 +196,7 @@ $(call BUILD_PROGRAM, \
196196
$(lib/libase.so), \
197197
$(BOOST_SYSTEM_LIBS) $(ASEDEPS_LIBS) $(ALSA_LIBS) -lzstd -ldl $(lib/libsndfile.so), \
198198
../lib)
199-
ALL_TARGETS += $(lib/AnklangSynthEngine)
199+
CXX_TARGETS += $(lib/AnklangSynthEngine)
200200

201201
# == jackdriver.so ==
202202
lib/jackdriver.so ::= $>/lib/jackdriver.so
@@ -213,7 +213,7 @@ $(call BUILD_SHARED_LIB, \
213213
$(ANKLANG_JACK_LIBS) $(lib/libase.so), \
214214
../lib)
215215
endif
216-
ALL_TARGETS += $(lib/jackdriver.so.MAYBE)
216+
CXX_TARGETS += $(lib/jackdriver.so.MAYBE)
217217

218218
# == gtk2wrap.so ==
219219
lib/gtk2wrap.so ::= $>/lib/gtk2wrap.so
@@ -227,7 +227,7 @@ $(call BUILD_SHARED_LIB, \
227227
$(lib/libase.so) | $>/lib/, \
228228
$(GTK2_LIBS), \
229229
../lib)
230-
ALL_TARGETS += $(lib/gtk2wrap.so)
230+
CXX_TARGETS += $(lib/gtk2wrap.so)
231231

232232
# == install binaries ==
233233
$(call INSTALL_BIN_RULE, $(basename $(lib/AnklangSynthEngine)), $(DESTDIR)$(pkgdir)/lib, $(wildcard \
@@ -246,7 +246,7 @@ $>/.media.done: $(EXTERNAL_BLOBS4ANKLANG_STAMPS) $>/media/Samples/
246246
$Q ln -s $(abspath external/freepats-vorbis/Drum/*.ogg) $>/media/Samples/freepats-vorbis/Drum/
247247
$Q ln -s $(abspath external/freepats-vorbis/Tone/*.ogg) $>/media/Samples/freepats-vorbis/Tone/
248248
$Q touch $@
249-
ALL_TARGETS += $>/.media.done
249+
CXX_TARGETS += $>/.media.done
250250

251251
# == install media/Samples ==
252252
media/install:
@@ -290,18 +290,31 @@ ase/lint:
290290
.PHONY: ase/lint
291291
lint: ase/lint
292292

293-
# == Check Integrity Tests ==
294-
check-ase-tests: $(lib/AnklangSynthEngine)
295-
$(eval xargs_parallel != P=`parallel --help 2>/dev/null` && \
296-
[[ $$$$P =~ GNU.[Pp]arallel ]] && echo 'parallel --ungroup' || \
297-
{ echo 'xargs -n1'; echo "$$$$0: missing 'GNU parallel', falling back to 'xargs'" >&2; } )
293+
# == check-test-list ==
294+
.PHONY: check-ase-tests
295+
# Check: ase/tests/TestList.mk
296+
check-test-list: $(lib/AnklangSynthEngine) | $>/ase/tests/
298297
$(QGEN)
299-
$Q : $(lib/AnklangSynthEngine) --check
300-
$Q set -Eeuo pipefail \
301-
&& $(lib/AnklangSynthEngine) --list-tests \
302-
| $(xargs_parallel) $(lib/AnklangSynthEngine) --norc -P null -M null --test
303-
CHECK_TARGETS += check-ase-tests
298+
$Q echo -n 'ASE_TEST_LIST := ' > $>/ase/tests/TestList.mk
299+
$Q $(lib/AnklangSynthEngine) --list-tests=$$' \\\n' >> $>/ase/tests/TestList.mk
300+
$Q if cmp -s ase/tests/TestList.mk $>/ase/tests/TestList.mk ; then rm $>/ase/tests/TestList.mk ; else \
301+
( diff -u ase/tests/TestList.mk $>/ase/tests/TestList.mk || : ) \
302+
&& test -t 0 && ( read -p "? Update ase/tests/TestList.mk? [y/N] " ANS ; test "$$ANS" = "y" && mv $>/ase/tests/TestList.mk ase/tests/TestList.mk ) \
303+
&& ( echo 'ase/tests/TestList.mk: test list updated, restart make' ; false ) \
304+
fi
305+
check-ase-tests: check-test-list
304306

307+
# == check-ase-tests ==
308+
include ase/tests/TestList.mk # ASE_TEST_LIST
309+
define ASE_TEST_CHECK
310+
check-$1: $$(lib/AnklangSynthEngine)
311+
$$(QECHO) CHECK '$1'
312+
$$Q $$(lib/AnklangSynthEngine) --norc -P null -M null --test '$1'
313+
.PHONY: check-$1
314+
check-ase-tests: check-$1
315+
endef
316+
$(foreach T, $(ASE_TEST_LIST), $(eval $(call ASE_TEST_CHECK,$T)))
317+
CHECK_TARGETS += check-ase-tests
305318

306319
# == libsndfile ==
307320
# cmake -B out/sndfile/ -S external/libsndfile/ -DBUILD_SHARED_LIBS=ON -DBUILD_PROGRAMS=OFF -DBUILD_EXAMPLES=OFF -DCMAKE_BUILD_TYPE=MINSIZEREL

ase/logging.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ logging_configure (bool to_file, Logging level)
222222

223223
// == Stacktrace ==
224224
/// Find GDB and construct command line
225-
static std::string
225+
[[maybe_unused]] static std::string
226226
backtrace_command (const char *dbgr)
227227
{
228228
#if 0 && defined (__linux__)
@@ -299,6 +299,7 @@ debug_key_value (const char *conditional)
299299
return String (sv);
300300
}
301301

302+
#ifndef NDEBUG
302303
static void
303304
print_backtrace (FILE *stdio, const std::vector<void*> &frames)
304305
{
@@ -338,6 +339,7 @@ print_backtrace (FILE *stdio, const std::vector<void*> &frames)
338339
}
339340
free (symbols);
340341
}
342+
#endif // NDEBUG
341343

342344
/// Print confiogurable stack trace.
343345
static void

ase/main.cc

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,10 +201,16 @@ parse_args (int *argcp, char **argv, MainAppImpl &config)
201201
printerr ("CHECK_INTEGRITY_TESTS…\n");
202202
default_ui_mode = "none";
203203
}
204-
else if (strcmp ("--list-tests", argv[i]) == 0)
204+
else if (strncmp ("--list-tests", argv[i], 12) == 0)
205205
{
206+
const char *sep = strlen (argv[i]) >= 14 && argv[i][12] == '=' ? argv[i] + 13 : "\n";
207+
std::vector<std::string> ids;
206208
for (const auto &t : Test::list_tests())
207-
printout ("%s\n", t.ident);
209+
ids.push_back (t.ident);
210+
std::sort (ids.begin(), ids.end());
211+
for (const auto &t : ids)
212+
printout ("%s%s", sep, t);
213+
printout ("\n");
208214
exit (0);
209215
}
210216
else if (strcmp ("--test", argv[i]) == 0 || strncmp ("--test=", argv[i], 7) == 0)

ase/tests/TestList.mk

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
ASE_TEST_LIST := \
2+
aligned_allocator_tests \
3+
ase_serialize \
4+
ase_string_format \
5+
ase_test_timestamps \
6+
atomic_bits_test \
7+
atomic_mpmcstack_test \
8+
atomic_valuestack_test \
9+
blake3_tests \
10+
callback_list_test \
11+
crawler_tests \
12+
event_list_tests \
13+
job_queue_tests \
14+
jsonapi_tests \
15+
levenshtein_tests \
16+
loft_allocator_tests \
17+
loft_shuffle_thread_allocs \
18+
loft_simple_tests \
19+
mathutils_tests \
20+
member_tmpl_tests \
21+
memory_cstring_tests \
22+
mpmc_stack_test \
23+
path_tests \
24+
queuemux_test \
25+
randomhash_tests \
26+
regex_tests \
27+
signalutils_tests \
28+
sndfile_tests \
29+
sortnet_tests \
30+
string_tests \
31+
test_serializable_hierarchy \
32+
transport_tests \
33+
unicode_displayfs_tests \
34+
unicode_tests \
35+
utf8_codepoint_bench \
36+
utf8_strlen_bench_ascii \
37+
utf8_strlen_bench_high_planes \
38+
utils_tests \
39+
zbench_aligned_allocator_aligned_block \
40+
zbench_aligned_allocator_calloc \
41+
zbench_aligned_allocator_fast_mem_alloc \
42+
zbench_aligned_allocator_loft_alloc \
43+
zbench_aligned_allocator_memalign

doc/Makefile.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ $>/mkdocs/.prepared: $(doc/mkdocs.symlinks) doc/Makefile.mk | $>/mkdocs/
151151
$Q ln -s $(abspath doc/mkdocs.yml) $>/mkdocs/
152152
$Q ln -s $(abspath $(doc/mkdocs.symlinks)) $>/mkdocs/doc/
153153
$Q ln -s $(abspath ui/cursors) $>/mkdocs/doc/
154-
$Q cd $>/mkdocs/ && uv venv --python 3.12 \
154+
$Q cd $>/mkdocs/ && uv venv --python 3 \
155155
&& UV_LINK_MODE=copy uv pip install \
156156
mkdocs mkdocs-material mkdocs-file-filter-plugin mkdocs-literate-nav \
157157
git+https://github.com/tim-janik/mkdocs-live-edit-plugin

doc/copyright

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Files:
1616
ase/*.hh
1717
ase/Makefile.mk
1818
ase/gen/*.*
19+
ase/tests/TestList.mk
1920
devices/*
2021
devices/blepsynth/*
2122
devices/freeverb/Makefile.mk

0 commit comments

Comments
 (0)