diff options
author | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2012-09-08 23:26:39 (GMT) |
---|---|---|
committer | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2012-09-08 23:26:39 (GMT) |
commit | aa6c3a1257a29cc5bcf8b94893732ee553f27582 (patch) | |
tree | 625adb1a353a17ffed2c7e0bac686d705aaec93f /test/src/test-ecmascript-v8.cpp | |
download | uscxml-aa6c3a1257a29cc5bcf8b94893732ee553f27582.zip uscxml-aa6c3a1257a29cc5bcf8b94893732ee553f27582.tar.gz uscxml-aa6c3a1257a29cc5bcf8b94893732ee553f27582.tar.bz2 |
Initial upload
Still somewhat quirky to build but fairly feature complete
Diffstat (limited to 'test/src/test-ecmascript-v8.cpp')
-rw-r--r-- | test/src/test-ecmascript-v8.cpp | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/test/src/test-ecmascript-v8.cpp b/test/src/test-ecmascript-v8.cpp new file mode 100644 index 0000000..d0b69ba --- /dev/null +++ b/test/src/test-ecmascript-v8.cpp @@ -0,0 +1,44 @@ +#include "uscxml/Interpreter.h" +#include "uscxml/datamodel/ecmascript/v8/V8DataModel.h" + +int main(int argc, char** argv) { + if (argc != 2) { + std::cerr << "Expected path to test-ecmascript.scxml" << std::endl; + exit(EXIT_FAILURE); + } + + using namespace uscxml; + using namespace Arabica::DOM; + using namespace Arabica::XPath; + +// class SCXMLRunner : public Thread { +// public: +// SCXMLRunner(Runtime* runtime) : _runtime(runtime) {} +// void run() { +// _runtime->interpret(); +// } +// +// Runtime* _runtime; +// }; + +// boost::shared_ptr<V8DataModel> v8 = boost::static_pointer_cast<V8DataModel>(Factory::create("datamodel:ecmascript", Arabica::DOM::Node<std::string>())); +// v8->eval("var x = 4;"); +// assert(v8->evalAsBool("x == 4")); +// assert(!v8->evalAsBool("x == 5")); + + Interpreter* scxml = new Interpreter(argv[1]); + scxml->dump(); +// scxml->interpret(); + scxml->start(); + scxml->waitForStabilization(); + + Event event1; + event1.name = "event1"; + scxml->receive(event1); + scxml->waitForStabilization(); + tthread::this_thread::sleep_for(tthread::chrono::milliseconds(200)); + +// SCXMLRunner* scxmlRun = new SCXMLRunner(scxmlRuntime); +// scxmlRun->start(); + +}
\ No newline at end of file |