mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-10-14 01:55:46 +00:00
Added C and check library version
This commit is contained in:
1 parent
e916fdd8ac
commit
96d9751300
9 files changed
+195
No files matched your search
@@ -0,0 +1,46 @@
|
||||
# Makefile for building the kata file with the Google Testing Framework
|
||||
#
|
||||
# SYNOPSIS:
|
||||
#
|
||||
# make [all] - makes everything, runs tests
|
||||
# make TARGET - makes the given target.
|
||||
# make clean - removes all files generated by make.
|
||||
# make memtest - run memory leak analysis
|
||||
|
||||
# The _POSIX_C_SOURCE definition prevents the compiler from throwing warnings
|
||||
CFLAGS = `pkg-config --cflags check` -g --std=c99 -D_POSIX_C_SOURCE=200809L
|
||||
LIBS = `pkg-config --libs check`
|
||||
|
||||
# All files that should be part of your test should start with 'test'
|
||||
TEST_SRC = `ls test*.[c\|h]`
|
||||
TEST_BASE = $(basename ${TEST_SRC})
|
||||
TEST_OBJECTS = $(addsuffix .o, ${TEST_BASE})
|
||||
|
||||
# If you add more implementation classes, add them to this variable
|
||||
OBJECT_UNDER_TEST = GildedRose.o
|
||||
|
||||
# This is the test application. You can run this program to see your test output
|
||||
TEST_APP = test_gildedrose
|
||||
|
||||
|
||||
# This will generate output for several products over a course of several days.
|
||||
# You can run this application to build golden rule tests
|
||||
GOLDEN_APP = golden_rose
|
||||
|
||||
all: ${TEST_APP} ${GOLDEN_APP}
|
||||
./${TEST_APP}
|
||||
|
||||
${TEST_APP}: ${TEST_OBJECTS} ${OBJECT_UNDER_TEST}
|
||||
$(CC) $(CFLAGS) -o $@ $^ $(LIBS)
|
||||
|
||||
${GOLDEN_APP}: GildedRoseTextTests.o ${OBJECT_UNDER_TEST}
|
||||
$(CC) $(CFLAGS) -o $@ $^
|
||||
|
||||
# If you're not on a mac, you should run memtest (in fact, consider adding it to the 'all' target).
|
||||
# If you're on a mac, complain to apple for breaking an important development tool.
|
||||
memtest: ${TEST_APP}
|
||||
valgrind --leak-check=full --error-exitcode=1 ./${TEST_APP} --nofork
|
||||
|
||||
clean:
|
||||
rm -f *.o
|
||||
rm -f ${TEST_APP}
|
||||
Reference in new issue
Block a user