summaryrefslogtreecommitdiffstats
path: root/tests/Makefile
diff options
context:
space:
mode:
authorDhaval Giani <dhaval@linux.vnet.ibm.com>2009-01-09 16:23:01 +0000
committerDhaval Giani <dhaval@linux.vnet.ibm.com>2009-01-09 16:23:01 +0000
commit8b53bf5107f1e7540e91972b2bebf8484fa43fa5 (patch)
tree95a965d946d10877ad40494d640fcdf5931c34bd /tests/Makefile
parenta6fd09eca79d1626bba110fb2dc77c00a8eddf24 (diff)
downloadlibcg-8b53bf5107f1e7540e91972b2bebf8484fa43fa5.tar.gz
libcg-8b53bf5107f1e7540e91972b2bebf8484fa43fa5.tar.xz
libcg-8b53bf5107f1e7540e91972b2bebf8484fa43fa5.zip
libcgrouptest: Move functions into a new file to reuse
From: Sudhir Kumar <skumar@linux.vnet.ibm.com> There were some coding style warnings that have been fixed in this patch. Basicaly the ones reported by checkpatch.pl This patch puts the test functions in a separate file so that they can be reused for further testing. Some of the functions were static and hence changed to be non static. It also edits the Makefile so that the patch compiles. Signed-off-by: Sudhir Kumar <skumar@linux.vnet.ibm.com> Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com> git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@309 4f4bb910-9a46-0410-90c8-c897d4f1cd53
Diffstat (limited to 'tests/Makefile')
-rw-r--r--tests/Makefile19
1 files changed, 13 insertions, 6 deletions
diff --git a/tests/Makefile b/tests/Makefile
index 5c602cb..00bfe3d 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -1,18 +1,25 @@
-LDFLAGS = -L ..
-LIBS = -lcgroup -lpthread
+LDFLAGS = -L .. -L.
+LIBS = -lcgroup -lpthread -ltest_functions
INC = -I ..
CXXFLAGS = -g -O2 -Wall -DDEBUG $(INC)
CFLAGS = -g -O2 -Wall -DDEBUG
-TARGET= libcgrouptest01 \
+TARGET= libtest_functions.a \
+ libcgrouptest01 \
libcg_ba \
setuid \
pathtest
all: $(TARGET)
-libcgrouptest01: libcgrouptest01.c
- $(CXX) $(CXXFLAGS) -o $@ $< $(LDFLAGS) $(LIBS)
+test_functions.o: test_functions.c
+ $(CXX) $(CXXFLAGS) -c $<
+
+libtest_functions.a: test_functions.o
+ $(AR) -cr $@ $^
+
+libcgrouptest01: test_functions.o libcgrouptest01.c
+ $(CXX) $(CXXFLAGS) -o $@ libcgrouptest01.c $(LDFLAGS) $(LIBS)
libcg_ba: libcg_ba.cpp
$(CXX) $(CXXFLAGS) -o $@ $< $(LDFLAGS) $(LIBS)
@@ -24,4 +31,4 @@ pathtest: pathtest.c
$(CC) $(CFLAGS) -o $@ $< $(LDFLAGS) $(LIBS)
clean:
- \rm -f $(TARGET)
+ \rm -f $(TARGET) test_functions.o