diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 90ba2b60811081530bbb0838291c460885e74746..fc01ebef8b0214aa8e372df7f9bd092785e8140d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,8 +1,9 @@ stages: - - Initialization - - Configures - - Builds - - Finalization + - initialization + - configure + - build + - test + - finalization .main_tests: &main_tests tags: @@ -18,16 +19,16 @@ stages: ### Initialization and Finalization ############# ################################################# -Env Sanitize: +env_sanitize: <<: *main_tests - stage: Initialization + stage: initialization script: - mkdir -p $HOME/$CI_PIPELINE_ID/{build.clang,build.gcc,install.clang,install.gcc} - echo "Env is intialized" -Env Finalize: +env_finalize: <<: *main_tests - stage: Finalization + stage: finalization allow_failure: true when: always script: @@ -37,16 +38,16 @@ Env Finalize: ### Configures ################################## ################################################# -Configure with gcc: +configure_gcc: <<: *main_tests - stage: Configures + stage: configure script: - cd $HOME/$CI_PIPELINE_ID/ - scripts/validate.bash --compiler=clang --debug --static-modules --step=configure -Configure with clang: +configure_clang: <<: *main_tests - stage: Configures + stage: configure script: - cd $HOME/$CI_PIPELINE_ID/ - scripts/validate.bash --compiler=clang --debug --static-modules --step=configure @@ -55,16 +56,27 @@ Configure with clang: ### Builds ###################################### ################################################# -Build with gcc: +build_gcc: <<: *main_tests - stage: Builds + stage: build script: - cd $HOME/$CI_PIPELINE_ID/ - scripts/validate.bash --compiler=gcc --step=build -Build with clang: +build_clang: <<: *main_tests - stage: Builds + stage: build script: - cd $HOME/$CI_PIPELINE_ID/build.clang - scripts/validate.bash --compiler=clang --step=build + +################################################# +### Tests ####################################### +################################################# + +test_basic: + <<: *main_tests + stage: test + script: + - cd $HOME/$CI_PIPELINE_ID/build.clang + - scripts/validate.bash --compiler=clang --step=launch --test=simple diff --git a/scripts/validate.bash b/scripts/validate.bash index 12907fa7648a71f566de5b1ca3a4ba5e84bbecf6..996cab2a3a0ba44e6b8e121010f6b89e9fae90d6 100644 --- a/scripts/validate.bash +++ b/scripts/validate.bash @@ -15,6 +15,18 @@ LKT_CONFIGURE_OPTIONS="" # Options to pass to the configure command LKT_CORE_NUMBER=4 # Number of cores to use with make LKT_TEST="" # Which tests to perform +### AVAILABLE TESTS ########################################################## + +function test_simple () +{ + check_cd $LKT_DIR/install.$LKT_COMPILER/ + ./lektord & + local _child_pid=$! + ./lkt pwd=hashire adm kil + sleep 5 + kill $_child_pid +} + ### Utility functions ######################################################## function die () { @@ -121,7 +133,12 @@ function do_steps () function do_launch () { check_cd $LKT_DIR - die "No test available" + for test in $LKT_TEST ; do + case "$test" in + simple) test_simple;; + *) die "Test not available" + esac + done } ### PROCESS ARGS #############################################################