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