summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Radomski <radomski@tk.informatik.tu-darmstadt.de>2012-12-21 18:07:27 (GMT)
committerStefan Radomski <radomski@tk.informatik.tu-darmstadt.de>2012-12-21 18:07:27 (GMT)
commit93d0fee20cafb44b3de2fb2faa88bc13f739d295 (patch)
tree53aa62bd0437a1d947da9f010f49bc7b9328d24b
parent501e7730acc35934dee481207a7a6c6575b1b342 (diff)
downloaduscxml-93d0fee20cafb44b3de2fb2faa88bc13f739d295.zip
uscxml-93d0fee20cafb44b3de2fb2faa88bc13f739d295.tar.gz
uscxml-93d0fee20cafb44b3de2fb2faa88bc13f739d295.tar.bz2
Fixed tests again
-rw-r--r--test/CMakeLists.txt16
-rw-r--r--test/samples/uscxml/test-communication.scxml6
-rw-r--r--test/samples/uscxml/test-ecmascript.scxml8
-rw-r--r--test/samples/uscxml/test-invoked.scxml3
-rw-r--r--test/src/test-predicates.cpp1
-rw-r--r--test/src/test-prolog-swi.cpp11
6 files changed, 24 insertions, 21 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 7bd6c47..9013dd0 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -1,43 +1,43 @@
add_executable(test-predicates src/test-predicates.cpp)
target_link_libraries(test-predicates uscxml)
-add_test(test-predicates ${CURRENT_BINARY_DIR}/test-predicates ${CMAKE_SOURCE_DIR}/test/src/test-predicates.scxml)
+add_test(test-predicates ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test-predicates ${CMAKE_SOURCE_DIR}/test/samples/uscxml/test-predicates.scxml)
set_target_properties(test-predicates PROPERTIES FOLDER "Tests")
add_executable(test-execution src/test-execution.cpp)
target_link_libraries(test-execution uscxml)
-add_test(test-execution ${CURRENT_BINARY_DIR}/test-execution ${CMAKE_SOURCE_DIR}/test/src/test-execution.scxml)
+add_test(test-execution ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test-execution ${CMAKE_SOURCE_DIR}/test/samples/uscxml/test-execution.scxml)
set_target_properties(test-execution PROPERTIES FOLDER "Tests")
add_executable(test-apache-commons src/test-apache-commons.cpp)
target_link_libraries(test-apache-commons uscxml)
-add_test(test-apache-commons ${CURRENT_BINARY_DIR}/test-apache-commons ${CMAKE_SOURCE_DIR}/test/samples/apache)
+add_test(test-apache-commons ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test-apache-commons ${CMAKE_SOURCE_DIR}/test/samples/apache)
set_target_properties(test-apache-commons PROPERTIES FOLDER "Tests")
if (V8_FOUND)
add_executable(test-ecmascript-v8 src/test-ecmascript-v8.cpp)
target_link_libraries(test-ecmascript-v8 uscxml)
- add_test(test-ecmascript-v8 ${CURRENT_BINARY_DIR}/test-ecmascript-v8 ${CMAKE_SOURCE_DIR}/test/src/test-ecmascript.scxml)
+ add_test(test-ecmascript-v8 ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test-ecmascript-v8 ${CMAKE_SOURCE_DIR}/test/samples/uscxml/test-ecmascript.scxml)
set_target_properties(test-ecmascript-v8 PROPERTIES FOLDER "Tests")
endif()
if (SWI_FOUND)
add_executable(test-prolog-swi src/test-prolog-swi.cpp)
target_link_libraries(test-prolog-swi uscxml)
- add_test(test-prolog-swi ${CURRENT_BINARY_DIR}/test-prolog-swi ${CMAKE_SOURCE_DIR}/test/src/test-prolog.scxml)
+ add_test(test-prolog-swi ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test-prolog-swi ${CMAKE_SOURCE_DIR}/test/samples/uscxml/test-prolog.scxml)
set_target_properties(test-prolog-swi PROPERTIES FOLDER "Tests")
endif()
add_executable(test-communication src/test-communication.cpp)
target_link_libraries(test-communication uscxml)
-add_test(test-communication ${CURRENT_BINARY_DIR}/test-communication ${CMAKE_SOURCE_DIR}/test/src/test-communication.scxml)
+add_test(test-communication ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test-communication ${CMAKE_SOURCE_DIR}/test/samples/uscxml/test-communication.scxml)
set_target_properties(test-communication PROPERTIES FOLDER "Tests")
add_executable(test-eventdelay src/test-eventdelay.cpp)
target_link_libraries(test-eventdelay uscxml)
-add_test(test-eventdelay ${CURRENT_BINARY_DIR}/test-eventdelay)
+add_test(test-eventdelay ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test-eventdelay)
set_target_properties(test-eventdelay PROPERTIES FOLDER "Tests")
add_executable(test-completion src/test-completion.cpp)
target_link_libraries(test-completion uscxml)
-add_test(test-completion ${CURRENT_BINARY_DIR}/test-completion ${CMAKE_SOURCE_DIR}/test/src/test-donedata.scxml)
+add_test(test-completion ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test-completion ${CMAKE_SOURCE_DIR}/test/samples/uscxml/test-donedata.scxml)
set_target_properties(test-completion PROPERTIES FOLDER "Tests")
diff --git a/test/samples/uscxml/test-communication.scxml b/test/samples/uscxml/test-communication.scxml
index 610f8cc..8b1b380 100644
--- a/test/samples/uscxml/test-communication.scxml
+++ b/test/samples/uscxml/test-communication.scxml
@@ -4,9 +4,9 @@
<!-- Setup datamodel, print environment and send ourself an event to transition to next state -->
<datamodel>
- <data id="invokeconfig">
+ <!--data id="invokeconfig">
<invoker id="scxml" name="http://www.w3.org/TR/scxml/" location="_runtime" />
- </data>
+ </data -->
<data id="foo" expr="'this is the foo data'" />
<data id="bar" expr="'this is the bar data'" />
</datamodel>
@@ -15,7 +15,7 @@
<log expr="'Entered step1'" />
<log expr="'Sending ourself an event with data via basichttp'" />
<send targetexpr="_ioprocessors['basichttp'].location" namelist="foo" type="basichttp" event="transitionToNext">
- <param name="bar" expr="'b' + 'ar'" />
+ <param name="bar" expr="bar" />
<content>
<![CDATA[
This is some content you got there dude!
diff --git a/test/samples/uscxml/test-ecmascript.scxml b/test/samples/uscxml/test-ecmascript.scxml
index 7dfd94c..aa88f17 100644
--- a/test/samples/uscxml/test-ecmascript.scxml
+++ b/test/samples/uscxml/test-ecmascript.scxml
@@ -77,7 +77,13 @@
</foreach>
</foreach>
</onentry>
- <transition target="datamodels" />
+ <transition target="externalEvents" />
+ </state>
+ <state id="externalEvents">
+ <onentry>
+ <log expr="'-- External Events'" />
+ </onentry>
+ <transition target="datamodels" event="event1" cond="_event.name == 'event1'" />
</state>
<state id="datamodels">
<datamodel>
diff --git a/test/samples/uscxml/test-invoked.scxml b/test/samples/uscxml/test-invoked.scxml
index 7cd0d72..2781d31 100644
--- a/test/samples/uscxml/test-invoked.scxml
+++ b/test/samples/uscxml/test-invoked.scxml
@@ -1,8 +1,9 @@
+<!-- This is invoked in test-communications.scxml from a scxml invoker -->
<scxml datamodel="ecmascript">
<state id="start">
<onentry>
<log expr="'Message from the invoked scxml interpreter'" />
- <send target="_parent" event="transitionToNext" />
+ <send target="#_parent" event="transitionToNext" />
</onentry>
</state>
</scxml> \ No newline at end of file
diff --git a/test/src/test-predicates.cpp b/test/src/test-predicates.cpp
index 2905f40..0149d93 100644
--- a/test/src/test-predicates.cpp
+++ b/test/src/test-predicates.cpp
@@ -13,6 +13,7 @@ int main(int argc, char** argv) {
using namespace Arabica::XPath;
Interpreter* interpreter = Interpreter::fromURI(argv[1]);
+ assert(interpreter);
Node<std::string> atomicState = interpreter->getState("atomic");
assert(Interpreter::isAtomic(atomicState));
diff --git a/test/src/test-prolog-swi.cpp b/test/src/test-prolog-swi.cpp
index 17947af..85815f5 100644
--- a/test/src/test-prolog-swi.cpp
+++ b/test/src/test-prolog-swi.cpp
@@ -13,13 +13,8 @@ int main(int argc, char** argv) {
uscxml::Factory::pluginPath = "/Users/sradomski/Documents/TK/Code/uscxml/build/xcode/lib";
Interpreter* scxml = Interpreter::fromURI(argv[1]);
- scxml->start();
- scxml->waitForStabilization();
-
- Event event1;
- event1.name = "event1";
- scxml->receive(event1);
- scxml->join();
- tthread::this_thread::sleep_for(tthread::chrono::milliseconds(500));
+// scxml->start();
+// scxml->join();
+// tthread::this_thread::sleep_for(tthread::chrono::milliseconds(500));
} \ No newline at end of file