Set atest result dir using gettempdir()

Instead of hard coding the result directory to /tmp/atest_result,
use python built in mechanism to lookup temporary path.

This makes it possible set a custom output path by setting an
environment variable, such as TMPDIR.
If TMPDIR is set, then create atest results in $TMPDIR/atest_result.
If not set, fallback to /tmp/atest_result.

On a system with multiple users, such as a shared build computer, the
default atest temporary directory (/tmp/atest_result) is created by the
first user running atest
The directory permissions may prevent other uses from accessing the
directory.

Bug: 313948300
Test: atest-dev hello_world_test
    confirm output folder
    export TMPDIR=/tmp/myfolder
    atest-dev hello_world_test
    confirm output folder
Change-Id: I93fa6106679eb2d995915fa9eb42eb89155ab764
1 file changed