Fix samples tests on azure (#10892)
* Fix samples tests on azure * fixed bmp reader
This commit is contained in:
parent
cf80156fcc
commit
bfa0e3e1a4
|
|
@ -133,7 +133,7 @@ jobs:
|
|||
|
||||
- script: |
|
||||
set PATH=$(WORK_DIR)\ninja-win;%PATH%
|
||||
call "$(MSVS_VARS_PATH)" && $(CMAKE_CMD) -G "Ninja Multi-Config" -DENABLE_WHEEL=ON -DENABLE_ONEDNN_FOR_GPU=$(CMAKE_BUILD_SHARED_LIBS) -DENABLE_GAPI_PREPROCESSING=$(CMAKE_BUILD_SHARED_LIBS) -DBUILD_SHARED_LIBS=$(CMAKE_BUILD_SHARED_LIBS) -DENABLE_REQUIREMENTS_INSTALL=OFF -DENABLE_FASTER_BUILD=ON -DCMAKE_BUILD_TYPE=$(BUILD_TYPE) -DENABLE_TESTS=ON -DENABLE_STRICT_DEPENDENCIES=OFF -DENABLE_PYTHON=ON -DPYTHON_EXECUTABLE="C:\hostedtoolcache\windows\Python\3.7.6\x64\python.exe" -DPYTHON_INCLUDE_DIR="C:\hostedtoolcache\windows\Python\3.7.6\x64\include" -DPYTHON_LIBRARY="C:\hostedtoolcache\windows\Python\3.7.6\x64\libs\python37.lib" -DIE_EXTRA_MODULES=$(OPENVINO_CONTRIB_REPO_DIR)\modules -DCMAKE_C_COMPILER:PATH="$(MSVC_COMPILER_PATH)" -DCMAKE_CXX_COMPILER:PATH="$(MSVC_COMPILER_PATH)" $(REPO_DIR)
|
||||
call "$(MSVS_VARS_PATH)" && $(CMAKE_CMD) -G "Ninja Multi-Config" -DENABLE_WHEEL=ON -DENABLE_ONEDNN_FOR_GPU=$(CMAKE_BUILD_SHARED_LIBS) -DBUILD_SHARED_LIBS=$(CMAKE_BUILD_SHARED_LIBS) -DENABLE_REQUIREMENTS_INSTALL=OFF -DENABLE_FASTER_BUILD=ON -DCMAKE_BUILD_TYPE=$(BUILD_TYPE) -DENABLE_TESTS=ON -DENABLE_STRICT_DEPENDENCIES=OFF -DENABLE_PYTHON=ON -DPYTHON_EXECUTABLE="C:\hostedtoolcache\windows\Python\3.7.6\x64\python.exe" -DPYTHON_INCLUDE_DIR="C:\hostedtoolcache\windows\Python\3.7.6\x64\include" -DPYTHON_LIBRARY="C:\hostedtoolcache\windows\Python\3.7.6\x64\libs\python37.lib" -DIE_EXTRA_MODULES=$(OPENVINO_CONTRIB_REPO_DIR)\modules -DCMAKE_C_COMPILER:PATH="$(MSVC_COMPILER_PATH)" -DCMAKE_CXX_COMPILER:PATH="$(MSVC_COMPILER_PATH)" $(REPO_DIR)
|
||||
workingDirectory: $(BUILD_DIR)
|
||||
displayName: 'CMake'
|
||||
|
||||
|
|
@ -167,13 +167,6 @@ jobs:
|
|||
workingDirectory: $(BUILD_SAMPLES_TESTS_DIR)
|
||||
displayName: 'Install Samples Tests'
|
||||
|
||||
- script: $(CMAKE_CMD) -DCMAKE_INSTALL_PREFIX=$(INSTALL_DIR) -DCOMPONENT=tests -P cmake_install.cmake && xcopy $(REPO_DIR)\temp\opencv_4.5.2\opencv\* $(INSTALL_DIR)\opencv\ /e /h /y
|
||||
workingDirectory: $(BUILD_DIR)
|
||||
displayName: 'Install tests'
|
||||
|
||||
- script: dir $(INSTALL_DIR) /s
|
||||
displayName: 'List install files'
|
||||
|
||||
- script: $(INSTALL_DIR)\samples\cpp\build_samples_msvc.bat -i $(INSTALL_DIR)
|
||||
workingDirectory: $(BUILD_SAMPLES_DIR)
|
||||
displayName: 'Build cpp samples'
|
||||
|
|
@ -198,9 +191,15 @@ jobs:
|
|||
python -m pytest $(INSTALL_DIR)\tests\smoke_tests\ --env_conf $(INSTALL_DIR)\tests\smoke_tests\env_config.yml -s --junitxml=TEST-SamplesSmokeTests.xml
|
||||
workingDirectory: $(INSTALL_DIR)
|
||||
displayName: 'Samples Smoke Tests'
|
||||
condition: eq(variables['CMAKE_BUILD_SHARED_LIBS'], 'ON')
|
||||
continueOnError: false
|
||||
|
||||
- script: $(CMAKE_CMD) -DCMAKE_INSTALL_PREFIX=$(INSTALL_DIR) -DCOMPONENT=tests -P cmake_install.cmake && xcopy $(REPO_DIR)\temp\opencv_4.5.2\opencv\* $(INSTALL_DIR)\opencv\ /e /h /y
|
||||
workingDirectory: $(BUILD_DIR)
|
||||
displayName: 'Install tests'
|
||||
|
||||
- script: dir $(INSTALL_DIR) /s
|
||||
displayName: 'List install files'
|
||||
|
||||
- script: rd /Q /S $(BUILD_DIR)
|
||||
displayName: 'Clean build dir'
|
||||
continueOnError: false
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ int readBmpImage(const char* fileName, BitMap* image) {
|
|||
}
|
||||
|
||||
cnt = fread(&image->header.type, sizeof(image->header.type), sizeof(unsigned char), input);
|
||||
if (cnt != sizeof(image->header.type)) {
|
||||
if (cnt != sizeof(unsigned char)) {
|
||||
printf("[BMP] file read error\n");
|
||||
CLEANUP_AND_RETURN(-2);
|
||||
}
|
||||
|
|
@ -40,25 +40,25 @@ int readBmpImage(const char* fileName, BitMap* image) {
|
|||
}
|
||||
|
||||
cnt = fread(&image->header.size, sizeof(image->header.size), sizeof(unsigned char), input);
|
||||
if (cnt != sizeof(image->header.size)) {
|
||||
if (cnt != sizeof(unsigned char)) {
|
||||
printf("[BMP] file read error\n");
|
||||
CLEANUP_AND_RETURN(2);
|
||||
}
|
||||
|
||||
cnt = fread(&image->header.reserved, sizeof(image->header.reserved), sizeof(unsigned char), input);
|
||||
if (cnt != sizeof(image->header.reserved)) {
|
||||
if (cnt != sizeof(unsigned char)) {
|
||||
printf("[BMP] file read error\n");
|
||||
CLEANUP_AND_RETURN(2);
|
||||
}
|
||||
|
||||
cnt = fread(&image->header.offset, sizeof(image->header.offset), sizeof(unsigned char), input);
|
||||
if (cnt != sizeof(image->header.offset)) {
|
||||
if (cnt != sizeof(unsigned char)) {
|
||||
printf("[BMP] file read error\n");
|
||||
CLEANUP_AND_RETURN(2);
|
||||
}
|
||||
|
||||
cnt = fread(&image->infoHeader, sizeof(BmpInfoHeader), sizeof(unsigned char), input);
|
||||
if (cnt != sizeof(image->header.offset)) {
|
||||
if (cnt != sizeof(unsigned char)) {
|
||||
printf("[BMP] file read error\n");
|
||||
CLEANUP_AND_RETURN(2);
|
||||
}
|
||||
|
|
@ -98,13 +98,12 @@ int readBmpImage(const char* fileName, BitMap* image) {
|
|||
for (i = 0; i < image_height; i++) {
|
||||
unsigned int storeAt = image->infoHeader.height < 0 ? i : (unsigned int)image_height - 1 - i;
|
||||
cnt = fread(image->data + row_size * storeAt, row_size, sizeof(unsigned char), input);
|
||||
if (cnt != row_size) {
|
||||
if (cnt != sizeof(unsigned char)) {
|
||||
printf("[BMP] file read error\n");
|
||||
CLEANUP_AND_RETURN(2);
|
||||
}
|
||||
|
||||
cnt = fread(pad, padSize, sizeof(unsigned char), input);
|
||||
if (cnt != padSize) {
|
||||
if ((padSize != 0 && cnt != 0) && (cnt != sizeof(unsigned char))) {
|
||||
printf("[BMP] file read error\n");
|
||||
CLEANUP_AND_RETURN(2);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue