diff options
author | Reid Kleckner <reid@kleckner.net> | 2013-04-30 04:30:41 +0000 |
---|---|---|
committer | Reid Kleckner <reid@kleckner.net> | 2013-04-30 04:30:41 +0000 |
commit | 95012aaa9371fe1b6dd95749753d75eb6ed1ac20 (patch) | |
tree | 1bca8e6241d7b2aa20b905ba0cfc5d4c5d81cce3 /llvm/utils/unittest/UnitTestMain/TestMain.cpp | |
parent | 02078464e15c3f020b19696e220e5b395ccbd4c3 (diff) | |
download | llvm-95012aaa9371fe1b6dd95749753d75eb6ed1ac20.zip llvm-95012aaa9371fe1b6dd95749753d75eb6ed1ac20.tar.gz llvm-95012aaa9371fe1b6dd95749753d75eb6ed1ac20.tar.bz2 |
Try to fix ProgramTest on FreeBSD
This seemed like the cleanest way to find the test executable. Also fix
the file mode.
llvm-svn: 180770
Diffstat (limited to 'llvm/utils/unittest/UnitTestMain/TestMain.cpp')
-rw-r--r-- | llvm/utils/unittest/UnitTestMain/TestMain.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/utils/unittest/UnitTestMain/TestMain.cpp b/llvm/utils/unittest/UnitTestMain/TestMain.cpp index ce32b73..5387512 100644 --- a/llvm/utils/unittest/UnitTestMain/TestMain.cpp +++ b/llvm/utils/unittest/UnitTestMain/TestMain.cpp @@ -20,11 +20,16 @@ # endif #endif +const char *TestMainArgv0; + int main(int argc, char **argv) { llvm::sys::PrintStackTraceOnErrorSignal(); testing::InitGoogleTest(&argc, argv); llvm::cl::ParseCommandLineOptions(argc, argv); + // Make it easy for a test to re-execute itself by saving argv[0]. + TestMainArgv0 = argv[0]; + # if defined(LLVM_ON_WIN32) // Disable all of the possible ways Windows conspires to make automated // testing impossible. |