mirror of
https://github.com/ChaiScript/ChaiScript.git
synced 2026-02-07 18:26:49 +08:00
Warn against environmental variables not set in test.
This commit is contained in:
parent
903454bf05
commit
7a54464a8b
@ -48,15 +48,25 @@ int main()
|
|||||||
const char *usepath = getenv("CHAI_USE_PATH");
|
const char *usepath = getenv("CHAI_USE_PATH");
|
||||||
const char *modulepath = getenv("CHAI_MODULE_PATH");
|
const char *modulepath = getenv("CHAI_MODULE_PATH");
|
||||||
|
|
||||||
|
if(usepath == nullptr)
|
||||||
|
{
|
||||||
|
std::cout << "Warning: usepath not set!\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
if(modulepath == nullptr)
|
||||||
|
{
|
||||||
|
std::cout << "Warning: modulepath not set!\n";
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef CHAISCRIPT_MSVC
|
#ifdef CHAISCRIPT_MSVC
|
||||||
#pragma warning(pop)
|
#pragma warning(pop)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
std::vector<std::string> usepaths;
|
std::vector<std::string> usepaths;
|
||||||
usepaths.push_back("");
|
usepaths.emplace_back("");
|
||||||
if (usepath)
|
if (usepath)
|
||||||
{
|
{
|
||||||
usepaths.push_back(usepath);
|
usepaths.emplace_back(usepath);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<std::string> modulepaths;
|
std::vector<std::string> modulepaths;
|
||||||
@ -64,10 +74,10 @@ int main()
|
|||||||
#ifdef CHAISCRIPT_NO_DYNLOAD
|
#ifdef CHAISCRIPT_NO_DYNLOAD
|
||||||
chaiscript::ChaiScript chai(/* unused */modulepaths, usepaths);
|
chaiscript::ChaiScript chai(/* unused */modulepaths, usepaths);
|
||||||
#else
|
#else
|
||||||
modulepaths.push_back("");
|
modulepaths.emplace_back("");
|
||||||
if (modulepath)
|
if (modulepath)
|
||||||
{
|
{
|
||||||
modulepaths.push_back(modulepath);
|
modulepaths.emplace_back(modulepath);
|
||||||
}
|
}
|
||||||
|
|
||||||
// For this test we are going to load the dynamic stdlib
|
// For this test we are going to load the dynamic stdlib
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user