Add test to see how many exceptions are during simple use

This commit is contained in:
Jason Turner 2015-08-01 12:44:22 -06:00
parent 913d2fd20f
commit 535055eff8

View File

@ -0,0 +1,32 @@
#include <chaiscript/chaiscript.hpp>
#include <chaiscript/chaiscript_stdlib.hpp>
#include <chaiscript/dispatchkit/bootstrap_stl.hpp>
#include <chaiscript/dispatchkit/function_call.hpp>
int main( int argc , char * argv[] )
{
chaiscript::ChaiScript ch( chaiscript::Std_Lib::library( ) );
static const char script[ ] =
R""(
class Rectangle
{
def Rectangle() { }
}
var rect = Rectangle( );
)"";
try
{
ch.eval( script );
}
catch ( std::exception e )
{
printf( " >>> Exception thrown: %s \n" , e.what( ) );
}
return 1;
}