about summary refs log tree commit diff stats
path: root/Makefile
diff options
context:
space:
mode:
authorDaniel Santos <dacs.git@brilhante.top>2022-03-15 13:36:40 +0000
committerDaniel Santos <dacs.git@brilhante.top>2022-03-15 14:34:39 +0000
commitb559d657c3cde5cd4d2475b3a0935a7236ef41d2 (patch)
tree314790276f4ee244502b7e9b9742bc92ca3805ef /Makefile
parentad3f14edbd227b7006a679a21b6514b0ac53913a (diff)
downloadnumericx-c-b559d657c3cde5cd4d2475b3a0935a7236ef41d2.tar.gz
test rule in Makefile
 * add tests/earth.sh
 * add to Makefile all the necessary rules for `make test`

Signed-off-by: Daniel Santos <dacs.git@brilhante.top>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile44
1 files changed, 44 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index d95ed99..e521021 100644
--- a/Makefile
+++ b/Makefile
@@ -65,3 +65,47 @@ run: decimal-to-earth
 mem: decimal-to-earth
 	valgrind --leak-check=full --show-leak-kinds=all -s decimal-to-earth 999
 
+
+decimal-to-earth_test-1: $(DEP)
+	$(CC) $(CFLAGS) -DFROM_NUMERICALS=\"0123456789\" -DFROM_FIRST_NUMBER_VOID -DFROM_INFINITE_BASE -DTO_NUMERICALS=\"12345\" -o $@ $^
+
+earth-to-decimal_test-1: $(DEP)
+	$(CC) $(CFLAGS) -DFROM_NUMERICALS=\"12345\" -DTO_NUMERICALS=\"0123456789\" -DTO_FIRST_NUMBER_VOID -DTO_INFINITE_BASE -o $@ $^
+
+decimal-to-earth_test-2: $(DEP)
+	$(CC) $(CFLAGS) -DFROM_NUMERICALS=\"0123456789\" -DFROM_FIRST_NUMBER_VOID -DFROM_INFINITE_BASE -DTO_NUMERICALS=\"12345\" -DFROM_UNITS_ON_THE_END -o $@ $^
+
+earth-to-decimal_test-2: $(DEP)
+	$(CC) $(CFLAGS) -DFROM_NUMERICALS=\"12345\" -DTO_NUMERICALS=\"0123456789\" -DTO_FIRST_NUMBER_VOID -DTO_INFINITE_BASE -DTO_UNITS_ON_THE_END -o $@ $^
+
+decimal-to-earth_test-3: $(DEP)
+	$(CC) $(CFLAGS) -DFROM_NUMERICALS=\"0123456789\" -DFROM_FIRST_NUMBER_VOID -DFROM_INFINITE_BASE -DTO_NUMERICALS=\"12345\" -DTO_UNITS_ON_THE_END -o $@ $^
+
+earth-to-decimal_test-3: $(DEP)
+	$(CC) $(CFLAGS) -DFROM_NUMERICALS=\"12345\" -DTO_NUMERICALS=\"0123456789\" -DTO_FIRST_NUMBER_VOID -DTO_INFINITE_BASE -DFROM_UNITS_ON_THE_END -o $@ $^
+
+decimal-to-earth_test-4: $(DEP)
+	$(CC) $(CFLAGS) -DFROM_NUMERICALS=\"0123456789\" -DFROM_FIRST_NUMBER_VOID -DFROM_INFINITE_BASE -DTO_NUMERICALS=\"12345\" -DFROM_UNITS_ON_THE_END -DTO_UNITS_ON_THE_END -o $@ $^
+
+earth-to-decimal_test-4: $(DEP)
+	$(CC) $(CFLAGS) -DFROM_NUMERICALS=\"12345\" -DTO_NUMERICALS=\"0123456789\" -DTO_FIRST_NUMBER_VOID -DTO_INFINITE_BASE -DFROM_UNITS_ON_THE_END -DTO_UNITS_ON_THE_END -o $@ $^
+
+decimal-to-earth_test-5: $(DEP)
+	$(CC) $(CFLAGS) -DFROM_NUMERICALS=\"0123456789\" -DFROM_FIRST_NUMBER_VOID -DFROM_INFINITE_BASE -DTO_NUMERICALS=\"12345\" -DTO_FIRST_NUMBER_VOID -o $@ $^
+
+earth-to-decimal_test-5: $(DEP)
+	$(CC) $(CFLAGS) -DFROM_NUMERICALS=\"12345\" -DTO_NUMERICALS=\"0123456789\" -DTO_FIRST_NUMBER_VOID -DTO_INFINITE_BASE -DFROM_FIRST_NUMBER_VOID -o $@ $^
+
+decimal-to-earth_test-6: $(DEP)
+	$(CC) $(CFLAGS) -DFROM_NUMERICALS=\"0123456789\" -DFROM_FIRST_NUMBER_VOID -DFROM_INFINITE_BASE -DTO_NUMERICALS=\"12345\" -DTO_INFINITE_BASE -o $@ $^
+
+earth-to-decimal_test-6: $(DEP)
+	$(CC) $(CFLAGS) -DFROM_NUMERICALS=\"12345\" -DTO_NUMERICALS=\"0123456789\" -DTO_FIRST_NUMBER_VOID -DTO_INFINITE_BASE -DFROM_INFINITE_BASE -o $@ $^
+
+
+.PHONY: build-tests
+build-tests: decimal-to-earth_test-1 earth-to-decimal_test-1 decimal-to-earth_test-2 earth-to-decimal_test-2 decimal-to-earth_test-3 earth-to-decimal_test-3 decimal-to-earth_test-4 earth-to-decimal_test-4 decimal-to-earth_test-5 earth-to-decimal_test-5 decimal-to-earth_test-6 earth-to-decimal_test-6
+
+.PHONY: test
+test:
+	tests/earth.sh