summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorStefan Radomski <radomski@tk.informatik.tu-darmstadt.de>2014-08-28 07:32:19 (GMT)
committerStefan Radomski <radomski@tk.informatik.tu-darmstadt.de>2014-08-28 07:32:19 (GMT)
commit2b64614618fc79728ba447ed9e15c5e7fd06af5e (patch)
tree341f49721360b123d331cab866b60a4de91f4bc5 /test
parent9d4e46c90f8674ecf60848549a48825069b88046 (diff)
downloaduscxml-2b64614618fc79728ba447ed9e15c5e7fd06af5e.zip
uscxml-2b64614618fc79728ba447ed9e15c5e7fd06af5e.tar.gz
uscxml-2b64614618fc79728ba447ed9e15c5e7fd06af5e.tar.bz2
Retain ioProcs and invokers object in V8 and moved ctests from contrib to tests
Diffstat (limited to 'test')
-rw-r--r--test/ctest/CTestCustom.ctest.in41
-rw-r--r--test/ctest/README.md91
-rw-r--r--test/ctest/common.ctest.inc155
-rw-r--r--test/ctest/hosts/default.make.ctest24
-rw-r--r--test/ctest/hosts/default.nmake.ctest24
-rwxr-xr-xtest/ctest/run-tests.cron79
-rw-r--r--test/ctest/run-tests.vbs87
-rw-r--r--test/ctest/tests/ecma.ctest4
-rw-r--r--test/ctest/tests/general.ctest4
-rw-r--r--test/ctest/tests/plugins-ecma.ctest4
-rw-r--r--test/ctest/tests/xpath.ctest4
11 files changed, 517 insertions, 0 deletions
diff --git a/test/ctest/CTestCustom.ctest.in b/test/ctest/CTestCustom.ctest.in
new file mode 100644
index 0000000..6b5fd3c
--- /dev/null
+++ b/test/ctest/CTestCustom.ctest.in
@@ -0,0 +1,41 @@
+# grep -ori 'datamodel="xpath' .
+# skip xpath datamodel tests
+
+# grep -ori 'manual' .
+# manual tests
+
+# grep -ori 'datamodel="null' .
+# skip xpath datamodel tests
+
+# these are manual or xpath tests generated by the ecma generator
+set(CTEST_CUSTOM_TESTS_IGNORE
+ "ecma/test178.scxml" # Manual - PASSED
+ "ecma/test230.scxml" # Manual - PASSED
+ "ecma/test250.scxml" # Manual - PASSED
+ "ecma/test301.scxml" # Manual - PASSED
+ "ecma/test307.scxml" # Manual - PASSED
+ "ecma/test415.scxml" # Manual - PASSED
+
+ "fsm/ecma/test178.scxml" # manual test
+ "fsm/ecma/test224.scxml" # automatically generated id has the form stateid.platformid
+ "fsm/ecma/test230.scxml" # manual test
+ "fsm/ecma/test250.scxml" # manual test
+ "fsm/ecma/test307.scxml" # manual test
+ "fsm/ecma/test324.scxml" # _name can be assigned
+ "fsm/ecma/test329.scxml" # system variables can be modified
+ "fsm/ecma/test346.scxml" # change the value of a system variable
+ "fsm/ecma/test409.scxml" # In predicate
+ "fsm/ecma/test411.scxml" # In predicate
+ "fsm/ecma/test415.scxml" # manual test
+ "fsm/ecma/test436.scxml" # In predicate
+ "fsm/ecma/test519.scxml" # unspecified basichttp format
+ "fsm/ecma/test520.scxml" # unspecified basichttp format
+ "fsm/ecma/test531.scxml" # unspecified basichttp format
+ "fsm/ecma/test534.scxml" # unspecified basichttp format
+ "fsm/ecma/test567.scxml" # unspecified basichttp format
+
+ "xpath/test580.scxml" # hangs
+)
+
+
+
diff --git a/test/ctest/README.md b/test/ctest/README.md
new file mode 100644
index 0000000..4e52e8a
--- /dev/null
+++ b/test/ctest/README.md
@@ -0,0 +1,91 @@
+# Setting up CTest Slaves
+
+If you want to contribute a test-slave, just create a file called
+<tt>hosts/&lt;HOSTNAME>.ctest</tt> - have a look at the existing host files.
+Then setup your crontab as follows:
+
+ 50 */4 * * * CTEST_SUBMIT_TYPE="Experimental" /home/autobuilder/uscxml/test/ctest/run-tests.cron
+ 0 2 * * * CTEST_SUBMIT_TYPE="Nightly" /home/autobuilder/uscxml/test/ctest/run-tests.cron
+ */2 * * * * CTEST_SUBMIT_TYPE="Continuous" /home/autobuilder/uscxml/test/ctest/run-tests.cron
+
+<b>Note:</b> Be aware that <tt>run-tests.cron</tt> is under version control and
+might get updated from git with potentially surprising content. Copy the whole
+ctest directory someplace safe if you are concerned and make sure to specify
+<tt>USCXML_SOURCE_DIR=/uscxml/checkout/here</tt> in the crontab line.
+
+<b>Note:</b> We will build in <tt>/tmp</tt>, make sure there is enough room for all three
+build directories.
+
+<b>Warning:</b> <tt>run-tests.cron</tt> will pull the current GIT head. Use a
+dedicated source checkout for testing if this is a problem.
+
+# How it works
+
+<tt>run-tests.cron</tt> will setup the environment to call your host-specific
+test file with <tt>ctest</tt>. If you do not provide a value for
+<tt>USCXML_SOURCE_DIR</tt> it will assume that you want to work with the source
+containing the script itself.
+
+When your host-specific test file is called, you can assume the following facts:
+
+* You are the only running ctest instance invoked by <tt>run-tests.cron</tt>
+* There is a path to the ctest executable in <tt>$ENV{CTEST}</tt>
+* The current working directory is the ctest directory.
+* The chosen submit type is available as <tt>$ENV{CTEST_SUBMIT_TYPE}</tt>
+* The path to the umundo sources is available as <tt>$ENV{UMUNDO_SOURCE_DIR}</tt>
+
+As a host-specific test file, you are expected to prepare test-builds by setting
+the following variables and call <tt>include("common.ctest.inc")</tt> for every
+build you prepared.
+
+<table>
+ <tr><th>Variable</th><th>Comment</th></tr>
+ <tr>
+ <td><tt>CTEST_SITE</tt></td>
+ <td>The name of this build-slave for reporting in the dashboard. Should be the same for all submitted test-builds</td>
+ </tr>
+ <tr>
+ <td><tt>CTEST_CMAKE_GENERATOR</tt></td>
+ <td>The generator to use with cmake (e.g. "Unix Makefiles")</td>
+ </tr>
+ <tr>
+ <td><tt>CTEST_BUILD_CONFIGURATION</tt></td>
+ <td>"Debug", "Release" ..</td>
+ </tr>
+ <tr>
+ <td><tt>CTEST_TOOLCHAIN</tt></td>
+ <td>Path to a cmake toolchain file for cross compiling.</td>
+ </tr>
+ <tr>
+ <td><tt>CTEST_BUILD_NAME</tt></td>
+ <td>Name of the particular build you are about to submit (e.g. "darwin-x86_64 llvm bonjour").</td>
+ </tr>
+ <tr>
+ <td><tt>CTEST_BUILD_OPTIONS</tt></td>
+ <td>Parameters to be passed to cmake when preparing the build. These will
+ most likely come from one of the tests/*.ctest files.</td>
+ </tr>
+</table>
+
+## Example from the centos6x64-vii build-slave:
+
+ set(CTEST_CMAKE_GENERATOR "Unix Makefiles")
+ set(CTEST_SITE "centos6x64-vii")
+ set(CTEST_BUILD_CONFIGURATION "Debug")
+
+ # test with avahi
+ include("tests/avahi.ctest")
+ set(CTEST_BUILD_NAME "linux-x86_64 gcc avahi")
+ include("common.ctest.inc")
+
+ # test for embedded bonjour
+ include("tests/bonjourEmbedded.ctest")
+ set(CTEST_BUILD_NAME "linux-x86_64 gcc bonjour embedded")
+ include("common.ctest.inc")
+
+ # test android cross-compile with embedded bonjour
+ include("tests/bonjourEmbedded.ctest")
+ set(CTEST_BUILD_NAME "linux-x86_64-android gcc bonjour embedded")
+ set(CTEST_TOOLCHAIN "$ENV{UMUNDO_SOURCE_DIR}/contrib/cmake/CrossCompile-Android.cmake")
+ include("common.ctest.inc")
+
diff --git a/test/ctest/common.ctest.inc b/test/ctest/common.ctest.inc
new file mode 100644
index 0000000..c95259c
--- /dev/null
+++ b/test/ctest/common.ctest.inc
@@ -0,0 +1,155 @@
+#
+# This file gets called from the host-specific test files in hosts/. They are
+# expected to set the following CTest variables:
+#
+# CTEST_CMAKE_GENERATOR - the generator to use for cmake (e.g. "Unix Makefiles")
+# CTEST_SITE - the name of this build-slave
+# CTEST_BUILD_CONFIGURATION - "Debug", "Release" ..
+# CTEST_BUILD_NAME - name of the particular build (e.g. "darwin-x86_64 llvm bonjour")
+# CMAKE_TOOLCHAIN_FILE - name of a toolchain file for cross-compiling
+#
+# CTEST_BUILD_OPTIONS - parameters to be passed to cmake when preparing the build
+# these will most likely come from one of the tests/*.ctest files
+#
+# In addition, we expect the following environment variables to be set:
+#
+# CTEST_SUBMIT_TYPE - "Experimental", "Nightly", "Continuous"
+# USCXML_SOURCE_DIR - full path to the uscxml sources we will work with
+#
+# We will always build in /tmp/build-*
+#
+
+### Custom ctest
+# see http://lists.gforge.inria.fr/pipermail/simgrid-commits/2010-November/016461.html
+
+# CTEST_CUSTOM_ERROR_MATCH Regular expression for errors during build process
+# CTEST_CUSTOM_ERROR_EXCEPTION Regular expression for error exceptions during build process
+# CTEST_CUSTOM_WARNING_MATCH Regular expression for warnings during build process
+# CTEST_CUSTOM_WARNING_EXCEPTION Regular expression for warning exception during build process
+# CTEST_CUSTOM_MAXIMUM_NUMBER_OF_ERRORS Maximum number of errors to display
+# CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS Maximum number of warnings to display
+# CTEST_CUSTOM_TESTS_IGNORE List of tests to ignore during the Test stage
+# CTEST_CUSTOM_MEMCHECK_IGNORE List of tests to ignore during the MemCheck stage
+# CTEST_CUSTOM_PRE_TEST Command to execute before any tests are run during Test stage
+# CTEST_CUSTOM_POST_TEST Command to execute after any tests are run during Test stage
+# CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE Maximum size of passed test output
+# CTEST_CUSTOM_MAXIMUM_FAILED_TEST_OUTPUT_SIZE Maximum size of failed test output
+# CTEST_CUSTOM_PRE_MEMCHECK Command to execute before any tests are run during MemCheck stage
+# CTEST_CUSTOM_POST_MEMCHECK Command to execute after any tests are run during MemCheck stage
+# CTEST_CUSTOM_COVERAGE_EXCLUDE Regular expression for excluding files from coverage testing
+
+if ("$ENV{CTEST_SUBMIT_TYPE}" STREQUAL "")
+ set(CTEST_SUBMIT_TYPE "Experimental")
+ message(STATUS "ENV{CTEST_SUBMIT_TYPE} is emtpy - defaulting to Experimental")
+endif()
+
+if ("$ENV{USCXML_SOURCE_DIR}" STREQUAL "")
+ message(FATAL_ERROR "ENV{USCXML_SOURCE_DIR} is emtpy")
+endif()
+
+set(CTEST_SOURCE_DIRECTORY $ENV{USCXML_SOURCE_DIR})
+set(CTEST_SUBMIT_TYPE $ENV{CTEST_SUBMIT_TYPE})
+set(CTEST_BINARY_DIRECTORY "/tmp/build-uscxml-${CTEST_SUBMIT_TYPE}-${CTEST_SCRIPT_NAME}")
+
+if ("$ENV{USCXML_PLUGIN_PATH}" STREQUAL "")
+ set(ENV{USCXML_PLUGIN_PATH} /tmp/build-uscxml-${CTEST_SUBMIT_TYPE}-${CTEST_SCRIPT_NAME}/lib)
+endif()
+
+set(CTEST_CUSTOM_MAXIMUM_FAILED_TEST_OUTPUT_SIZE 4194304)
+set(CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE 4194304)
+
+### Coverage and Memory checks? (untested) ################################
+
+if (${CTEST_SUBMIT_TYPE} MATCHES "Nightly")
+ find_program(CTEST_COVERAGE_COMMAND NAMES gcov)
+ SET(CTEST_CUSTOM_COVERAGE_EXCLUDE
+ "${CTEST_SOURCE_DIRECTORY}/contrib/*"
+ )
+endif()
+
+set(CTEST_CUSTOM_WARNING_EXCEPTION
+ ".*will never be executed"
+)
+
+#find_program(CTEST_MEMORYCHECK_COMMAND NAMES valgrind)
+#set(CTEST_MEMORYCHECK_SUPPRESSIONS_FILE ${CTEST_SOURCE_DIRECTORY}/tests/valgrind.supp)
+
+### Versioning Control ###################################################
+
+find_program(CTEST_GIT_COMMAND NAMES git)
+if(NOT EXISTS "${CTEST_SOURCE_DIRECTORY}")
+ set(CTEST_CHECKOUT_COMMAND "${CTEST_GIT_COMMAND} clone git://github.com/tklab-tud/uscxml.git ${CTEST_SOURCE_DIRECTORY}")
+endif()
+
+set(CTEST_UPDATE_COMMAND "${CTEST_GIT_COMMAND}")
+
+### CMake Command line ###################################################
+
+set(CTEST_CONFIGURE_COMMAND "${CMAKE_COMMAND} -LA -DCMAKE_BUILD_TYPE:STRING=${CTEST_BUILD_CONFIGURATION}")
+set(CTEST_CONFIGURE_COMMAND "${CTEST_CONFIGURE_COMMAND} \"-G${CTEST_CMAKE_GENERATOR}\"")
+
+if (CTEST_TOOLCHAIN)
+ set(CTEST_CONFIGURE_COMMAND "${CTEST_CONFIGURE_COMMAND} -DCMAKE_TOOLCHAIN_FILE=${CTEST_TOOLCHAIN} ${CTEST_BUILD_OPTIONS}")
+else()
+ set(CTEST_CONFIGURE_COMMAND "${CTEST_CONFIGURE_COMMAND} ${CTEST_BUILD_OPTIONS}")
+ #set(CTEST_CONFIGURE_COMMAND "${CTEST_CONFIGURE_COMMAND} -DBUILD_TESTS=ON ${CTEST_BUILD_OPTIONS}")
+endif()
+
+set(CTEST_CONFIGURE_COMMAND "${CTEST_CONFIGURE_COMMAND} \"${CTEST_SOURCE_DIRECTORY}\"")
+
+#message(FATAL_ERROR "CTEST_CONFIGURE_COMMAND: ${CTEST_CONFIGURE_COMMAND}")
+
+### Test! ################################################################
+
+# clean build directory for everything but continuous tests
+if (NOT RETAIN_BUILD_DIR)
+ ctest_empty_binary_directory(${CTEST_BINARY_DIRECTORY})
+endif()
+
+ctest_start(${CTEST_SUBMIT_TYPE}) # start testing
+#
+# I accidentally resynced when running from IDE thrice!
+# We will rely on the run_tests.cron script to update to head
+#
+#ctest_update() # synchronize with git head
+
+ctest_configure() # run cmake
+
+if(EXISTS "${CTEST_BINARY_DIRECTORY}/CTestCustom.cmake")
+ include(${CTEST_BINARY_DIRECTORY}/CTestCustom.cmake)
+elseif(EXISTS "${CTEST_BINARY_DIRECTORY}/CTestCustom.ctest")
+ include(${CTEST_BINARY_DIRECTORY}/CTestCustom.ctest)
+endif()
+
+if (CTEST_TOOLCHAIN)
+#
+# We do not want to build the tests everytime we compile something, but we cannot
+# add a dependency to target "test" as it is unknown to CMake, instead, we introduce
+# a new target "ctest" for all tests to depend upon.
+#
+# But when cross-compiling, we do not add any tests, that is "ctest" depends on nothing,
+# in this case, build the whole library without tests.
+#
+ set(CTEST_BUILD_TARGET "")
+else()
+ set(CTEST_BUILD_TARGET "")
+endif()
+
+ctest_build() # build custom target that depends on all the actual tests
+if (NOT "${USCXML_EXCLUDE_LABEL_REGEX}" STREQUAL "")
+ ctest_test(EXCLUDE_LABEL ${USCXML_EXCLUDE_LABEL_REGEX})
+elseif(NOT "${USCXML_INCLUDE_LABEL_REGEX}" STREQUAL "")
+ ctest_test(INCLUDE_LABEL ${USCXML_INCLUDE_LABEL_REGEX})
+else()
+ ctest_test()
+endif()
+
+
+if(CTEST_COVERAGE_COMMAND)
+ ctest_coverage()
+endif()
+if (CTEST_MEMORYCHECK_COMMAND)
+ ctest_memcheck()
+endif()
+
+ctest_submit() # submit
diff --git a/test/ctest/hosts/default.make.ctest b/test/ctest/hosts/default.make.ctest
new file mode 100644
index 0000000..12e161c
--- /dev/null
+++ b/test/ctest/hosts/default.make.ctest
@@ -0,0 +1,24 @@
+if (NOT HOSTNAME)
+ set(HOSTNAME "Unknown Host")
+endif()
+
+set(CTEST_CMAKE_GENERATOR "Unix Makefiles")
+set(CTEST_SITE "${HOSTNAME}")
+set(CTEST_BUILD_CONFIGURATION "Debug")
+set(CTEST_BUILD_NAME "${CMAKE_SYSTEM}")
+
+set(RETAIN_BUILD_DIR OFF)
+include("tests/general.ctest")
+include("common.ctest.inc")
+
+set(RETAIN_BUILD_DIR ON)
+include("tests/ecma.ctest")
+include("common.ctest.inc")
+
+set(RETAIN_BUILD_DIR ON)
+include("tests/xpath.ctest")
+include("common.ctest.inc")
+
+set(RETAIN_BUILD_DIR OFF)
+include("tests/plugins-ecma.ctest")
+include("common.ctest.inc")
diff --git a/test/ctest/hosts/default.nmake.ctest b/test/ctest/hosts/default.nmake.ctest
new file mode 100644
index 0000000..eac99b9
--- /dev/null
+++ b/test/ctest/hosts/default.nmake.ctest
@@ -0,0 +1,24 @@
+if (NOT HOSTNAME)
+ set(HOSTNAME "Unknown Host")
+endif()
+
+set(CTEST_CMAKE_GENERATOR "NMake Makefiles")
+set(CTEST_SITE "${HOSTNAME}")
+set(CTEST_BUILD_CONFIGURATION "Debug")
+set(CTEST_BUILD_NAME "${CMAKE_SYSTEM}")
+
+set(RETAIN_BUILD_DIR OFF)
+include("tests/general.ctest")
+include("common.ctest.inc")
+
+set(RETAIN_BUILD_DIR ON)
+include("tests/ecma.ctest")
+include("common.ctest.inc")
+
+set(RETAIN_BUILD_DIR ON)
+include("tests/xpath.ctest")
+include("common.ctest.inc")
+
+set(RETAIN_BUILD_DIR OFF)
+include("tests/plugins-ecma.ctest")
+include("common.ctest.inc")
diff --git a/test/ctest/run-tests.cron b/test/ctest/run-tests.cron
new file mode 100755
index 0000000..24a6f85
--- /dev/null
+++ b/test/ctest/run-tests.cron
@@ -0,0 +1,79 @@
+#!/bin/bash
+
+set -e
+ME=`basename $0`
+TEST_DIR="$( cd "$( dirname "$0" )" && pwd )"
+TESTS="$( cd $TEST_DIR/tests && pwd)"
+HOSTS="$( cd $TEST_DIR/hosts && pwd)"
+HOSTNAME="$( hostname )"
+LOCK_DIR=/tmp/uscxml-build.lock
+TESTFILE=$HOSTS/$HOSTNAME.ctest
+
+# cron has its own path, try to find ctest
+if [ ! -n "${CTEST:+x}" ]; then
+ for SEARCH_PATH in "/usr/bin" "/usr/local/bin" "/opt/local/bin"
+ do
+ if [ -e $SEARCH_PATH/ctest ]; then
+ CTEST=$SEARCH_PATH/ctest
+ export CTEST
+ break
+ fi
+ done
+fi
+if [ ! -e "${CTEST}" ]; then
+ echo "Error: Could not find CTEST, set the CTEST environment variable."
+ exit;
+fi
+
+if [ ! -n "${CTEST_SUBMIT_TYPE:+x}" ]; then
+ CTEST_SUBMIT_TYPE="Experimental"
+ export CTEST_SUBMIT_TYPE
+fi
+
+# Try to find uscxml source if not given in USCXML_SOURCE_DIR
+if [ ! -n "${USCXML_SOURCE_DIR:+x}" ]; then
+ # assume that this file is in ${USCXML_SOURCE_DIR}/contrib/ctest
+ # and use the directory two levels above.
+ USCXML_SOURCE_DIR="$( cd $TEST_DIR/../.. && pwd)"
+ export USCXML_SOURCE_DIR
+fi
+
+
+# is there a CMakeLists.txt file within?
+if [ ! -e ${USCXML_SOURCE_DIR}/CMakeLists.txt ]; then
+ echo "Error: Could not find uscxml in ${USCXML_SOURCE_DIR}, set the USCXML_SOURCE_DIR environment variable."
+ exit;
+fi
+
+if [ ! -e $TESTFILE ]; then
+ echo "Warning: No tests for $HOSTNAME in $TESTFILE - defaulting."
+ TESTFILE=$HOSTS/default.make.ctest
+fi
+
+#
+# Try to acquire the build lock
+#
+while true; do
+ if mkdir "$LOCK_DIR"; then
+ trap 'rm -rf "$LOCK_DIR"' 0 # remove directory when script finishes
+ break
+ else
+ echo "Could not get build lock - waiting"
+ sleep 10
+ fi
+done
+
+if [ "$CTEST_SUBMIT_TYPE" = "Continuous" ]; then
+ cd $USCXML_SOURCE_DIR
+ #git clean -f -d # careful - destructive!
+ GIT_SYNC=`git pull`
+ if [ "$GIT_SYNC" = "Already up-to-date." ]; then
+# echo "Not running continuous tests, already up-to-date"
+ exit
+ else
+ echo $GIT_SYNC
+ fi
+fi
+
+cd $TEST_DIR
+nice $CTEST -VV --timeout 20 -S $TESTFILE -DHOSTNAME=$HOSTNAME \ No newline at end of file
diff --git a/test/ctest/run-tests.vbs b/test/ctest/run-tests.vbs
new file mode 100644
index 0000000..6f73ddf
--- /dev/null
+++ b/test/ctest/run-tests.vbs
@@ -0,0 +1,87 @@
+Set shell = CreateObject( "WScript.Shell" )
+Set fso = CreateObject("Scripting.FileSystemObject")
+Set ip = CreateObject("WScript.Network")
+Set procEnv = shell.Environment("Process")
+
+' see http://stackoverflow.com/questions/4692542/force-a-vbs-to-run-using-cscript-instead-of-wscript
+Sub forceCScriptExecution
+ Dim Arg, Str
+ If Not LCase( Right( WScript.FullName, 12 ) ) = "\cscript.exe" Then
+ For Each Arg In WScript.Arguments
+ If InStr( Arg, " " ) Then Arg = """" & Arg & """"
+ Str = Str & " " & Arg
+ Next
+ shell.Run """" & VCVARSALL & """" & " && cscript //nologo """ & WScript.ScriptFullName & """" & Str
+ WScript.Sleep 1000
+ WScript.Quit
+ End If
+End Sub
+
+ME_NAME = Wscript.ScriptFullName
+TEST_DIR = fso.GetParentFolderName(fso.GetFile(ME_NAME))
+TESTS = TEST_DIR + "\tests"
+HOSTS = TEST_DIR + "\hosts"
+HOSTNAME = LCase(ip.ComputerName)
+TESTFILE = HOSTS + "\" + HOSTNAME + ".ctest"
+
+VCVARSALL = shell.ExpandEnvironmentStrings("%VCVARSALL%")
+If VCVARSALL = "%VCVARSALL%" Then
+ VCVARSALL = "C:\Program Files\Microsoft Visual Studio 10.0\VC\vcvarsall.bat"
+End If
+if (NOT fso.FileExists(VCVARSALL)) Then
+ VCVARSALL = "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat"
+End If
+
+if (NOT fso.FileExists(VCVARSALL)) Then
+ MsgBox("Please export %VCVARSALL% as the command to get a build environment for msvc.")
+ WScript.Quit
+End If
+
+CTEST_SUBMIT_TYPE = shell.ExpandEnvironmentStrings("%CTEST_SUBMIT_TYPE%")
+If CTEST_SUBMIT_TYPE = "%CTEST_SUBMIT_TYPE%" Then
+ CTEST_SUBMIT_TYPE = "Experimental"
+ procEnv("CTEST_SUBMIT_TYPE") = CTEST_SUBMIT_TYPE
+End If
+
+USCXML_SOURCE_DIR = shell.ExpandEnvironmentStrings("%USCXML_SOURCE_DIR%")
+If USCXML_SOURCE_DIR = "%USCXML_SOURCE_DIR%" Then
+ USCXML_SOURCE_DIR = fso.GetParentFolderName(fso.GetParentFolderName(TEST_DIR))
+ procEnv("USCXML_SOURCE_DIR") = USCXML_SOURCE_DIR
+End If
+
+USCXML_SOURCE_DIR = shell.ExpandEnvironmentStrings("%USCXML_SOURCE_DIR%")
+if (NOT fso.FileExists(USCXML_SOURCE_DIR + "\CMakeLists.txt")) Then
+ MsgBox "Could not find uSCXML Source for " + ME_NAME
+ WScript.Quit
+End If
+
+if (NOT fso.FileExists(TESTFILE)) Then
+ MsgBox "Warning: Could not find test file for this host at " + TESTFILE + " - defaulting"
+ TESTFILE = HOSTS + "\default.nmake.ctest"
+End If
+
+' continue with cscript
+forceCScriptExecution
+
+' Aqcuire lock to avoid concurrent builds
+' this will throw a permission denied error :(
+
+Set buildLock = fso.OpenTextFile(TESTFILE, 8, True)
+
+' Check github for updates and quit when nothing's new
+if (CTEST_SUBMIT_TYPE = "Continuous") Then
+ shell.CurrentDirectory = USCXML_SOURCE_DIR
+ Set oExec = shell.Exec("git pull")
+ GIT_SYNC = oExec.StdOut.ReadLine
+ if (GIT_SYNC = "Already up-to-date.") Then
+ WScript.Quit
+ End If
+End If
+
+shell.CurrentDirectory = TEST_DIR
+Set exec = shell.Exec("CMD /S /K ctest -VV --timeout 100 -S " + TESTFILE + " -DHOSTNAME=" + HOSTNAME + " 2>&1")
+Do While exec.Status = 0
+ WScript.Sleep 10
+ WScript.StdOut.Write(exec.StdOut.ReadLine() & vbCRLF)
+' WScript.StdErr.Write(exec.StdErr.ReadLine())
+Loop
diff --git a/test/ctest/tests/ecma.ctest b/test/ctest/tests/ecma.ctest
new file mode 100644
index 0000000..8659120
--- /dev/null
+++ b/test/ctest/tests/ecma.ctest
@@ -0,0 +1,4 @@
+set(CTEST_BUILD_OPTIONS "-DRUN_W3C_ECMA_TESTS:BOOL=ON -DENABLE_GCOV:BOOL=ON")
+set(CTEST_BUILD_NAME "${CMAKE_SYSTEM} - ecma")
+set(USCXML_INCLUDE_LABEL_REGEX ".*ecma.*")
+set(USCXML_EXCLUDE_LABEL_REGEX "") \ No newline at end of file
diff --git a/test/ctest/tests/general.ctest b/test/ctest/tests/general.ctest
new file mode 100644
index 0000000..fd120fa
--- /dev/null
+++ b/test/ctest/tests/general.ctest
@@ -0,0 +1,4 @@
+set(CTEST_BUILD_OPTIONS "-DENABLE_GCOV:BOOL=ON")
+set(CTEST_BUILD_NAME "${CMAKE_SYSTEM} - general")
+set(USCXML_INCLUDE__LABEL_REGEX "")
+set(USCXML_EXCLUDE_LABEL_REGEX ".*[ecma|xpath].*")
diff --git a/test/ctest/tests/plugins-ecma.ctest b/test/ctest/tests/plugins-ecma.ctest
new file mode 100644
index 0000000..288aac0
--- /dev/null
+++ b/test/ctest/tests/plugins-ecma.ctest
@@ -0,0 +1,4 @@
+set(CTEST_BUILD_OPTIONS "-DBUILD_AS_PLUGINS=ON -DENABLE_GCOV:BOOL=ON")
+set(CTEST_BUILD_NAME "${CMAKE_SYSTEM} - plugins")
+set(USCXML_INCLUDE_LABEL_REGEX ".*ecma.*")
+set(USCXML_EXCLUDE_LABEL_REGEX "")
diff --git a/test/ctest/tests/xpath.ctest b/test/ctest/tests/xpath.ctest
new file mode 100644
index 0000000..ca43fbe
--- /dev/null
+++ b/test/ctest/tests/xpath.ctest
@@ -0,0 +1,4 @@
+set(CTEST_BUILD_OPTIONS "-DRUN_W3C_XPATH_TESTS:BOOL=ON -DENABLE_GCOV:BOOL=ON")
+set(CTEST_BUILD_NAME "${CMAKE_SYSTEM} - xpath")
+set(USCXML_INCLUDE_LABEL_REGEX ".*xpath.*")
+set(USCXML_EXCLUDE_LABEL_REGEX "")