Skip to content

Commit 045e45f

Browse files
committed
described checkmk in Demo
1 parent 7f21255 commit 045e45f

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

doc/demo/README.md

+8
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,14 @@ REFLECT-demodb_alt_test:=n
314314

315315
Here we're building a library .a file and linking it to this test. The last line is - not to generate reflection meta-information.
316316

317+
Check library has an utility called `checkmk`, which accepts a [special file format](https://github.com/libcheck/check/blob/master/checkmk/test/multiple_everything/in) as input and generates test that inludes tests. We also support that: such files must have name pattern `*.checkmk`. Metac will generate test binary with the name `*_checkmk` for such file. Here is the [converted example](step_02/demodb_alt.checkmk). And we need to make the corresponding changes in Makefile:
318+
319+
```Makefile
320+
DEPS-demodb_alt_checkmk:=$(M)/libdemodb.a
321+
LDFLAGS-demodb_alt_checkmk:=-L$(M) -ldemodb
322+
REFLECT-demodb_alt_checkmk:=n
323+
```
324+
317325
To make sure that this works ok - just run `make METAC_ROOT=../../.. test` or `make METAC_ROOT=../../..` in the folder [step_02](step_02/)
318326

319327
### Reflection

mk/test.mk

+7-5
Original file line numberDiff line numberDiff line change
@@ -60,31 +60,33 @@ endef
6060
test_checkmk_c_clean = $(eval $(call test_checkmk_c_clean_tpl,$1,$2))
6161

6262
define test_checkmk_meta_rules_tpl
63-
$(warning XXX)
6463
$(3)+= \
65-
$(2:.checkmk=_checkmk) \
66-
$(2:.checkmk=_checkmk.reflect.c) \
67-
$$(dir $(2:.checkmk=_checkmk))_meta_$$(notdir $(2:.checkmk=_checkmk))
64+
$(2:.checkmk=_checkmk)
6865

6966
TPL-$(2:.checkmk=_checkmk):=bin_target test_checkmk_c
7067
IN-$(2:.checkmk=_checkmk)=$(2:.checkmk=_checkmk.o)
7168
LDFLAGS-$(2:.checkmk=_checkmk)+=--coverage $$(METAC_CHECK_LDFLAGS)
7269
$$(addprefix $1/,$(2:.checkmk=_checkmk.o)):CFLAGS+=-g3 -Wno-format-extra-args --coverage $$(METAC_CHECK_CFLAGS)
7370
$$(addprefix $1/,$(2:.checkmk=_checkmk.meta.o)):CFLAGS+=-Wno-format-extra-args $$(METAC_CHECK_CFLAGS)
71+
7472
ifneq ($$(REFLECT-$(2:.checkmk=_checkmk)),n)
7573
IN-$(2:.checkmk=_checkmk)+=$(2:.checkmk=_checkmk.reflect.o)
7674

7775
TPL-$(2:.checkmk=_checkmk.reflect.c):=metac_target
7876
METACFLAGS-$(2:.checkmk=_checkmk.reflect.c)+=run metac-reflect-gen $(METAC_OVERRIDE_IN_TYPE)
7977
IN-$(2:.checkmk=_checkmk.reflect.c)=$$(dir $(2:.c=))_meta_$$(notdir $(2:.checkmk=_checkmk))
80-
endif
8178

8279
TPL-$$(dir $(2:.checkmk=_checkmk))_meta_$$(notdir $(2:.checkmk=_checkmk)):=bin_target
8380
IN-$$(dir $(2:.checkmk=_checkmk))_meta_$$(notdir $(2:.checkmk=_checkmk))=$(2:.checkmk=_checkmk.meta.o)
8481
LDFLAGS-$$(dir $(2:.checkmk=_checkmk))_meta_$$(notdir $(2:.checkmk=_checkmk))=$$(LDFLAGS-$(2:.checkmk=))
8582
DEPS-$$(dir $(2:.checkmk=_checkmk))_meta_$$(notdir $(2:.checkmk=_checkmk))=$$(DEPS-$(2:.checkmk=))
8683
POST-$$(dir $(2:.checkmk=_checkmk))_meta_$$(notdir $(2:.checkmk=_checkmk))=$$(METAC_POST_META)
8784

85+
$(3)+= \
86+
$(2:.checkmk=_checkmk.reflect.c) \
87+
$$(dir $(2:.checkmk=_checkmk))_meta_$$(notdir $(2:.checkmk=_checkmk))
88+
endif
89+
8890
bin_test: $$(addprefix $1/,$(2:.checkmk=_checkmk))
8991

9092
endef # test_checkmk_meta_rules_tpl

0 commit comments

Comments
 (0)