Check duplicate issues.
Description
Cling does not provide a way to programmatically check for a compilation failure, see the reproducer. I tried ProcessLine, Calc and Evaluate but no API works. Run the reproducer below with any of the three functions I see the assertion being triggered.
Expected behaviour
There should be a way to query the interpreter to know whether the last compilation was successful or failed.
Reproducer
#include <TInterpreter.h>
#include <cassert>
void processline(){
TInterpreter::EErrorCode error = TInterpreter::kNoError;
gInterpreter->ProcessLine("rndm_stuff", &error);
assert(error != TInterpreter::kNoError);
}
void calc(){
TInterpreter::EErrorCode error = TInterpreter::kNoError;
gInterpreter->Calc("rndm_stuff", &error);
assert(error != TInterpreter::kNoError);
}
void evaluate(){
std::unique_ptr<TInterpreterValue> v = gInterpreter->MakeInterpreterValue();
auto ret = gInterpreter->Evaluate("rndm_stuff", *v);
assert(ret == 0);
}
int main(){
processline();
calc();
evaluate();
}
ROOT version
master
Installation method
Build from source
Operating system
MacOS
Additional context
No response
Check duplicate issues.
Description
Cling does not provide a way to programmatically check for a compilation failure, see the reproducer. I tried
ProcessLine,CalcandEvaluatebut no API works. Run the reproducer below with any of the three functions I see the assertion being triggered.Expected behaviour
There should be a way to query the interpreter to know whether the last compilation was successful or failed.
Reproducer
ROOT version
master
Installation method
Build from source
Operating system
MacOS
Additional context
No response