xaizek / stic (License: MIT) (since 2018-12-07)
Simple Tests In C with optional automatic test registration in C.
<root> / examples / nix / auto-registration / makefile (9af51cf663942ac53b67bc5854996b8d32375fa0) (656B) (mode 100644) [raw]
CC = gcc
FILES = suite.c test_fixture_one.c test_fixture_two.c ../../../src/stic.c
OBJ = $(FILES:.c=.o)
OUT_EXE = example
CFLAGS = -I ../../../src

pos = $(strip $(eval T := ) \
              $(eval i := 0) \
              $(foreach elem, $1, \
                        $(if $(filter $2,$(elem)), \
                             $(eval i := $(words $T)), \
                             $(eval T := $T $(elem)))) \
              $i)

build: $(OBJ)
	$(CC) -o $(OUT_EXE) $^

%.o: %.c $(dir %.c)/.
	$(CC) -c $(CFLAGS) -o $@ -DTESTID=$(call pos, $(OBJ), $@) \
	                         -DMAXTESTID=$(words $(OBJ)) $<

clean:
	rm -f *.o core

rebuild: clean build
Hints

Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://code.reversed.top/user/xaizek/stic

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@code.reversed.top/user/xaizek/stic

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a pull request:
... clone the repository ...
... make some changes and some commits ...
git push origin master