Build gtest output paths correctly 87/23087/3
authorMats Wichmann <mats@linux.com>
Sun, 5 Nov 2017 16:08:49 +0000 (09:08 -0700)
committerMats Wichmann <mats@linux.com>
Wed, 8 Nov 2017 15:14:01 +0000 (15:14 +0000)
commit0d010e4b64ff853fefb6e55038e6ecaa072fc760
tree88821e8814bc63bdcfcab2f27e6f89a5daae927a
parent031a247de874890330cb1582a0db85425b6bd2b6
Build gtest output paths correctly

Currently, when the run_tests function is called twice from the
the same scons script (that is, the script has more than one unit
test binary to register), the GTEST_OUTPUT environment variable
becomes malformed.  This is because the string to add is added
to a list instead of just being appended as a string.  The result
is that while all the test output binaries are expected to go to
BUILD_DIR/test_out, in these cases they go deep down underneath
that directory.  Here are the unexpected paths in an unmodified
testing run:

out/linux/x86_64/debug/test_out/:xml:
out/linux/x86_64/debug/test_out/:xml:/home
out/linux/x86_64/debug/test_out/:xml:/home/mats
out/linux/x86_64/debug/test_out/:xml:/home/mats/iotivity.work
out/linux/x86_64/debug/test_out/:xml:/home/mats/iotivity.work/out
out/linux/x86_64/debug/test_out/:xml:/home/mats/iotivity.work/out/linux
out/linux/x86_64/debug/test_out/:xml:/home/mats/iotivity.work/out/linux/x86_64
out/linux/x86_64/debug/test_out/:xml:/home/mats/iotivity.work/out/linux/x86_64/debug
out/linux/x86_64/debug/test_out/:xml:/home/mats/iotivity.work/out/linux/x86_64/debug/test_out
out/linux/x86_64/debug/test_out/:xml:/home/mats/iotivity.work/out/linux/x86_64/debug/test_out/unittest.xml
out/linux/x86_64/debug/test_out/:xml:/home/mats/iotivity.work/out/linux/x86_64/debug/test_out/stacktests.xml
out/linux/x86_64/debug/test_out/:xml:/home/mats/iotivity.work/out/linux/x86_64/debug/test_out/cbortests.xml
out/linux/x86_64/debug/test_out/:xml:/home/mats/iotivity.work/out/linux/x86_64/debug/test_out/provisiontests.xml

The :xml: is intended as a tag used to signal gtest, it is never
supposed to be part of the real filesystem path.

Note fix was already proposed as part of
https://gerrit.iotivity.org/gerrit/#/c/22275/ but since it's a
distinct error with a very simple fix, wanted to get it pushed
through by itself while that one is under consideration.

Change-Id: I05c57d54034686a7c77c783eab758e7f501e86ea
Signed-off-by: Mats Wichmann <mats@linux.com>
tools/scons/RunTest.py