Commit e44d37ba authored by Esquis Benjamin's avatar Esquis Benjamin

Merge branch '174-release-4-2-1' into 'master'

Resolve "Release 4.2.1"

See merge request !147
parents 0b52a343 aff5871f
Pipeline #6995 canceled with stages
in 11 minutes and 26 seconds

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.
variables:
BUILD_ENV_REGISTRY: $CI_REGISTRY/maja/maja-build-env
stages:
- prepare
- build
- validation
# ---------------------------- fast pipeline ----------------------------------
prepare-centos7:
stage: prepare
image:
name: gcr.io/kaniko-project/executor:debug-v0.16.0
entrypoint: [""]
tags:
- docker
except:
- schedules
- web
before_script:
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}"
> /kaniko/.docker/config.json
- sed -i "s,^FROM maja-build-env,FROM $BUILD_ENV_REGISTRY/maja-env-centos:7," SuperBuild/CentOS_7/Dockerfile
script:
- echo $CI_COMMIT_SHA > sha1.txt
- /kaniko/executor --cleanup
--cache=true
--cache-repo=$CI_REGISTRY_IMAGE/maja-cots-centos7-cache
--verbosity warn
--dockerfile $CI_PROJECT_DIR/SuperBuild/CentOS_7/Dockerfile
--context $CI_PROJECT_DIR
--destination $CI_REGISTRY_IMAGE/maja-cots-centos7:$CI_COMMIT_REF_NAME
only:
changes:
- SuperBuild/**/*
- CMakeConfig/CommonCmakeOptions.cmake
- CMakeConfig/MAJAConfigurationSetting.cmake
- .gitlab-ci.yml
prepare-ubuntu18:
stage: prepare
image:
name: gcr.io/kaniko-project/executor:debug-v0.16.0
entrypoint: [""]
tags:
- docker
except:
- schedules
- web
before_script:
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}"
> /kaniko/.docker/config.json
- sed -i "s,^FROM maja-build-env,FROM $BUILD_ENV_REGISTRY/maja-env-ubuntu:18.04," SuperBuild/Ubuntu_18.04/Dockerfile
script:
- /kaniko/executor --cleanup
--cache=true
--cache-repo=$CI_REGISTRY_IMAGE/maja-cots-ubuntu18-cache
--verbosity warn
--dockerfile $CI_PROJECT_DIR/SuperBuild/Ubuntu_18.04/Dockerfile
--context $CI_PROJECT_DIR
--destination $CI_REGISTRY_IMAGE/maja-cots-ubuntu18:$CI_COMMIT_REF_NAME
only:
changes:
- SuperBuild/**/*
- CMakeConfig/CommonCmakeOptions.cmake
- CMakeConfig/MAJAConfigurationSetting.cmake
- .gitlab-ci.yml
build-centos7:
stage: build
image: $CI_REGISTRY_IMAGE/maja-cots-centos7:$CI_COMMIT_REF_NAME
timeout: 1h 15m
tags:
- docker
except:
- schedules
- web
variables:
OTB_MAX_RAM_HINT: 20000
ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS: 8
script:
- echo $CI_COMMIT_SHA > sha1.txt
- ctest -V -S CI/maja_build.cmake
- ctest -VV -S CI/maja_pkg.cmake
- time rclone copy s3_otb:maja-data/TVA data/TVA
- time rclone copy s3_otb:maja-data/cropped_context/TV/SENTINEL2_MUSCATE data/TV/SENTINEL2_MUSCATE
- time rclone copy s3_otb:maja-data/TU data/TU
- cd build
- ctest -V -N -R pyTv- > ../tv_content.txt
- ctest -R pyTv-S2-L2INIT-012-SENTINEL2-MUSCATE-NEWCAMS
- ctest -R pyTv-S2-L2NOMINAL-011-F-N-SENTINEL2_MUSCATE-GENERAL
- ctest -E pyTv
- cd ..
- ls -lh build/Testing/*-*/
# Filter tv_content.txt to be used in a different job
- sed -i "s,$(pwd)/data,\$MAJA_DATA,g" tv_content.txt
- sed -i "s,$(pwd)/build/Testing/Temporary,\$MAJA_TEST_OUTPUT_ROOT,g" tv_content.txt
- sed -i "s,/opt/cots/maja/[0-9]*\.[0-9]*\.[0-9]*/bin,\$MAJA_BIN,g" tv_content.txt
- sed -i "s,$(pwd)/build/bin,\$MAJA_BIN,g" tv_content.txt
- sed -i "s,$(pwd)/orchestrator/launcher,\$MAJA_LAUNCHER_PYTHON,g" tv_content.txt
artifacts:
expire_in: 20 days
when: on_success
paths:
- sha1.txt
- tv_content.txt
- build-pkg/*.run
# ---------------------------- heavy pipeline ----------------------------------
tv-centos7:
stage: validation
image: $BUILD_ENV_REGISTRY/maja-env-centos:7
timeout: 20h
tags:
- docker
- heavy-task
only:
- schedules
- web
variables:
MAJA_DATA: "data"
MAJA_TEST_OUTPUT_ROOT: "test_output"
MAJA_BIN: "/opt/maja/bin"
MAJA_LAUNCHER_PYTHON: "/opt/maja/lib/python/orchestrator/launcher"
OTB_MAX_RAM_HINT: 40000
ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS: 16
script:
- 'curl --location --output artifacts.zip --header "PRIVATE-TOKEN: $MAJA_ARTIFACTS" "https://gitlab.orfeo-toolbox.org/api/v4/projects/$CI_PROJECT_ID/jobs/artifacts/$CI_COMMIT_REF_NAME/download?job=build-centos7"'
- file artifacts.zip
- unzip artifacts.zip
- mkdir test_output
- mkdir /opt/maja
- chmod +x build-pkg/*.run
- $(ls build-pkg/*.run) --target /opt/maja
- ln -s /opt/maja/bin/python3.7 /opt/maja/bin/python3
- source /opt/maja/bin/.majaenv.sh
- time rclone copy s3_otb:maja-data/TV/SENTINEL2_MUSCATE data/TV/SENTINEL2_MUSCATE
- time rclone copy s3_otb:maja-data/TV/SENTINEL2 data/TV/SENTINEL2
- time rclone copy s3_otb:maja-data/TV/LANDSAT8 data/TV/LANDSAT8
- time rclone copy s3_otb:maja-data/TV/VENUS data/TV/VENUS
- CI/run_tv.sh tv_content.txt
artifacts:
expire_in: 20 days
when: on_failure
paths:
- logs/*.log
#!/bin/bash
#
# Copyright (C) 2020 Centre National d'Etudes Spatiales (CNES)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
#
# select platform
if [ "$1" == "xenial" ]; then
......
import os
import re
import subprocess
import sys
import fiona as fiona
import rasterio
from rasterio.windows import Window
import rasterio.features
import rasterio.warp
import rasterio.mask
from lxml import etree
import shutil
def create_roi(product_path, vector_file, window):
print('Crop window', window)
file_in = None
for pth in os.listdir(product_path):
if os.path.splitext(pth)[1] == '.TIF':
file_in = os.path.join(product_path, pth)
print('Crop input TIF:', file_in)
with rasterio.open(file_in) as src:
kwargs = src.meta.copy()
gt = rasterio.windows.transform(window, src.transform)
kwargs.update({
'height': window.height,
'width': window.width,
'transform': gt })
file_out = os.path.join(os.path.dirname(vector_file), 'temp.tif')
with rasterio.open(file_out, 'w', **kwargs) as dst:
dst.write(src.read(window=window))
subprocess.call(['gdaltindex', vector_file, file_out])
os.remove(file_out)
return gt
def crop_product_images(output_path, product_path, shp_file):
out_product_path = os.path.join(output_path, os.path.basename(product_path))
os.makedirs(out_product_path)
for pth in os.listdir(product_path):
file_in = os.path.join(product_path, pth)
if os.path.splitext(pth)[1] == '.TIF':
with fiona.open(shp_file, "r") as shapefile:
shapes = [feature["geometry"] for feature in shapefile]
file_out = os.path.join(out_product_path, pth)
with rasterio.open(file_in) as src:
out_image, out_transform = rasterio.mask.mask(src, shapes, crop=True)
out_meta = src.meta
out_meta.update({"driver": "GTiff",
"height": out_image.shape[1],
"width": out_image.shape[2],
"transform": out_transform})
with rasterio.open(file_out, "w", **out_meta) as dest:
dest.write(out_image)
else:
shutil.copy(file_in, out_product_path)
def main(context_dir, product_type, output_path=None, offset=10, crop_size=480):
if output_path is None:
output_path = os.path.join(os.path.dirname(context_dir),
os.path.basename(context_dir) + '_cropped')
os.makedirs(output_path, exist_ok=True)
product_dir_pattern = {
'LANDSAT8': 'LC08_*',
'LANDSAT8_MUSCATE': 'LANDSAT8*_L1C_*',
'SENTINEL2': 'S2A*.SAFE'
}
window = Window(offset, offset, crop_size, crop_size)
vector_file = os.path.join(output_path, 'roi.gml')
product_path = get_matching_dirs(context_dir, product_dir_pattern[product_type])[0]
gt = create_roi(product_path, vector_file, window)
ulx = gt[2]
uly = gt[5]
#gdal.Info(vector_file)
for p in os.listdir(context_dir):
abs_path = os.path.join(context_dir, p)
if os.path.isdir(abs_path):
if '_GIP_' in p:
shutil.copytree(abs_path, os.path.join(output_path, p))
elif re.match(product_dir_pattern[product_type], p):
crop_product_images(output_path, abs_path, vector_file)
elif '_AUX_REFDE2_' in p:
crop_product_images(output_path, abs_path, vector_file)
else:
print("unknown directory", abs_path)
else:
if p.endswith('.HDR') and '_AUX_REFDE2_' in p:
print("Fixing", abs_path, '...')
root = etree.fromstring(open(abs_path).read().encode())
xpath = "./Variable_Header/Specific_Product_Header/DEM_Information/Cartographic"
node_carto = root.findall(xpath, namespaces=root.nsmap)[0]
node_ulx = node_carto.findall("./Upper_Left_Corner/X", namespaces=root.nsmap)[0]
node_uly = node_carto.findall("./Upper_Left_Corner/Y", namespaces=root.nsmap)[0]
node_ulx.text = str(ulx)
node_uly.text = str(ulx)
node_lines = node_carto.findall("./Size/Lines", namespaces=root.nsmap)[0]
node_columns = node_carto.findall("./Size/Columns", namespaces=root.nsmap)[0]
node_lines.text = str(crop_size)
node_columns.text = str(crop_size)
with open(os.path.join(output_path, p), 'w') as fp:
##print(etree.tostring(root, pretty_print=True))
fp.write(etree.tostring(root, pretty_print=True).decode())
else:
shutil.copy(abs_path, output_path)
#os.remove(vector_file)
#os.remove(vector_file_xsd)
print('Cropped context in:', output_path)
def get_matching_dirs(context_dir, pattern):
results = []
for root, dirs, files in os.walk(context_dir):
for d in dirs:
if re.match(pattern, d):
results.append(os.path.join(root,d))
return results
if __name__ == '__main__':
if len(sys.argv) < 2:
print("Usage:", sys.argv[0], " <path-to-TV-input-context> <product_type> [output_dir] [offset](default is 10) [crop_size](default is 480)")
print("Usage:", sys.argv[0], "/data/TV/Input/L8-V-L2INIT-001-F-N-LANDSAT8-GENERAL LANDSAT8")
sys.exit(1)
context_dir = sys.argv[1]
product_type = sys.argv[2]
output_dir = None if len(sys.argv) < 4 else sys.argv[3]
offset = 10 if len(sys.argv) < 5 else int(sys.argv[4])
crop_size = 480 if len(sys.argv) < 6 else int(sys.argv[5])
print("using crop offset", offset)
print("using crop size", crop_size)
main(context_dir, product_type, output_dir, offset, crop_size)
#
# Copyright (C) 2020 Centre National d'Etudes Spatiales (CNES)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
get_filename_component(MAJA_SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR} DIRECTORY)
get_filename_component(CI_BASE_DIR ${MAJA_SOURCE_DIR} DIRECTORY)
set (CTEST_PROJECT_NAME "maja")
set ( CTEST_BUILD_CONFIGURATION "Release" )
set ( CTEST_CMAKE_GENERATOR "Unix Makefiles" )
set ( CTEST_BUILD_FLAGS "-j3")
set ( CTEST_CMAKE_GENERATOR "Ninja" )
set ( PROJECT_SOURCE_DIR "${MAJA_SOURCE_DIR}" )
set ( CTEST_SOURCE_DIRECTORY "${MAJA_SOURCE_DIR}" )
set ( CTEST_BINARY_DIRECTORY "${CI_BASE_DIR}/build/" )
set ( CTEST_BINARY_DIRECTORY "${MAJA_SOURCE_DIR}/build/" )
find_program(CTEST_GIT_COMMAND NAMES git git.cmd)
......@@ -18,7 +32,7 @@ execute_process(COMMAND ${CTEST_GIT_COMMAND} log -1 --pretty=format:%h
WORKING_DIRECTORY ${MAJA_SOURCE_DIR}
OUTPUT_VARIABLE ci_short_sha)
# Detect site ( xenial / rh6 / rh7 )
# Detect site ( bionic / xenial / rh6 / rh7 )
if(NOT DEFINED IMAGE_NAME)
if(DEFINED ENV{IMAGE_NAME})
set(IMAGE_NAME $ENV{IMAGE_NAME})
......@@ -33,14 +47,13 @@ message(STATUS "Maja version: ${MAJA_VERSION}")
set (CTEST_BUILD_NAME ${ci_short_sha})
set (CTEST_INSTALL_DIRECTORY "${CI_BASE_DIR}/cots/maja/${MAJA_VERSION}")
set (CTEST_INSTALL_DIRECTORY "/opt/cots/maja/${MAJA_VERSION}")
set (CMAKE_COMMAND "cmake")
set(CTEST_GIT_UPDATE_CUSTOM "${CMAKE_COMMAND}" "-E" "echo" "No update")
# TODO : git clone maja-data
if(NOT EXISTS "${CI_BASE_DIR}/data")
file(MAKE_DIRECTORY "${CI_BASE_DIR}/data")
if(NOT EXISTS "${MAJA_SOURCE_DIR}/data")
file(MAKE_DIRECTORY "${MAJA_SOURCE_DIR}/data")
endif()
ctest_start (Experimental)
......@@ -57,16 +70,13 @@ set (MAJA_CONFIGURE_OPTIONS
"-DCMAKE_PREFIX_PATH:PATH=${CTEST_INSTALL_DIRECTORY}"
"-DCMAKE_INSTALL_PREFIX:PATH=${CTEST_INSTALL_DIRECTORY}"
"-DPYTHON_EXECUTABLE:PATH=${CTEST_INSTALL_DIRECTORY}/bin/python3"
"-DMAJADATA_SOURCE_DIR:PATH=${CI_BASE_DIR}/data"
"-DMAJADATA_SOURCE_DIR:PATH=${MAJA_SOURCE_DIR}/data"
"-DBUILD_TESTING:BOOL=ON"
"-DMAJA_TU_ENABLE_LONG_TESTING:BOOL=OFF"
"-DMAJA_ENABLE_COVERAGE:BOOL=OFF"
"-DMAJA_ENABLE_EXAMPLES:BOOL=ON"
"-DENABLE_TU:BOOL=ON"
"-DENABLE_TVA:BOOL=ON"
#~ "-DTEST_TYPE:STRING=${TEST_TYPE}"
#~ "-DMAJA_TEST_OUTPUT_ROOT:PATH=${MAJA_TEST_OUTPUT_ROOT}"
#~ "-DMAJA_VALIDATION_SRC_DIR:PATH=${MAJA_VALIDATION_SRC_DIR}"
"-DENABLE_TV:BOOL=ON"
"-DMAJA_TEST_OUTPUT_ROOT:PATH=${CTEST_BINARY_DIRECTORY}/Testing/Temporary"
#~ "-DPLUGIN_VENUS:BOOL=${PLUGIN_VENUS}"
#~ "-DPLUGIN_SENTINEL2:BOOL=${PLUGIN_SENTINEL2}"
#~ "-DPLUGIN_SENTINEL2_TM:BOOL=${PLUGIN_SENTINEL2_TM}"
......@@ -107,6 +117,14 @@ if ( ( NOT "${_build_nb_err}" EQUAL 0 ) OR ( "${_build_error}" EQUAL -1 ))
endif()
# run tests
set(_test_rv 0)
#~ ctest_test(PARALLEL_LEVEL 4
#~ RETURN_VALUE _test_rv
#~ CAPTURE_CMAKE_ERROR _test_error
#~ )
if ( NOT _test_rv EQUAL 0 )
message( SEND_ERROR "An error occurs during ctest_test: ${_test_error}")
endif()
#~ ctest_submit()
#
# Copyright (C) 2020 Centre National d'Etudes Spatiales (CNES)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
get_filename_component(MAJA_SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR} DIRECTORY)
get_filename_component(CI_BASE_DIR ${MAJA_SOURCE_DIR} DIRECTORY)
set (CTEST_PROJECT_NAME "maja-pkg")
set ( CTEST_BUILD_CONFIGURATION "Release" )
......@@ -9,7 +23,7 @@ set ( CTEST_BUILD_FLAGS "-j3")
set ( PROJECT_SOURCE_DIR "${MAJA_SOURCE_DIR}" )
set ( CTEST_SOURCE_DIRECTORY "${MAJA_SOURCE_DIR}/Packaging" )
set ( CTEST_BINARY_DIRECTORY "${CI_BASE_DIR}/build-pkg/" )
set ( CTEST_BINARY_DIRECTORY "${MAJA_SOURCE_DIR}/build-pkg/" )
find_program(CTEST_GIT_COMMAND NAMES git git.cmd)
......@@ -18,7 +32,7 @@ execute_process(COMMAND ${CTEST_GIT_COMMAND} log -1 --pretty=format:%h
WORKING_DIRECTORY ${MAJA_SOURCE_DIR}
OUTPUT_VARIABLE ci_short_sha)
# Detect site ( xenial / rh6 / rh7 )
# Detect site ( bionic / xenial / rh6 / rh7 )
if(NOT DEFINED IMAGE_NAME)
if(DEFINED ENV{IMAGE_NAME})
set(IMAGE_NAME $ENV{IMAGE_NAME})
......@@ -33,17 +47,17 @@ message(STATUS "Maja version: ${MAJA_VERSION}")
set (CTEST_BUILD_NAME ${ci_short_sha})
set (CTEST_INSTALL_DIRECTORY "${CI_BASE_DIR}/pkg")
set (CTEST_INSTALL_DIRECTORY "${MAJA_SOURCE_DIR}/pkg")
set (CMAKE_COMMAND "cmake")
set(CTEST_GIT_UPDATE_CUSTOM "${CMAKE_COMMAND}" "-E" "echo" "No update")
# TODO : git clone maja-data
if(NOT EXISTS "${CI_BASE_DIR}/data")
file(MAKE_DIRECTORY "${CI_BASE_DIR}/data")
if(NOT EXISTS "${MAJA_SOURCE_DIR}/data")
file(MAKE_DIRECTORY "${MAJA_SOURCE_DIR}/data")
endif()
if(NOT EXISTS "${CI_BASE_DIR}/superbuild-archives")
file(MAKE_DIRECTORY "${CI_BASE_DIR}/superbuild-archives")
if(NOT EXISTS "${MAJA_SOURCE_DIR}/superbuild-archives")
file(MAKE_DIRECTORY "${MAJA_SOURCE_DIR}/superbuild-archives")
endif()
ctest_start (Experimental)
......@@ -53,10 +67,11 @@ ctest_update( SOURCE "${MAJA_SOURCE_DIR}" )
set (MAJA_PKG_CONFIGURE_OPTIONS
"-DCMAKE_BUILD_TYPE=${CTEST_BUILD_CONFIGURATION}"
"-DCMAKE_INSTALL_PREFIX:PATH=${CTEST_INSTALL_DIRECTORY}"
"-DMAJADATA_SOURCE_DIR:PATH=${CI_BASE_DIR}/data"
"-DSUPERBUILD_BINARY_DIR:PATH=${CI_BASE_DIR}/build"
"-DDOWNLOAD_DIR:PATH=${CI_BASE_DIR}/superbuild-archives"
"-DSUPERBUILD_INSTALL_DIR:PATH=${CI_BASE_DIR}/cots"
"-DMAJADATA_SOURCE_DIR:PATH=${MAJA_SOURCE_DIR}/data"
"-DSUPERBUILD_BINARY_DIR:PATH=${MAJA_SOURCE_DIR}/build"
"-DDOWNLOAD_DIR:PATH=${MAJA_SOURCE_DIR}/superbuild-archives"
"-DSUPERBUILD_INSTALL_DIR:PATH=/opt/cots"
"-DWITH_VALIDATION:BOOL=ON"
)
ctest_configure(BUILD "${CTEST_BINARY_DIRECTORY}"
......@@ -85,5 +100,3 @@ if ( ( NOT "${_build_nb_err}" EQUAL 0 ) OR ( "${_build_error}" EQUAL -1 ))
endif()
#~ ctest_submit()
file(INSTALL "${CTEST_BINARY_DIRECTORY}/" DESTINATION "${CTEST_INSTALL_DIRECTORY}" FILES_MATCHING PATTERN "*.run")
#
# Copyright (C) 2020 Centre National d'Etudes Spatiales (CNES)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
#
# Copyright (C) 2020 Centre National d'Etudes Spatiales (CNES)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
#!/bin/bash
if [ $# -lt 1 ]; then
echo Usage: $0 tv_content.txt
exit 1
fi
echo Run TV
rm -rf logs
rm -rf err_logs
mkdir logs
mkdir err_logs
OLDIFS=$IFS
IFS=$'\n'
for cmd in $(cat $1 | grep 'Test command'); do
TEST_ID=$(echo "$cmd" | cut -d ':' -f 1)
TEST_NAME=$(grep "Test #$TEST_ID:" $1 | cut -d ':' -f 2)
echo "Run #$TEST_ID $TEST_NAME"
echo $cmd | cut -d ' ' -f 4- > logs/${TEST_ID}_${TEST_NAME}.log
bash -c "$(echo $cmd | cut -d ' ' -f 4-)" >> logs/${TEST_ID}_${TEST_NAME}.log 2>&1
RET_CODE=$?
if [ $RET_CODE -ne 0 ]; then cp logs/${TEST_ID}_${TEST_NAME}.log err_logs ; fi
done
IFS=$OLDIFS
NUM_TEST_FAILED=$(ls err_logs | wc -l)
if [ $NUM_TEST_FAILED -ne 0 ]; then
echo $NUM_TEST_FAILED tests failed, check:
ls err_logs
exit 1
fi
echo All tests passed
#
# Copyright (C) 2020 Centre National d'Etudes Spatiales (CNES)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
############################################################################################################
# #
# __ __ __ ____ __ #
......
#
# Copyright (C) 2020 Centre National d'Etudes Spatiales (CNES)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Prefix for MAJA libraries name
SET(MAJA_LIBRARY_PREFIXNAME "Maja")
......@@ -31,9 +47,7 @@ if(NOT hostname_rv EQUAL 0 OR NOT SYSTEM_HOSTNAME)
message(FATAL_ERROR "cannot find system hostname. error=${hostname_rv}")
endif()
set(TEST_TYPE "CHAIN" CACHE STRING "choose one of (CHAIN, COMP_ASCII, COMP_IMAGE)")