Revert "Change build option - IP only"
[platform/upstream/iotivity.git] / resource / csdk / stack / test / README
1 //---------------------------------------------------------------------
2 //  NOTICE - Transition to SCONS
3 //---------------------------------------------------------------------
4
5 The IoTivity build system is transitioning to SCONS. Although the
6 makefiles are still available (until v1.0) and some developers are
7 still using them, they are currently no longer supported. To learn more
8 about building using SCONS see Readme.scons.txt in the repository root
9 directory. The build steps used in continuous integration can be found
10 in auto_build.sh which is also in the the repository root directory.
11
12 To dynamically link with the Google Unit test library,
13 add <src_dir>/extlibs/gtest/gtest-1.7.0/lib/.libs/ to LD_LIBRARY_PATH
14
15 //---------------------------------------------------------------------
16
17 stacktests.cpp is a unit test of the APIs in ocstack.c.
18 It uses Google Test for the unit tests.  Note that
19 the unit tests are only to test the functionality of
20 ocstack.c.  It is not a system or end-to-end test.
21
22 Unit Test Requirements:
23
24 1. Install Google Test on a Linux build machine
25 2. Create a file called "local.properties" in the
26    root/csdk/stack/test.  local.properties is used
27    by the makefile and specifies the path to the
28    Google Test directory on the build machine.
29    Since local.properties is specific to each build
30    system, do not add local.properties to the code repo.
31
32    local.properties should contain GTEST_DIR.
33    For example:
34
35
36    GTEST_DIR := /home/johndoe/utils/gtest-1.7.0
37
38 3. The unit test assumes that a network interface is available
39    (e.g. "eth0", "wlan0", etc.)
40    If no interface is available, the unit tests will FAIL.
41 4. To run the unit test, first build the C OCStack.
42    At the time of this writing this was done by running
43
44    root/csdk/make deepclean
45    root/csdk/make BUILD=release    *default
46    root/csdk/make BUILD=debug
47
48 5. Next, build the ocstack
49    root/csdk/stack/test/make clean
50    root/csdk/stack/test/make BUILD=release    *default
51    root/csdk/stack/test/make BUILD=debug
52
53 6. Run the unit test by
54    root/csdk/stack/test/release/stacktests
55    root/csdk/stack/test/debug/stacktests
56
57