ci: Add check to compile with clang+fuzzer

v2: Fix shell handling

v3: - Use ci job template for build checks
    - rename clang_fuzzer result dir
      (Both suggested by Lepton Wo)

v4: - ci Unify all tests
    - Fix directory (Lepton Wu)

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Lepton Wu <lepton@chromium.org>
macos/master
Gert Wollny 5 years ago
parent 080918e376
commit fe85f247d6
  1. 64
      ci/.gitlab-ci.yml
  2. 28
      ci/run_tests.sh

@ -60,8 +60,8 @@ build docker image:
paths: paths:
- results/ - results/
make check:
stage: sanity test .tests_base:
services: services:
- docker:dind - docker:dind
before_script: before_script:
@ -72,7 +72,7 @@ make check:
$RD_CONFIG $RD_CONFIG
-v $PWD:/virglrenderer -v $PWD:/virglrenderer
$CI_REGISTRY_IMAGE@$DOCKER_IMAGE_DIGEST $CI_REGISTRY_IMAGE@$DOCKER_IMAGE_DIGEST
bash -c "/virglrenderer/ci/run_tests.sh --make-check" bash -c "/virglrenderer/ci/run_tests.sh $TEST_SUITE"
- echo -e "\nThat's all folks\n" - echo -e "\nThat's all folks\n"
only: only:
- branches - branches
@ -85,54 +85,28 @@ make check:
paths: paths:
- results/ - results/
make check meson: .make_check_base:
stage: sanity test stage: sanity test
services: extends: .tests_base
- docker:dind
before_script:
*docker-setup
script:
- docker run
--ulimit core=99999999999:99999999999
$RD_CONFIG
-v $PWD:/virglrenderer
$CI_REGISTRY_IMAGE@$DOCKER_IMAGE_DIGEST
bash -c "/virglrenderer/ci/run_tests.sh --make-check-meson"
- echo -e "\nThat's all folks\n"
only:
- branches
- tags
- merge_requests
- schedules
artifacts: make check:
when: always variables:
paths: TEST_SUITE: '--make-check'
- results/ extends: .make_check_base
mesa check meson:
variables:
TEST_SUITE: '--make-check-meson'
extends: .make_check_base
make check clang-fuzzer:
variables:
TEST_SUITE: '--make-check-clang-fuzzer'
extends: .make_check_base
.tests: .tests:
stage: test stage: test
services: extends: .tests_base
- docker:dind
before_script:
*docker-setup
script:
- docker run
--ulimit core=99999999999:99999999999
$RD_CONFIG
-v $PWD:/virglrenderer
$CI_REGISTRY_IMAGE@$DOCKER_IMAGE_DIGEST
bash -c "/virglrenderer/ci/run_tests.sh $TEST_SUITE"
- echo -e "\nThat's all folks\n"
only:
- merge_requests
- schedules
artifacts:
when: always
paths:
- results/
piglit - gl host: piglit - gl host:
variables: variables:

@ -6,6 +6,10 @@ run_setup()
use_meson=$1 use_meson=$1
if [ "x$2" = "xfuzzer" ]; then
use_clang_fuzzer=1
fi
# Let .gitlab-ci or local ci runner set # Let .gitlab-ci or local ci runner set
# desired thread count # desired thread count
NUM_THREADS=${NUM_THREADS:-$(expr $(expr $(nproc) / 8) + 1)} NUM_THREADS=${NUM_THREADS:-$(expr $(expr $(nproc) / 8) + 1)}
@ -56,7 +60,12 @@ run_setup()
if [ -d "$VIRGL_PATH" ]; then if [ -d "$VIRGL_PATH" ]; then
cd $VIRGL_PATH cd $VIRGL_PATH
mkdir build mkdir build
meson build/ -Dprefix=/usr/local -Ddebug=true -Dtests=true --fatal-meson-warnings if [ "x$use_clang_fuzzer" = "x1" ]; then
CC=clang-8
FUZZER=-Dfuzzer=true
fi
meson build/ -Dprefix=/usr/local -Ddebug=true -Dtests=true --fatal-meson-warnings $FUZZER
ninja -C build -j$NUM_THREADS install ninja -C build -j$NUM_THREADS install
fi fi
fi fi
@ -91,6 +100,19 @@ run_make_check_meson()
) )
} }
run_make_check_clang_fuzzer()
{
run_setup meson fuzzer
(
cd /virglrenderer/build
mkdir -p /virglrenderer/results/make_check_clang_fuzzer
VRENDTEST_USE_EGL_SURFACELESS=1 ninja -j$NUM_THREADS test
RET=$?
cp /virglrenderer/build/meson-logs/testlog.txt /virglrenderer/results/make_check_clang_fuzzer/
return $RET
)
}
run_deqp() run_deqp()
{ {
run_setup meson run_setup meson
@ -170,6 +192,10 @@ parse_input()
run_make_check_meson run_make_check_meson
;; ;;
--make-check-clang-fuzzer)
run_make_check_clang_fuzzer
;;
--deqp-gl-gl-tests) --deqp-gl-gl-tests)
run_deqp gl gl run_deqp gl gl
;; ;;

Loading…
Cancel
Save