summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDhaval Giani <dhaval@linux.vnet.ibm.com>2008-07-01 12:11:37 +0000
committerDhaval Giani <dhaval@linux.vnet.ibm.com>2008-07-01 12:11:37 +0000
commit544704815432d0c2fe49101fc745d89f33eb2f21 (patch)
tree2b54410e3eaa9981e9812ad1f6fe056b40b1af8a
parent9844a6d9ed88ca246f339e1c0699d8f5ea653cfb (diff)
downloadlibcg-544704815432d0c2fe49101fc745d89f33eb2f21.tar.gz
libcg-544704815432d0c2fe49101fc745d89f33eb2f21.tar.xz
libcg-544704815432d0c2fe49101fc745d89f33eb2f21.zip
From: Sudhir Kumar <skumar@linux.vnet.ibm.com>
libcgroup: framework for libcgroup testcases This Patch creates the basic infrastructure for libcgroup testcases. This patch adds a script which runs the binary(C) file. The script does all the environment setup to run the tests and passes this info to the C file through command line arguments. The binary runs the test cases calling the API's in different environment conditions. The Makefile compiles the test. The top level Makefile.in is edited to support make test make testclean The script runs this binary total 3 times, each time with diff varaible. FS_MOUNTED=0 # cgroup fs not mounted FS_MOUNTED=1 # cgroup fs mounted FS_MOUNTED=2 # cgroup fs mounted at multiple points 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@85 4f4bb910-9a46-0410-90c8-c897d4f1cd53
-rw-r--r--Makefile4
-rw-r--r--Makefile.in4
-rw-r--r--tests/Makefile9
3 files changed, 17 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index e37458f..44c0bb7 100644
--- a/Makefile
+++ b/Makefile
@@ -44,6 +44,9 @@ libcgroup.so: api.c libcgroup.h wrapper.c
wrapper.c
ln -sf $@ $@.$(VERSION)
+test:
+ $(MAKE) -C tests
+
install: libcgroup.so
$(INSTALL_DATA) -D libcgroup.h $(DESTDIR)$(includedir)/libcgroup.h
$(INSTALL) -D libcgroup.so $(DESTDIR)$(libdir)/libcgroup-$(PACKAGE_VERSION).so
@@ -59,3 +62,4 @@ uninstall: libcgroup.so
clean:
\rm -f y.tab.c y.tab.h lex.yy.c y.output cgconfig libcgroup.so \
libcgroup.so.$(VERSION)
+ $(MAKE) -C tests clean
diff --git a/Makefile.in b/Makefile.in
index 172b225..5bef04e 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -44,6 +44,9 @@ libcgroup.so: api.c libcgroup.h wrapper.c
wrapper.c
ln -sf $@ $@.$(VERSION)
+test:
+ $(MAKE) -C tests
+
install: libcgroup.so
$(INSTALL_DATA) -D libcgroup.h $(DESTDIR)$(includedir)/libcgroup.h
$(INSTALL) -D libcgroup.so $(DESTDIR)$(libdir)/libcgroup-$(PACKAGE_VERSION).so
@@ -59,3 +62,4 @@ uninstall: libcgroup.so
clean:
\rm -f y.tab.c y.tab.h lex.yy.c y.output cgconfig libcgroup.so \
libcgroup.so.$(VERSION)
+ $(MAKE) -C tests clean
diff --git a/tests/Makefile b/tests/Makefile
index 707302a..1c0bc58 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -3,6 +3,15 @@ LIBS = -lcgroup
INC = -I ..
CXXFLAGS = -g -O2 -Wall -DDEBUG $(INC)
+TARGET= libcgrouptest01 \
+ libcg_ba
+
+all: $(TARGET)
+
+
+libcgrouptest01: libcgrouptest01.c
+ $(CXX) $(CXXFLAGS) -o $@ $< $(LDFLAGS) $(LIBS)
+
libcg_ba: libcg_ba.cpp
$(CXX) $(CXXFLAGS) -o $@ $< $(LDFLAGS) $(LIBS)