Updated Makefiles and CMakeLists.txt to point to resource, not oic-resource
[platform/upstream/iotivity.git] / resource / csdk / stack / test / README
1 stacktests.cpp is a unit test of the APIs in ocstack.c.  
2 It uses Google Test for the unit tests.  Note that
3 the unit tests are only to test the functionality of
4 ocstack.c.  It is not a system or end-to-end test.
5
6 Unit Test Requirements:
7
8 1. Install Google Test on a Linux build machine
9 2. Create a file called "local.properties" in the 
10    root/csdk/stack/test.  local.properties is used
11    by the makefile and specifies the path to the 
12    Google Test directory on the build machine.
13    Since local.properties is specific to each build
14    system, do not add local.properties to the code repo.
15
16    local.properties should contain GTEST_DIR.
17    For example:
18    
19
20    GTEST_DIR := /home/johndoe/utils/gtest-1.7.0
21
22 3. The unit test assumes that the "eth0" interface is
23    available.  If not, the unit tests will FAIL.
24 4. To run the unit test, first build the C OCStack.
25    At the time of this writing this was done by running
26    
27    root/csdk/make deepclean
28    root/csdk/make BUILD=release    *default
29    root/csdk/make BUILD=debug
30
31 5. Next, build the ocstack
32    root/csdk/stack/test/make clean
33    root/csdk/stack/test/make BUILD=release    *default
34    root/csdk/stack/test/make BUILD=debug
35
36 6. Run the unit test by
37    root/csdk/stack/test/release/stacktests
38    root/csdk/stack/test/debug/stacktests
39