• Mats Wichmann's avatar
    Build gtest output paths correctly · a4e14b93
    Mats Wichmann authored
    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: default avatarMats Wichmann <mats@linux.com>
    (cherry picked from commit 0d010e4b)
    a4e14b93
RunTest.py 4.88 KB