summaryrefslogtreecommitdiffstats
path: root/runtime/common_runtime_test.h
diff options
context:
space:
mode:
authorNicolas Geoffray <ngeoffray@google.com>2014-02-28 15:21:07 +0000
committerNicolas Geoffray <ngeoffray@google.com>2014-03-04 16:30:48 +0000
commit9583fbcf597eff6d0b3c5359b8e8d5f70ed82c40 (patch)
tree847912709f811adda0fa63e89e4bf8af27769f2e /runtime/common_runtime_test.h
parent093aad184b4451639951a7e012d9b55cbf8c8a07 (diff)
downloadart-9583fbcf597eff6d0b3c5359b8e8d5f70ed82c40.zip
art-9583fbcf597eff6d0b3c5359b8e8d5f70ed82c40.tar.gz
art-9583fbcf597eff6d0b3c5359b8e8d5f70ed82c40.tar.bz2
Remove oat file location in the image.
The oat file is now always in the same directory, and has the same name as the image file. Only difference is the extension. This also removes the need for host-prefix. Change-Id: I16d1f7aeb1d58372d41921694664e9c321afc1ad
Diffstat (limited to 'runtime/common_runtime_test.h')
-rw-r--r--runtime/common_runtime_test.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/runtime/common_runtime_test.h b/runtime/common_runtime_test.h
index e2ecf4b..cef0703 100644
--- a/runtime/common_runtime_test.h
+++ b/runtime/common_runtime_test.h
@@ -19,6 +19,7 @@
#include <dirent.h>
#include <dlfcn.h>
+#include <stdlib.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <sys/types.h>
@@ -63,6 +64,14 @@ class ScratchFile {
file_.reset(new File(fd, GetFilename()));
}
+ ScratchFile(const ScratchFile& other, const char* suffix) {
+ filename_ = other.GetFilename();
+ filename_ += suffix;
+ int fd = open(filename_.c_str(), O_RDWR | O_CREAT, 0666);
+ CHECK_NE(-1, fd);
+ file_.reset(new File(fd, GetFilename()));
+ }
+
~ScratchFile() {
int unlink_result = unlink(filename_.c_str());
CHECK_EQ(0, unlink_result);