diff --git a/.docker/Dockerfile b/.docker/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..35e22aecd002f99ab09ed69060506cea32d143db --- /dev/null +++ b/.docker/Dockerfile @@ -0,0 +1,4 @@ +ARG CI_REGISTRY_IMAGE +FROM $CI_REGISTRY_IMAGE + +# TODO install caosdb-cpplib diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..33eb35cfe783041b0a3380e9710e42d7320e41f8 --- /dev/null +++ b/.gitignore @@ -0,0 +1,145 @@ +# General +build/ +include/libcaosdbConfig.h +.* + +# CMake +CMakeLists.txt.user +CMakeCache.txt +CMakeFiles +CMakeScripts +Testing +Makefile +cmake_install.cmake +install_manifest.txt +compile_commands.json +CTestTestfile.cmake +_deps + +# C +## Prerequisites +*.d + +## Object files +*.o +*.ko +*.obj +*.elf + +## Linker output +*.ilk +*.map +*.exp + +## Precompiled Headers +*.gch +*.pch + +## Libraries +*.lib +*.a +*.la +*.lo + +## Shared objects (inc. Windows DLLs) +*.dll +*.so +*.so.* +*.dylib + +## Executables +*.exe +*.out +*.app +*.i*86 +*.x86_64 +*.hex + +## Debug files +*.dSYM/ +*.su +*.idb +*.pdb + +## Kernel Module Compile Results +*.mod* +*.cmd +.tmp_versions/ +modules.order +Module.symvers +Mkfile.old +dkms.conf + +# VIM +## Swap +[._]*.s[a-v][a-z] +!*.svg # comment out if you don't need vector files +[._]*.sw[a-p] +[._]s[a-rt-v][a-z] +[._]ss[a-gi-z] +[._]sw[a-p] + +## Session +Session.vim +Sessionx.vim + +## Temporary +.netrwhist +*~ +## Auto-generated tag files +tags +## Persistent undo +[._]*.un~ + + +# Emacs +*~ +\#*\# +/.emacs.desktop +/.emacs.desktop.lock +*.elc +auto-save-list +tramp +.\#* + +## Org-mode +.org-id-locations +*_archive + +## flymake-mode +*_flymake.* + +## eshell files +/eshell/history +/eshell/lastdir + +## elpa packages +/elpa/ + +## reftex files +*.rel + +## AUCTeX auto folder +/auto/ + +## cask packages +.cask/ +dist/ + +## Flycheck +flycheck_*.el + +## server auth directory +/server/ + +## projectiles files +.projectile + +## directory configuration +.dir-locals.el + +## network security +/network-security.data + +# Python/Sphinx +env/ diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index bef179f1923a0e350744406689cd3c9c20b64c07..43de815cd90fd67b9e571c222ef5ba0fec15fac1 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -20,13 +20,15 @@ # along with this program. If not, see <https://www.gnu.org/licenses/>. variables: + CI_REGISTRY_IMAGE: $CI_REGISTRY/caosdb/src/caosdb-cpplib/testenv:latest TRIGGERED_BY_REPO: CPPINTTEST - TRIGGERED_BY_REF: 'echo "${TRIGGERED_BY_REF:-$CI_COMMIT_REF_NAME}"' - TRIGGERED_BY_HASH: ${TRIGGERED_BY_HASH:-$CI_COMMIT_SHORT_SHA} + TRIGGERED_BY_REF: $CI_COMMIT_REF_NAME + TRIGGERED_BY_HASH: $CI_COMMIT_SHORT_SHA stages: - setup +# Build a docker image in which tests for this repository can run build-testenv: tags: [cached-dind] image: docker:20.10.6 @@ -35,3 +37,24 @@ build-testenv: needs: [] script: - echo "Pipeline triggered by $TRIGGERED_BY_REPO@$TRIGGERED_BY_REF ($TRIGGERED_BY_HASH)" + - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY + - docker pull $CI_REGISTRY_IMAGE|| true + - docker build + --build-arg CI_REGISTRY_IMAGE=$CI_REGISTRY_IMAGE + --file .docker/Dockerfile + --pull + --cache-from $CI_REGISTRY_IMAGE + --tag $CI_REGISTRY_IMAGE . + - docker push $CI_REGISTRY_IMAGE + + +# run integration tests +test: + tags: [ docker ] + stage: test + script: + - mkdir build + - cd build + - cmake .. + - cmake --build . + - ctest diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..403877b8d9e8bd109a0eba639c31b8ac2139e308 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,30 @@ +# +# This file is a part of the CaosDB Project. +# +# Copyright (C) 2021 Timm Fitschen <t.fitschen@indiscale.com> +# Copyright (C) 2021 IndiScale GmbH <info@indiscale.com> +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see <https://www.gnu.org/licenses/>. +# + +cmake_minimum_required(VERSION 3.15) + +project(libcaosdb_inttests + DESCRIPTION "Integration tests for the C++ client libraries of the CaosDB project which run against the CaosDB server." + LANGUAGES CXX) + +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +enable_testing()