[IOT-980] oic.if.ll support for /oic/res
[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
42 4. To run the unit test, first build the C OCStack.
43    At the time of this writing this was done by running
44
45    scons -c resource/csdk/
46    scons resource/csdk/ RELEASE=1  //*default
47    scons resource/csdk/ RELEASE=0
48
49 5. Next, build the ocstack
50    scons -c resource/csdk/stack/test
51    scons resource/csdk/stack/test RELEASE=1  //*default
52    scons resource/csdk/stack/test RELEASE=0
53
54 6. Export LD_LIBRARY_PATH before running the unit tests.
55    Example:
56    export LD_LIBRARY_PATH=/home/tester/Documents/iotivity/extlibs/gtest/gtest-1.7.0/lib/.libs/
57
58 7. Run the unit test by issuing the following command from root 'iotivity' folder
59    ./out/<TARGET_OS>/<TARGET_ARCH>/<release/debug>/resource/csdk/stack/test
60    Example: ./out/linux/x86/release/resource/csdk/stack/test/stacktests
61