summaryrefslogtreecommitdiffstats
path: root/mmc_updater/src/tests/CMakeLists.txt
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2013-12-02 00:55:24 +0100
committerPetr Mrázek <peterix@gmail.com>2013-12-02 00:55:24 +0100
commit6aa9bd0f77dcb5128167fae62e32aa5252fe85c6 (patch)
tree632994a61888929af9289927d338bd19a2b3f32c /mmc_updater/src/tests/CMakeLists.txt
parent613699b3626aea750093ab7eaaeccaa28c0e87c6 (diff)
downloadMultiMC-6aa9bd0f77dcb5128167fae62e32aa5252fe85c6.tar
MultiMC-6aa9bd0f77dcb5128167fae62e32aa5252fe85c6.tar.gz
MultiMC-6aa9bd0f77dcb5128167fae62e32aa5252fe85c6.tar.lz
MultiMC-6aa9bd0f77dcb5128167fae62e32aa5252fe85c6.tar.xz
MultiMC-6aa9bd0f77dcb5128167fae62e32aa5252fe85c6.zip
Renew the updater branch
Now with some actual consensus on what the updater will do!
Diffstat (limited to 'mmc_updater/src/tests/CMakeLists.txt')
-rw-r--r--mmc_updater/src/tests/CMakeLists.txt51
1 files changed, 51 insertions, 0 deletions
diff --git a/mmc_updater/src/tests/CMakeLists.txt b/mmc_updater/src/tests/CMakeLists.txt
new file mode 100644
index 00000000..2af9b9c0
--- /dev/null
+++ b/mmc_updater/src/tests/CMakeLists.txt
@@ -0,0 +1,51 @@
+
+include_directories("${CMAKE_CURRENT_SOURCE_DIR}/..")
+
+if (APPLE)
+ set(HELPER_SHARED_SOURCES ../StlSymbolsLeopard.cpp)
+endif()
+
+# Create helper binaries for unit tests
+add_executable(oldapp
+ old_app.cpp
+ ${HELPER_SHARED_SOURCES}
+)
+add_executable(newapp
+ new_app.cpp
+ ${HELPER_SHARED_SOURCES}
+)
+
+# Install data files required by unit tests
+set(TEST_FILES
+ file_list.xml
+ v2_file_list.xml
+ test-update.rb
+)
+
+foreach(TEST_FILE ${TEST_FILES})
+ execute_process(
+ COMMAND
+ "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/${TEST_FILE}" "${CMAKE_CURRENT_BINARY_DIR}"
+ )
+endforeach()
+
+# Add unit test binaries
+macro(ADD_UPDATER_TEST CLASS)
+ set(TEST_TARGET updater_${CLASS})
+ add_executable(${TEST_TARGET} ${CLASS}.cpp)
+ target_link_libraries(${TEST_TARGET} updatershared)
+ add_test(${TEST_TARGET} ${TEST_TARGET})
+ if (APPLE)
+ set_target_properties(${TEST_TARGET} PROPERTIES LINK_FLAGS "-framework Security -framework Cocoa")
+ endif()
+endmacro()
+
+add_updater_test(TestUpdateScript)
+add_updater_test(TestUpdaterOptions)
+add_updater_test(TestFileUtils)
+
+# Add updater that that performs a complete update install
+# and checks the result
+find_program(RUBY_BIN ruby)
+add_test(updater_TestUpdateInstall ${RUBY_BIN} test-update.rb)
+