xaizek / stic (License: MIT) (since 2018-12-07)
Simple Tests In C with optional automatic test registration in C.
<root> / Makefile.in (f5ebcf1c5c5956c106e832eaea7b2da952b8e062) (1,012B) (mode 100644) [raw]
CFLAGS = @CFLAGS@ @DEFS@ -DSTIC_INTERNAL_TESTS
CC = @CC@
MKDIR_P = @MKDIR_P@

STIC_TESTS = src/stic.c tests/stic_tests.c
STIC_TESTS_OBJ = $(addprefix bin/,$(notdir $(STIC_TESTS:.c=.o)))

RM_F = rm -f

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

all: clean stic_tests

stic_tests: bin/stic_tests
	@./$<

bin/stic_tests: $(STIC_TESTS_OBJ) | bin
	$(CC) $^ $(CFLAGS) -o bin/stic_tests

bin:
	$(MKDIR_P) $@

bin/%.o: src/%.c tests/. | bin
	$(CC) -c $(CFLAGS) -o $@ -DTESTID=$(call pos, $(STIC_TESTS_OBJ), $@) \
	                         -DMAXTESTID=$(words $(STIC_TESTS_OBJ)) $<

bin/%.o: tests/%.c tests/. | bin
	$(CC) -c $(CFLAGS) -o $@ -DTESTID=$(call pos, $(STIC_TESTS_OBJ), $@) \
	                         -DMAXTESTID=$(words $(STIC_TESTS_OBJ)) $<

clean:
	$(RM_F) bin/*.o
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