diff --git a/indra/llplugin/slplugin/slplugin.cpp b/indra/llplugin/slplugin/slplugin.cpp index 7b894c457..e220ec6f8 100644 --- a/indra/llplugin/slplugin/slplugin.cpp +++ b/indra/llplugin/slplugin/slplugin.cpp @@ -174,6 +174,8 @@ bool checkExceptionHandler() } #endif +bool self_test = false; + // If this application on Windows platform is a console application, a console is always // created which is bad. Making it a Windows "application" via CMake settings but not // adding any code to explicitly create windows does the right thing. @@ -220,22 +222,30 @@ int main(int argc, char **argv) LL_ERRS("slplugin") << "usage: " << argv[0] << " launcher_port" << LL_ENDL; } - U32 port = 0; - if(!LLStringUtil::convertToU32(argv[1], port)) + U32 port = 61916; // Test port. + if (strcmp(argv[1], "TESTPLUGIN") == 0) + { + std::cout << "Running self test..." << std::endl; + self_test = true; + } + else if (!LLStringUtil::convertToU32(argv[1], port)) { LL_ERRS("slplugin") << "port number must be numeric" << LL_ENDL; } - // Catch signals that most kinds of crashes will generate, and exit cleanly so the system crash dialog isn't shown. - signal(SIGILL, &crash_handler); // illegal instruction + if (!self_test) + { + // Catch signals that most kinds of crashes will generate, and exit cleanly so the system crash dialog isn't shown. + signal(SIGILL, &crash_handler); // illegal instruction # if LL_DARWIN - signal(SIGEMT, &crash_handler); // emulate instruction executed + signal(SIGEMT, &crash_handler); // emulate instruction executed # endif // LL_DARWIN - signal(SIGFPE, &crash_handler); // floating-point exception - signal(SIGBUS, &crash_handler); // bus error - signal(SIGSEGV, &crash_handler); // segmentation violation - signal(SIGSYS, &crash_handler); // non-existent system call invoked + signal(SIGFPE, &crash_handler); // floating-point exception + signal(SIGBUS, &crash_handler); // bus error + signal(SIGSEGV, &crash_handler); // segmentation violation + signal(SIGSYS, &crash_handler); // non-existent system call invoked #endif + } #if LL_DARWIN setupCocoa(); @@ -247,7 +257,7 @@ int main(int argc, char **argv) plugin->init(port); #if LL_DARWIN - deleteAutoReleasePool(); + deleteAutoReleasePool(); #endif LLTimer timer; diff --git a/indra/newview/linux_tools/wrapper.sh b/indra/newview/linux_tools/wrapper.sh index d6a266240..6bd4acf33 100755 --- a/indra/newview/linux_tools/wrapper.sh +++ b/indra/newview/linux_tools/wrapper.sh @@ -148,7 +148,13 @@ else SL_ENV+='LD_LIBRARY_PATH="`pwd`/lib:$LD_LIBRARY_PATH"' fi export SL_CMD='$LL_WRAPPER bin/$VIEWER_BINARY' -export SL_OPT="`cat gridargs.dat` $@" + +if [ -n "$AITESTPLUGIN" ]; then + SL_CMD="$LL_WRAPPER bin/SLPlugin" + SL_OPT="TESTPLUGIN" +else + SL_OPT="`cat gridargs.dat` $@" +fi # Run the program. eval ${SL_ENV} ${SL_CMD} ${SL_OPT} || LL_RUN_ERR=runerr