From 24b47fbd48d201c0bd79394912dc445b9f19b67e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20=C3=96hrstr=C3=B6m?= Date: Mon, 12 Feb 2024 00:13:13 +0100 Subject: [PATCH] Temporarily avoid building xmq when testing after deb build. --- Makefile | 4 ++-- src/main.cc | 2 ++ test.sh | 7 ++++++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 2b59714..2053be1 100644 --- a/Makefile +++ b/Makefile @@ -455,11 +455,11 @@ collect_copyrights: 3rdparty/xmq/build/default/release/xmq: $(wildcard 3rdparty/xmq/src/main/c/* 3rdparty/xmq/src/main/c/parts/*) @mkdir -p 3rdparty - @(cd 3rdparty; git clone https://github.com/libxmq/xmq.git; cd xmq; ./configure; make; make test) + @(cd 3rdparty; git clone https://github.com/libxmq/xmq.git; cd xmq; ./configure) + @if [ "$(cat build/default/spec.mk | grep CC)" = "CC:=gcc" ]; then (cd 3rdparty/xmq; make) ; else rm -f $@ ; mkdir -p $$(dirname $@); touch $@ ; echo "Could not build xmq." ; fi build/xmq: 3rdparty/xmq/build/default/release/xmq @cp $< $@ - @if [ "$(build/xmq --version ; echo $?)" != "0" ]; then echo "Failed to build a working xmq!"; fi # Include dependency information generated by gcc in a previous compile. include $(wildcard $(patsubst %.o,%.d,$(PROG_OBJS) $(DRIVER_OBJS))) diff --git a/src/main.cc b/src/main.cc index 8c5ce83..1f30e3c 100644 --- a/src/main.cc +++ b/src/main.cc @@ -311,6 +311,8 @@ void list_fields(Configuration *config, string meter_driver) void list_meters(Configuration *config) { + loadAllBuiltinDrivers(); + for (DriverInfo *di : allDrivers()) { string mname = di->name().str(); diff --git a/test.sh b/test.sh index 6ae314d..17e2940 100755 --- a/test.sh +++ b/test.sh @@ -169,7 +169,12 @@ if [ "$?" != "0" ]; then RC="1"; fi ./tests/test_rtlwmbus_timestamps.sh $PROG if [ "$?" != "0" ]; then RC="1"; fi -./build/xmq tests/generated_tests.xmq for-each /test --shell='./tests/testit.sh '$PROG' "${args}" "${telegram}" "${json}" "${fields}"' +if [ -s build/xmq ] +then + ./build/xmq tests/generated_tests.xmq for-each /test --shell='./tests/testit.sh '$PROG' "${args}" "${telegram}" "${json}" "${fields}"' +else + echo "Skipping tests/generated_tests.xmq since xmq is missing." +fi ./tests/test_drivers.sh $PROG if [ "$?" != "0" ]; then RC="1"; fi