summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bin/bbackupquery/Makefile.extra6
-rw-r--r--infrastructure/cmake/CMakeLists.txt26
-rw-r--r--infrastructure/m4/boxbackup_tests.m43
-rwxr-xr-xinfrastructure/mingw/compile-boxbackup-cygwin.sh13
-rwxr-xr-xinfrastructure/mingw/configure.sh5
-rw-r--r--lib/bbackupd/BackupClientContext.cpp (renamed from bin/bbackupd/BackupClientContext.cpp)0
-rw-r--r--lib/bbackupd/BackupClientContext.h (renamed from bin/bbackupd/BackupClientContext.h)0
-rw-r--r--lib/bbackupd/BackupClientDeleteList.cpp (renamed from bin/bbackupd/BackupClientDeleteList.cpp)0
-rw-r--r--lib/bbackupd/BackupClientDeleteList.h (renamed from bin/bbackupd/BackupClientDeleteList.h)0
-rw-r--r--lib/bbackupd/BackupClientDirectoryRecord.cpp (renamed from bin/bbackupd/BackupClientDirectoryRecord.cpp)0
-rw-r--r--lib/bbackupd/BackupClientDirectoryRecord.h (renamed from bin/bbackupd/BackupClientDirectoryRecord.h)0
-rw-r--r--lib/bbackupd/BackupClientInodeToIDMap.cpp (renamed from bin/bbackupd/BackupClientInodeToIDMap.cpp)0
-rw-r--r--lib/bbackupd/BackupClientInodeToIDMap.h (renamed from bin/bbackupd/BackupClientInodeToIDMap.h)0
-rw-r--r--lib/bbackupd/BackupDaemon.cpp (renamed from bin/bbackupd/BackupDaemon.cpp)0
-rw-r--r--lib/bbackupd/BackupDaemon.h (renamed from bin/bbackupd/BackupDaemon.h)0
-rw-r--r--lib/bbackupd/BackupDaemonInterface.h (renamed from bin/bbackupd/BackupDaemonInterface.h)0
-rw-r--r--lib/bbackupd/Win32BackupService.cpp (renamed from bin/bbackupd/Win32BackupService.cpp)0
-rw-r--r--lib/bbackupd/Win32BackupService.h (renamed from bin/bbackupd/Win32BackupService.h)0
-rw-r--r--lib/bbackupd/Win32ServiceFunctions.cpp (renamed from bin/bbackupd/Win32ServiceFunctions.cpp)0
-rw-r--r--lib/bbackupd/Win32ServiceFunctions.h (renamed from bin/bbackupd/Win32ServiceFunctions.h)0
-rw-r--r--lib/bbackupquery/BackupQueries.cpp (renamed from bin/bbackupquery/BackupQueries.cpp)0
-rw-r--r--lib/bbackupquery/BackupQueries.h (renamed from bin/bbackupquery/BackupQueries.h)0
-rw-r--r--lib/bbackupquery/BoxBackupCompareParams.h (renamed from bin/bbackupquery/BoxBackupCompareParams.h)0
-rw-r--r--lib/bbackupquery/CommandCompletion.cpp (renamed from bin/bbackupquery/CommandCompletion.cpp)0
-rw-r--r--lib/bbackupquery/documentation.txt (renamed from bin/bbackupquery/documentation.txt)0
-rwxr-xr-xlib/bbackupquery/makedocumentation.pl.in (renamed from bin/bbackupquery/makedocumentation.pl.in)0
-rw-r--r--lib/common/NamedLock.cpp3
-rw-r--r--lib/common/Test.cpp59
-rw-r--r--lib/win32/emu.cpp2
-rw-r--r--lib/win32/emu.h2
-rw-r--r--modules.txt10
-rw-r--r--test/backupstore/testbackupstore.cpp5
-rw-r--r--test/bbackupd/testbbackupd.cpp8
33 files changed, 107 insertions, 35 deletions
diff --git a/bin/bbackupquery/Makefile.extra b/bin/bbackupquery/Makefile.extra
deleted file mode 100644
index e1049b6d..00000000
--- a/bin/bbackupquery/Makefile.extra
+++ /dev/null
@@ -1,6 +0,0 @@
-
-# AUTOGEN SEEDING
-autogen_Documentation.cpp: makedocumentation.pl documentation.txt
- $(_PERL) makedocumentation.pl
-
-
diff --git a/infrastructure/cmake/CMakeLists.txt b/infrastructure/cmake/CMakeLists.txt
index d00d90b0..805568da 100644
--- a/infrastructure/cmake/CMakeLists.txt
+++ b/infrastructure/cmake/CMakeLists.txt
@@ -1,5 +1,6 @@
cmake_minimum_required(VERSION 2.6)
project(BoxBackup)
+enable_testing()
set(base_dir ${CMAKE_SOURCE_DIR}/../..)
@@ -16,7 +17,7 @@ set(files_to_configure
test/bbackupd/testfiles/bbackupd-symlink.conf
test/bbackupd/testfiles/bbackupd-temploc.conf
bin/bbackupd/bbackupd-config
- bin/bbackupquery/makedocumentation.pl
+ lib/bbackupquery/makedocumentation.pl
bin/bbstored/bbstored-certs
bin/bbstored/bbstored-config
contrib/debian/bbackupd
@@ -61,7 +62,7 @@ if(NOT status EQUAL 0)
"status ${status}: ${command_output}")
endif()
-# Parsing Makefile.extra files in CMake script is a pain, so the relevant rules for
+# Parsing Makefile.extra files in CMake script is a pain, so the relevant rules for
# code-generating Perl scripts are hard-coded here.
set(exception_files
@@ -115,7 +116,7 @@ foreach(protocol_file ${protocol_files})
endforeach()
set(documentation_files
- bin/bbackupquery/documentation.txt
+ lib/bbackupquery/documentation.txt
)
foreach(documentation_file ${documentation_files})
@@ -127,7 +128,7 @@ foreach(documentation_file ${documentation_files})
set(output_file "${base_dir}/${CMAKE_MATCH_1}/autogen_${CMAKE_MATCH_2}.cpp")
add_custom_command(OUTPUT "${output_file}"
MAIN_DEPENDENCY "${base_dir}/${documentation_file}"
- COMMAND ${PERL_EXECUTABLE} "${base_dir}/bin/bbackupquery/makedocumentation.pl"
+ COMMAND ${PERL_EXECUTABLE} "${base_dir}/lib/bbackupquery/makedocumentation.pl"
WORKING_DIRECTORY "${base_dir}/${CMAKE_MATCH_1}")
string(REPLACE "/" "_" module_name ${CMAKE_MATCH_1})
@@ -152,7 +153,8 @@ foreach(module_dep
set(module_path ${base_dir}/${module_dir})
string(REPLACE "/" "_" module_name ${CMAKE_MATCH_1})
string(REPLACE "/" "_" dependencies "${CMAKE_MATCH_2}")
- file(GLOB module_files ${module_path}/*.c ${module_path}/*.cpp)
+ file(GLOB module_files ${module_path}/*.c ${module_path}/*.cpp
+ ${module_path}/*.h)
set(module_files ${module_files} ${${module_name}_extra_files})
# everything except qdbm, lib/common and lib/win32 implicitly depend on
@@ -165,10 +167,18 @@ foreach(module_dep
string(REGEX REPLACE " $" "" dependencies "${dependencies}")
if(module_name MATCHES "^bin_")
+ string(REGEX MATCH "^bin_(.*)" valid_exe ${module_name})
+ set(bin_name ${CMAKE_MATCH_1})
if(DEBUG)
message(STATUS "add executable '${module_name}': '${module_files}'")
endif()
add_executable(${module_name} ${module_files})
+
+ # We need to install binaries in specific places so that tests
+ # can find them:
+ install(FILES "$<TARGET_FILE:${module_name}>"
+ DESTINATION "${base_dir}/debug/${module_dir}"
+ RENAME "${bin_name}${CMAKE_EXECUTABLE_SUFFIX}")
elseif(module_name MATCHES "^test_")
string(REGEX MATCH "^test_(.*)" valid_test ${module_name})
set(test_name ${CMAKE_MATCH_1})
@@ -181,6 +191,8 @@ foreach(module_dep
file(WRITE "${module_path}/_main.cpp" "${test_main}")
add_executable(${module_name} ${module_files}
"${module_path}/_main.cpp")
+ add_test(NAME ${test_name}
+ COMMAND ${PERL_EXECUTABLE} ${base_dir}/runtest.pl ${test_name})
elseif(module_name MATCHES "^(lib_.*|qdbm)$")
if(DEBUG)
message(STATUS "add library '${module_name}': '${module_files}'")
@@ -190,7 +202,7 @@ foreach(module_dep
message(FATAL_ERROR "Unsupported module type: " ${module_name})
endif()
- target_compile_definitions(${module_name} PRIVATE -DBOX_MODULE="${module_dir}")
+ target_compile_definitions(${module_name} PRIVATE -DBOX_MODULE="${module_name}")
if(dependencies)
string(REGEX REPLACE "[ ]+" ";" dependency_list "${dependencies}")
@@ -211,7 +223,7 @@ foreach(module_dep
get_property(dep_include_dirs
TARGET ${dependency}
PROPERTY INTERFACE_INCLUDE_DIRECTORIES)
- target_include_directories(${module_name}
+ target_include_directories(${module_name}
PUBLIC ${dep_include_dirs})
endif()
endforeach()
diff --git a/infrastructure/m4/boxbackup_tests.m4 b/infrastructure/m4/boxbackup_tests.m4
index 091eb67f..09d73e04 100644
--- a/infrastructure/m4/boxbackup_tests.m4
+++ b/infrastructure/m4/boxbackup_tests.m4
@@ -25,6 +25,7 @@ if test "x$GXX" = "xyes"; then
# [http://readlist.com/lists/gcc.gnu.org/gcc/6/31502.html]
# This is needed to get symbols in backtraces.
# Note that this apparently fails on HP-UX and Solaris
+ save_LDFLAGS=$LDFLAGS
LDFLAGS="$LDFLAGS -rdynamic"
AC_MSG_CHECKING([whether gcc accepts -rdynamic])
AC_TRY_LINK([], [return 0;],
@@ -33,8 +34,10 @@ if test "x$GXX" = "xyes"; then
if test x"$have_rdynamic" = x"yes" ; then
AC_SUBST([LDADD_RDYNAMIC], ['-rdynamic'])
fi
+ LDFLAGS=$save_LDFLAGS
;;
esac
+
fi
AC_PATH_PROG([PERL], [perl], [AC_MSG_ERROR([[perl executable was not found]])])
diff --git a/infrastructure/mingw/compile-boxbackup-cygwin.sh b/infrastructure/mingw/compile-boxbackup-cygwin.sh
index 870e0dcd..38e94735 100755
--- a/infrastructure/mingw/compile-boxbackup-cygwin.sh
+++ b/infrastructure/mingw/compile-boxbackup-cygwin.sh
@@ -3,9 +3,13 @@
set -e
set -x
+basedir=`cd $(dirname $0)/../../.. && pwd`
+cd $basedir
+
wget -c https://cygwin.com/setup-x86_64.exe \
|| powershell wget https://cygwin.com/setup-x86_64.exe -UseBasicParsing -outfile setup-x86_64.exe
+chmod a+x setup-x86_64.exe
./setup-x86_64.exe --quiet-mode --packages \
"autoconf,automake,gdb,make,mingw64-x86_64-gcc,mingw64-x86_64-gcc-g++,
,mingw64-x86_64-zlib,libxml2,libxslt,perl,subversion,unzip,vim,wget"
@@ -43,12 +47,3 @@ tar xjf `basename $pcre_url`
make install
)
-svn co https://www.boxbackup.org/svn/box/trunk/ bb-trunk
-(
- cd bb-trunk
- ./infrastructure/mingw/configure.sh
- make
- ./infrastructure/mingw/runtest.sh ALL
- ./infrastructure/mingw/runtest.sh ALL release
-)
-
diff --git a/infrastructure/mingw/configure.sh b/infrastructure/mingw/configure.sh
index 0242ea74..98c0cb49 100755
--- a/infrastructure/mingw/configure.sh
+++ b/infrastructure/mingw/configure.sh
@@ -31,9 +31,12 @@ if [ ! -x "configure" ]; then
fi
if ! ./configure "$@" --host=$target \
+ --with-ssl-headers="${DEP_PATH}/include" \
+ --with-ssl-lib="${DEP_PATH}/lib" \
CFLAGS="-mthreads" \
CXXFLAGS="-mthreads" \
- LDFLAGS="-Wl,-Bstatic -mthreads -L${DEP_PATH}/lib -L${LIBZ_PATH}"
+ LDFLAGS="-Wl,-Bstatic -mthreads -L${LIBZ_PATH}" \
+ LIBS="-lws2_32 -lgdi32"
then
echo "Error: configure failed, aborting." >&2
exit 1
diff --git a/bin/bbackupd/BackupClientContext.cpp b/lib/bbackupd/BackupClientContext.cpp
index 4c0b01ce..4c0b01ce 100644
--- a/bin/bbackupd/BackupClientContext.cpp
+++ b/lib/bbackupd/BackupClientContext.cpp
diff --git a/bin/bbackupd/BackupClientContext.h b/lib/bbackupd/BackupClientContext.h
index df43a232..df43a232 100644
--- a/bin/bbackupd/BackupClientContext.h
+++ b/lib/bbackupd/BackupClientContext.h
diff --git a/bin/bbackupd/BackupClientDeleteList.cpp b/lib/bbackupd/BackupClientDeleteList.cpp
index ce5e6264..ce5e6264 100644
--- a/bin/bbackupd/BackupClientDeleteList.cpp
+++ b/lib/bbackupd/BackupClientDeleteList.cpp
diff --git a/bin/bbackupd/BackupClientDeleteList.h b/lib/bbackupd/BackupClientDeleteList.h
index b0fbf51a..b0fbf51a 100644
--- a/bin/bbackupd/BackupClientDeleteList.h
+++ b/lib/bbackupd/BackupClientDeleteList.h
diff --git a/bin/bbackupd/BackupClientDirectoryRecord.cpp b/lib/bbackupd/BackupClientDirectoryRecord.cpp
index 94cb7965..94cb7965 100644
--- a/bin/bbackupd/BackupClientDirectoryRecord.cpp
+++ b/lib/bbackupd/BackupClientDirectoryRecord.cpp
diff --git a/bin/bbackupd/BackupClientDirectoryRecord.h b/lib/bbackupd/BackupClientDirectoryRecord.h
index 865fc747..865fc747 100644
--- a/bin/bbackupd/BackupClientDirectoryRecord.h
+++ b/lib/bbackupd/BackupClientDirectoryRecord.h
diff --git a/bin/bbackupd/BackupClientInodeToIDMap.cpp b/lib/bbackupd/BackupClientInodeToIDMap.cpp
index 6eaf7394..6eaf7394 100644
--- a/bin/bbackupd/BackupClientInodeToIDMap.cpp
+++ b/lib/bbackupd/BackupClientInodeToIDMap.cpp
diff --git a/bin/bbackupd/BackupClientInodeToIDMap.h b/lib/bbackupd/BackupClientInodeToIDMap.h
index 4bb1e085..4bb1e085 100644
--- a/bin/bbackupd/BackupClientInodeToIDMap.h
+++ b/lib/bbackupd/BackupClientInodeToIDMap.h
diff --git a/bin/bbackupd/BackupDaemon.cpp b/lib/bbackupd/BackupDaemon.cpp
index 03ce7454..03ce7454 100644
--- a/bin/bbackupd/BackupDaemon.cpp
+++ b/lib/bbackupd/BackupDaemon.cpp
diff --git a/bin/bbackupd/BackupDaemon.h b/lib/bbackupd/BackupDaemon.h
index ffe31247..ffe31247 100644
--- a/bin/bbackupd/BackupDaemon.h
+++ b/lib/bbackupd/BackupDaemon.h
diff --git a/bin/bbackupd/BackupDaemonInterface.h b/lib/bbackupd/BackupDaemonInterface.h
index d5c47c85..d5c47c85 100644
--- a/bin/bbackupd/BackupDaemonInterface.h
+++ b/lib/bbackupd/BackupDaemonInterface.h
diff --git a/bin/bbackupd/Win32BackupService.cpp b/lib/bbackupd/Win32BackupService.cpp
index 6d027abf..6d027abf 100644
--- a/bin/bbackupd/Win32BackupService.cpp
+++ b/lib/bbackupd/Win32BackupService.cpp
diff --git a/bin/bbackupd/Win32BackupService.h b/lib/bbackupd/Win32BackupService.h
index e7f077f2..e7f077f2 100644
--- a/bin/bbackupd/Win32BackupService.h
+++ b/lib/bbackupd/Win32BackupService.h
diff --git a/bin/bbackupd/Win32ServiceFunctions.cpp b/lib/bbackupd/Win32ServiceFunctions.cpp
index 2df914a7..2df914a7 100644
--- a/bin/bbackupd/Win32ServiceFunctions.cpp
+++ b/lib/bbackupd/Win32ServiceFunctions.cpp
diff --git a/bin/bbackupd/Win32ServiceFunctions.h b/lib/bbackupd/Win32ServiceFunctions.h
index e04c368f..e04c368f 100644
--- a/bin/bbackupd/Win32ServiceFunctions.h
+++ b/lib/bbackupd/Win32ServiceFunctions.h
diff --git a/bin/bbackupquery/BackupQueries.cpp b/lib/bbackupquery/BackupQueries.cpp
index bcb1827e..bcb1827e 100644
--- a/bin/bbackupquery/BackupQueries.cpp
+++ b/lib/bbackupquery/BackupQueries.cpp
diff --git a/bin/bbackupquery/BackupQueries.h b/lib/bbackupquery/BackupQueries.h
index 96df34f5..96df34f5 100644
--- a/bin/bbackupquery/BackupQueries.h
+++ b/lib/bbackupquery/BackupQueries.h
diff --git a/bin/bbackupquery/BoxBackupCompareParams.h b/lib/bbackupquery/BoxBackupCompareParams.h
index 655df947..655df947 100644
--- a/bin/bbackupquery/BoxBackupCompareParams.h
+++ b/lib/bbackupquery/BoxBackupCompareParams.h
diff --git a/bin/bbackupquery/CommandCompletion.cpp b/lib/bbackupquery/CommandCompletion.cpp
index 761fc97e..761fc97e 100644
--- a/bin/bbackupquery/CommandCompletion.cpp
+++ b/lib/bbackupquery/CommandCompletion.cpp
diff --git a/bin/bbackupquery/documentation.txt b/lib/bbackupquery/documentation.txt
index b16a6f7c..b16a6f7c 100644
--- a/bin/bbackupquery/documentation.txt
+++ b/lib/bbackupquery/documentation.txt
diff --git a/bin/bbackupquery/makedocumentation.pl.in b/lib/bbackupquery/makedocumentation.pl.in
index 530c4ff6..530c4ff6 100755
--- a/bin/bbackupquery/makedocumentation.pl.in
+++ b/lib/bbackupquery/makedocumentation.pl.in
diff --git a/lib/common/NamedLock.cpp b/lib/common/NamedLock.cpp
index 8cacf065..e440408e 100644
--- a/lib/common/NamedLock.cpp
+++ b/lib/common/NamedLock.cpp
@@ -82,6 +82,9 @@ bool NamedLock::TryAndGetLock(const std::string& rFilename, int mode)
#if HAVE_DECL_O_EXLOCK
flags |= O_NONBLOCK | O_EXLOCK;
BOX_TRACE("Trying to create lockfile " << rFilename << " using O_EXLOCK");
+#elif defined BOX_OPEN_LOCK
+ flags |= BOX_OPEN_LOCK;
+ BOX_TRACE("Trying to create lockfile " << rFilename << " using BOX_OPEN_LOCK");
#elif !HAVE_DECL_F_SETLK && !defined HAVE_FLOCK
// We have no other way to get a lock, so all we can do is fail if
// the file already exists, and take the risk of stale locks.
diff --git a/lib/common/Test.cpp b/lib/common/Test.cpp
index 9385d8c3..df2c3bc6 100644
--- a/lib/common/Test.cpp
+++ b/lib/common/Test.cpp
@@ -22,7 +22,9 @@
#endif
#include "BoxTime.h"
+#include "FileStream.h"
#include "Test.h"
+#include "Utils.h"
int num_tests_selected = 0;
int num_failures = 0;
@@ -81,6 +83,60 @@ bool setUp(const char* function_name)
}
}
+#ifdef _MSC_VER
+ DIR* pDir = opendir("testfiles");
+ if(!pDir)
+ {
+ THROW_SYS_FILE_ERROR("Failed to open test temporary directory",
+ "testfiles", CommonException, Internal);
+ }
+ struct dirent* pEntry;
+ for(pEntry = readdir(pDir); pEntry; pEntry = readdir(pDir))
+ {
+ std::string filename = pEntry->d_name;
+ if(StartsWith("TestDir", filename) ||
+ StartsWith("0_", filename) ||
+ filename == "accounts.txt" ||
+ StartsWith("file", filename) ||
+ StartsWith("notifyran", filename) ||
+ StartsWith("notifyscript.tag", filename) ||
+ StartsWith("restore", filename) ||
+ filename == "bbackupd-data" ||
+ filename == "syncallowscript.control" ||
+ StartsWith("syncallowscript.notifyran.", filename) ||
+ filename == "test2.downloaded")
+ {
+ int filetype = ObjectExists(std::string("testfiles/") + filename);
+ if(filetype == ObjectExists_File)
+ {
+ if(!::unlink(filename.c_str()))
+ {
+ TEST_FAIL_WITH_MESSAGE(BOX_SYS_ERROR_MESSAGE("Failed to delete "
+ "test fixture file: unlink(\"" << filename << "\")"));
+ }
+ }
+ else if(filetype == ObjectExists_Dir)
+ {
+ std::string cmd = "rmdir /s /q testfiles\\" + filename;
+ int status = system(cmd.c_str());
+ if(status != 0)
+ {
+ TEST_FAIL_WITH_MESSAGE("Failed to delete test fixture "
+ "file: command '" << cmd << "' exited with "
+ "status " << status);
+ }
+ }
+ else
+ {
+ TEST_FAIL_WITH_MESSAGE("Don't know how to delete file " << filename <<
+ " of type " << filetype);
+ }
+ }
+ }
+ closedir(pDir);
+ FileStream touch("testfiles/accounts.txt", O_WRONLY | O_CREAT | O_TRUNC,
+ S_IRUSR | S_IWUSR);
+#else
TEST_THAT_THROWONFAIL(system(
"rm -rf testfiles/TestDir* testfiles/0_0 testfiles/0_1 "
"testfiles/0_2 testfiles/accounts.txt " // testfiles/test* .tgz!
@@ -91,11 +147,12 @@ bool setUp(const char* function_name)
"testfiles/syncallowscript.notifyran.* "
"testfiles/test2.downloaded"
) == 0);
+ TEST_THAT_THROWONFAIL(system("touch testfiles/accounts.txt") == 0);
+#endif
TEST_THAT_THROWONFAIL(mkdir("testfiles/0_0", 0755) == 0);
TEST_THAT_THROWONFAIL(mkdir("testfiles/0_1", 0755) == 0);
TEST_THAT_THROWONFAIL(mkdir("testfiles/0_2", 0755) == 0);
TEST_THAT_THROWONFAIL(mkdir("testfiles/bbackupd-data", 0755) == 0);
- TEST_THAT_THROWONFAIL(system("touch testfiles/accounts.txt") == 0);
return true;
}
diff --git a/lib/win32/emu.cpp b/lib/win32/emu.cpp
index 658bfbbc..65c12b09 100644
--- a/lib/win32/emu.cpp
+++ b/lib/win32/emu.cpp
@@ -613,7 +613,7 @@ HANDLE openfile(const char *pFileName, int flags, int mode)
createDisposition = CREATE_NEW;
}
- if (flags & O_LOCK)
+ if (flags & BOX_OPEN_LOCK)
{
shareMode = 0;
}
diff --git a/lib/win32/emu.h b/lib/win32/emu.h
index b0fa2832..3cc3979c 100644
--- a/lib/win32/emu.h
+++ b/lib/win32/emu.h
@@ -228,7 +228,7 @@ struct dirent *readdir(DIR *dp);
int closedir(DIR *dp);
// local constant to open file exclusively without shared access
-#define O_LOCK 0x10000
+#define BOX_OPEN_LOCK 0x10000
extern DWORD winerrno; /* used to report errors from openfile() */
HANDLE openfile(const char *filename, int flags, int mode);
diff --git a/modules.txt b/modules.txt
index 25a9a979..c5ed163e 100644
--- a/modules.txt
+++ b/modules.txt
@@ -27,19 +27,21 @@ test/basicserver qdbm lib/server
lib/backupstore lib/server lib/raidfile lib/crypto lib/compress lib/httpserver
lib/backupclient lib/backupstore
+lib/bbackupd lib/backupclient qdbm
+lib/bbackupquery lib/backupclient
bin/bbackupobjdump lib/backupclient
bin/bbstored lib/backupstore
bin/bbstoreaccounts lib/backupclient
-bin/bbackupd lib/backupclient qdbm
-bin/bbackupquery lib/backupclient
-bin/bbackupctl lib/backupclient qdbm bin/bbackupd
+bin/bbackupd lib/bbackupd
+bin/bbackupquery lib/bbackupquery
+bin/bbackupctl lib/backupclient qdbm lib/bbackupd
test/backupstore bin/bbstored bin/bbstoreaccounts lib/server lib/backupstore lib/backupclient lib/raidfile
test/backupstorefix bin/bbstored bin/bbstoreaccounts lib/backupclient bin/bbackupquery bin/bbackupd bin/bbackupctl
test/backupstorepatch bin/bbstored bin/bbstoreaccounts lib/backupclient
test/backupdiff lib/backupclient
-test/bbackupd bin/bbackupd bin/bbstored bin/bbstoreaccounts bin/bbackupquery bin/bbackupctl lib/server lib/backupstore lib/backupclient lib/intercept
+test/bbackupd bin/bbackupd bin/bbstored bin/bbstoreaccounts bin/bbackupquery bin/bbackupctl lib/bbackupquery lib/bbackupd lib/server lib/backupstore lib/backupclient lib/intercept
bin/s3simulator lib/httpserver
test/s3store lib/backupclient lib/httpserver bin/s3simulator bin/bbstoreaccounts
diff --git a/test/backupstore/testbackupstore.cpp b/test/backupstore/testbackupstore.cpp
index 00e16ad5..efdef230 100644
--- a/test/backupstore/testbackupstore.cpp
+++ b/test/backupstore/testbackupstore.cpp
@@ -2819,8 +2819,8 @@ bool test_open_files_with_limited_win32_permissions()
DWORD shareMode = FILE_SHARE_READ | FILE_SHARE_WRITE;
HANDLE h1 = CreateFileA(file, accessRights, shareMode,
- NULL, OPEN_ALWAYS, FILE_FLAG_BACKUP_SEMANTICS, NULL);
- assert(h1 != INVALID_HANDLE_VALUE);
+ NULL, OPEN_ALWAYS, // create file if it doesn't exist
+ FILE_FLAG_BACKUP_SEMANTICS, NULL);
TEST_THAT(h1 != INVALID_HANDLE_VALUE);
accessRights = FILE_READ_ATTRIBUTES |
@@ -2828,7 +2828,6 @@ bool test_open_files_with_limited_win32_permissions()
HANDLE h2 = CreateFileA(file, accessRights, shareMode,
NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL);
- assert(h2 != INVALID_HANDLE_VALUE);
TEST_THAT(h2 != INVALID_HANDLE_VALUE);
CloseHandle(h2);
diff --git a/test/bbackupd/testbbackupd.cpp b/test/bbackupd/testbbackupd.cpp
index 4b843e6a..f99ffcb4 100644
--- a/test/bbackupd/testbbackupd.cpp
+++ b/test/bbackupd/testbbackupd.cpp
@@ -35,6 +35,10 @@
#include <signal.h>
#endif
+#ifdef WIN32
+ #include <process.h>
+#endif
+
#include <map>
#ifdef HAVE_SYSCALL
@@ -3895,7 +3899,7 @@ bool test_locked_file_behaviour()
// and the appropriate error is reported.
HANDLE handle = openfile("testfiles/TestDir1/f1.dat",
- O_LOCK, 0);
+ BOX_OPEN_LOCK, 0);
TEST_THAT_OR(handle != INVALID_HANDLE_VALUE, FAIL);
{
@@ -3924,7 +3928,7 @@ bool test_locked_file_behaviour()
// open the file again, compare and check that compare
// reports the correct error message (and finishes)
handle = openfile("testfiles/TestDir1/f1.dat",
- O_LOCK, 0);
+ BOX_OPEN_LOCK, 0);
TEST_THAT_OR(handle != INVALID_HANDLE_VALUE, FAIL);
TEST_COMPARE(Compare_Error);