language-extensions/R/test/src/RExtensionLibraryApiTests.cpp
//----------------------------------------------------------------------------------------------
// Name: InstallPrivatePublic
//
// Description:
//  Installs package to private and makes sure its loaded from private path.
//  Then installs to public path without uninstalling from private.
//  This time again makes sure it is loaded from private path since private takes precendence
//  over public.
//
InstallPrivatePublic
Description:
Installs package to private and makes sure its loaded from private path.
Then installs to public path without uninstalling from private.
This time again makes sure it is loaded from private path since private takes precendence
over public.
InstallPrivatePublic Description : Installs package to private and makes sure its loaded from private path . Then installs to public path without uninstalling from private . This time again makes sure it is loaded from private path since private takes precendence over public .
TEST_F(RExtensionLibraryApiTests, InstallPrivatePublic)
	{
		string libName = "lazyeval";
		string privateVersion = "0.2.1";
		string zipFileName =
			sm_PrivateDbIdUserIdPrefix + libName + "_" + privateVersion + x_FileExtension;
		fs::path pkgPath;
		pkgPath = sm_packagesSourcePath / x_OsName / zipFileName;
		EXPECT_TRUE(fs::exists(pkgPath));
		InstallAndTest(
			libName,
			pkgPath.string(),
			sm_privateLibraryPath,  USE PRIVATE LIB PATH
			privateVersion,
			sm_privateLibraryPath);  Expected Location
		 Install same package in different context
		 We install this package into the PUBLIC scope, but since we have already
		 installed a package into PRIVATE,
		 we should still be loading PRIVATE over PUBLIC.
		string publicVersion = "0.2.2";
		zipFileName = sm_PublicDbIdUserIdPrefix + libName + "_" + publicVersion + x_FileExtension;
		pkgPath = sm_packagesSourcePath / x_OsName / zipFileName;
		InstallAndTest(
			libName,
			pkgPath.string(),
			sm_publicLibraryPath,    install to the public path
			privateVersion,          expected version
			sm_privateLibraryPath);  expected location
		 Uninstall private then public, make sure we at least get the public after
		 uninstalling private.
		UninstallAndTest(
			libName,
			sm_privateLibraryPath,
			true);  otherInstallationExists
		UninstallAndTest(
			libName,
			sm_publicLibraryPath,
			false);
	}
TEST_F ( RExtensionLibraryApiTests , InstallPrivatePublic ) { string libName = " " ; string privateVersion = " " ; string zipFileName = sm_PrivateDbIdUserIdPrefix + libName + " " + privateVersion + x_FileExtension ; fs :: path pkgPath ; pkgPath = sm_packagesSourcePath / x_OsName / zipFileName ; EXPECT_TRUE ( fs :: exists ( pkgPath ) ) ; InstallAndTest ( libName , pkgPath . string ( ) , sm_privateLibraryPath , privateVersion , sm_privateLibraryPath ) ; string publicVersion = " " ; zipFileName = sm_PublicDbIdUserIdPrefix + libName + " " + publicVersion + x_FileExtension ; pkgPath = sm_packagesSourcePath / x_OsName / zipFileName ; InstallAndTest ( libName , pkgPath . string ( ) , sm_publicLibraryPath , privateVersion , sm_privateLibraryPath ) ; UninstallAndTest ( libName , sm_privateLibraryPath , true ) ; UninstallAndTest ( libName , sm_publicLibraryPath , false ) ; }
Name: InstallPrivatePublic
Description:
Installs package to private and makes sure its loaded from private path.
Name : InstallPrivatePublic Description : Installs package to private and makes sure its loaded from private path .
// First install in private path // // USE PRIVATE LIB PATH // Expected Location // Install same package in different context // We install this package into the PUBLIC scope, but since we have already // installed a package into PRIVATE, // we should still be loading PRIVATE over PUBLIC. // // install to the public path // expected version // expected location // Uninstall private then public, make sure we at least get the public after // uninstalling private. // // otherInstallationExists