1 //---------------------------------------------------------------------
2 // NOTICE - Transition to SCONS
3 //---------------------------------------------------------------------
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.
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
15 //---------------------------------------------------------------------
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.
22 Unit Test Requirements:
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.
32 local.properties should contain GTEST_DIR.
36 GTEST_DIR := /home/johndoe/utils/gtest-1.7.0
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
44 root/csdk/make deepclean
45 root/csdk/make BUILD=release *default
46 root/csdk/make BUILD=debug
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
53 6. Run the unit test by
54 root/csdk/stack/test/release/stacktests
55 root/csdk/stack/test/debug/stacktests