From 8bde6d35045d3268e611e405e0774a8f757fa5ef Mon Sep 17 00:00:00 2001 From: Tristan Cacqueray Date: Thu, 25 Feb 2021 19:15:21 +0000 Subject: [PATCH] cabal-test: add install_args and build_args role var This change adds new role vars to enable setting custom cabal arguments. Change-Id: I4e4174117608bb76ca6e497687753cfdbc3acc02 --- roles/cabal-test/README.rst | 8 ++++++++ roles/cabal-test/defaults/main.yaml | 6 ++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/roles/cabal-test/README.rst b/roles/cabal-test/README.rst index a546de0a9..daf616e07 100644 --- a/roles/cabal-test/README.rst +++ b/roles/cabal-test/README.rst @@ -6,6 +6,14 @@ Run the cabal test command. The cabal target(s) to test. +.. zuul:rolevar:: cabal_install_args + + Install command line arguments, for example to skip executable using "--lib". + +.. zuul:rolevar:: cabal_build_args + + Build command line arguments, for example to write hie files using "-fwrite-ide-info". + .. zuul:rolevar:: zuul_work_dir :default: {{ zuul.project.src_dir }} diff --git a/roles/cabal-test/defaults/main.yaml b/roles/cabal-test/defaults/main.yaml index 7065db023..543a230c5 100644 --- a/roles/cabal-test/defaults/main.yaml +++ b/roles/cabal-test/defaults/main.yaml @@ -1,7 +1,9 @@ cabal_target: "" +cabal_install_args: "" +cabal_build_args: "" zuul_work_dir: "{{ zuul.project.src_dir }}" -_cabal_install_args: "--only-dependencies {{ cabal_target }}" -_cabal_build_args: "--enable-tests {{ cabal_target }}" +_cabal_install_args: "--only-dependencies {{ cabal_install_args }} {{ cabal_target }}" +_cabal_build_args: "--enable-tests {{ cabal_build_args }} {{ cabal_target }}" _cabal_test_args: "{{ cabal_target }}"