ctest: test both insn and block decoder

When using ctest to run PTT tests, run each test twice:
  - once for the instruction flow decoder
  - once for the block decoder.

To support parallel testing, we run them in separate subdirectories.

Change-Id: Ie8d7fc1a6f631705d7e1631071d75b307aa49474
Signed-off-by: Markus Metzger <markus.t.metzger@intel.com>
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index e1bf7ed..dbf4a79 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -32,8 +32,15 @@
   set(test   ${CMAKE_SOURCE_DIR}/test/src/${name})
 
   add_test(
-    NAME ${name}
-    COMMAND ${script} -f -g ${pttc} -d ${ptdump} -x ${ptxed} ${test}
+    NAME insn-${name}
+    COMMAND ${script} -f -g ${pttc} -d ${ptdump} -x "${ptxed} --insn-decoder" ${test}
+    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/ptt-insn
+  )
+
+  add_test(
+    NAME block-${name}
+    COMMAND ${script} -f -g ${pttc} -d ${ptdump} -x "${ptxed} --block-decoder" ${test}
+    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/ptt-block
   )
 endfunction(add_ptt_test)
 
@@ -43,6 +50,10 @@
   src/*.ptt
 )
 
+file(MAKE_DIRECTORY
+  ${CMAKE_CURRENT_BINARY_DIR}/ptt-insn
+  ${CMAKE_CURRENT_BINARY_DIR}/ptt-block
+)
 foreach (test ${TESTS})
   add_ptt_test(${test})
 endforeach ()