language-extensions/R/test/src/RExtensionLibraryApiTests.cpp
//----------------------------------------------------------------------------------------------
// Name: RExtensionLibraryApiTests::DetachLibrary
//
// Description:
//  Removes the library from the search path and unload it from the session.
//  This is needed so that for consecutive install and load tests
//  without uninstalling in between. Library and package are synonyms and refer
//  to the same object.
//
:DetachLibrary
Description:
Removes the library from the search path and unload it from the session.
This is needed so that for consecutive install and load tests
without uninstalling in between. Library and package are synonyms and refer
to the same object.
: DetachLibrary Description : Removes the library from the search path and unload it from the session . This is needed so that for consecutive install and load tests without uninstalling in between . Library and package are synonyms and refer to the same object .
void RExtensionLibraryApiTests::DetachLibrary(string extLibName)
	{
		try
		{
			string detachScript = "detach(package:" + extLibName + " , unload = TRUE);";
			sm_executeScriptFuncPtr(detachScript);
		}
		catch (...)
		{
			cout << "Failed to detach library." << endl;
		}
	}
void RExtensionLibraryApiTests :: DetachLibrary ( string extLibName ) { try { string detachScript = " " + extLibName + " " ; sm_executeScriptFuncPtr ( detachScript ) ; } catch ( ... ) { cout << " " << endl ; } }
Name: RExtensionLibraryApiTests::DetachLibrary
Description:
Removes the library from the search path and unload it from the session.
Name : RExtensionLibraryApiTests :: DetachLibrary Description : Removes the library from the search path and unload it from the session .
// Detaching the package is best effort // This may fail if the package is not successfully loaded. // We ignore such failures and move on since we test // unsuccessful load scenarios as well. //