Changeset 3376
- Timestamp:
- 06/19/08 09:23:51 (3 months ago)
- Files:
-
- trunk/CMakeLists.txt (modified) (1 diff)
- trunk/config.h.cmake (modified) (1 diff)
- trunk/tests/support.c (modified) (1 diff)
- trunk/tests/support.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/CMakeLists.txt
r3346 r3376 54 54 ENDIF ( CHECK_FOUND AND OPENSYNC_UNITTESTS ) 55 55 56 IF ( CMAKE_SYSTEM_NAME MATCHES SunOS ) 57 SET( HAVE_SOLARIS 1 ) 58 ENDIF (CMAKE_SYSTEM_NAME MATCHES SunOS ) 59 56 60 ############################################## 57 61 trunk/config.h.cmake
r3143 r3376 20 20 21 21 #cmakedefine HAVE_FLOCK 22 #cmakedefine HAVE_SOLARIS 22 23 23 24 #define OPENSYNC_TESTDATA "${CMAKE_CURRENT_SOURCE_DIR}/tests/data" trunk/tests/support.c
r3354 r3376 621 621 } 622 622 623 /*! @brief Copy files 624 * 625 * @param source source filename 626 * @param dest destination filename 627 * @returns TRUE on success, FALSE otherwise 628 * 629 */ 630 osync_bool osync_testing_file_copy(const char *source, const char *dest) 631 { 632 gchar *cmd; 633 int ret; 634 635 cmd = g_strdup_printf("cp %s %s", source, dest); 636 ret = system(cmd); 637 g_free(cmd); 638 639 return ret; 640 } 641 642 /*! @brief Find differences between two files 643 * 644 * @param source source filename 645 * @param dest destination filename 646 * @returns TRUE on success, FALSE otherwise 647 * 648 */ 649 osync_bool osync_testing_diff(const char *file1, const char *file2) 650 { 651 gchar *cmd; 652 int ret; 653 654 cmd = g_strdup_printf("test \"x`(" DIFF " -x \".*\" %s %s)`\" = \"x\"", file1, file2); 655 ret = system(cmd); 656 g_free(cmd); 657 658 return ret; 659 } 660 623 661 /*! @brief Creates a simple OSyncPluginConfig with a single resource. 624 662 * If config is not null the ressource information gets added. trunk/tests/support.h
r3354 r3376 92 92 osync_bool osync_testing_file_remove(const char *file); 93 93 osync_bool osync_testing_file_chmod(const char *file, int mode); 94 osync_bool osync_testing_file_copy(const char *source, const char *dest); 95 osync_bool osync_testing_diff(const char *file1, const char *file2); 94 96 95 97 /* Plugin config helper */ 96 98 OSyncPluginConfig *simple_plugin_config(OSyncPluginConfig *config, const char *path, const char *objformat, const char *format_config); 97 99 100 /* gdiff is GNU diff in Solaris */ 101 #ifdef HAVE_SOLARIS 102 #define DIFF "gdiff" 103 #else 104 #define DIFF "diff" 105 #endif 106
