summaryrefslogtreecommitdiffstats
path: root/Tests/VSWinStorePhone/VerifyAppPackage.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/VSWinStorePhone/VerifyAppPackage.cmake')
-rw-r--r--Tests/VSWinStorePhone/VerifyAppPackage.cmake34
1 files changed, 34 insertions, 0 deletions
diff --git a/Tests/VSWinStorePhone/VerifyAppPackage.cmake b/Tests/VSWinStorePhone/VerifyAppPackage.cmake
new file mode 100644
index 0000000..f1cf030
--- /dev/null
+++ b/Tests/VSWinStorePhone/VerifyAppPackage.cmake
@@ -0,0 +1,34 @@
+set(APP_PKG_NAME Direct3DApp1)
+
+# List of files that are expected to be present in the generated app package
+set(EXPECTED_APP_PKG_CONTENT
+ ${APP_PKG_NAME}.exe
+ CxxDll.dll
+ JusticeLeagueWinRT.winmd
+ JusticeLeagueWinRT.dll
+)
+
+# Windows app package formats can be either appx or msix
+file(GLOB_RECURSE ALL_APP_PKG_FILES ${APP_PACKAGE_DIR}/AppPackages ${APP_PKG_NAME}*.appx ${APP_PKG_NAME}*.msix)
+
+# There can be only one generated app package
+list(LENGTH ALL_APP_PKG_FILES APP_PKG_COUNT)
+if(NOT APP_PKG_COUNT EQUAL 1)
+ message(FATAL_ERROR "Expected 1 generated app package, but detected ${APP_PKG_COUNT}: ${ALL_APP_PKG_FILES}")
+endif()
+
+execute_process(COMMAND ${CMAKE_COMMAND} -E tar tf ${ALL_APP_PKG_FILES}
+ OUTPUT_VARIABLE APP_PKG_CONTENT_OUTPUT
+ ERROR_VARIABLE error
+ RESULT_VARIABLE result)
+
+if(NOT result EQUAL 0)
+ message(FATAL_ERROR "Listing app package content failed with: ${error}")
+endif()
+
+foreach(app_pkg_item ${EXPECTED_APP_PKG_CONTENT})
+ string(FIND ${APP_PKG_CONTENT_OUTPUT} ${app_pkg_item} _found)
+ if(_found EQUAL -1)
+ message(FATAL_ERROR "Generated app package is missing an expected item: ${app_pkg_item}")
+ endif()
+endforeach()