diff mbox series

[v2,for,3.0,06/16] docker: move make check into check_qemu helper

Message ID 20180713121741.19262-7-alex.bennee@linaro.org
State Superseded
Headers show
Series various docker fixes | expand

Commit Message

Alex Bennée July 13, 2018, 12:17 p.m. UTC
Not all docker images can run the check step. Let's move everything
into a common helper so we don't need to replicate checks in the
future.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>


---
v2
  - add "move" to Let's everything in commit message
---
 tests/docker/common.rc  | 10 ++++++++++
 tests/docker/test-clang |  2 +-
 tests/docker/test-debug |  2 +-
 tests/docker/test-full  |  2 +-
 tests/docker/test-quick |  2 +-
 5 files changed, 14 insertions(+), 4 deletions(-)

-- 
2.17.1

Comments

Philippe Mathieu-Daudé July 17, 2018, 3 a.m. UTC | #1
On 07/13/2018 09:17 AM, Alex Bennée wrote:
> Not all docker images can run the check step. Let's move everything

> into a common helper so we don't need to replicate checks in the

> future.

> 

> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>

> 

> ---

> v2

>   - add "move" to Let's everything in commit message

> ---

>  tests/docker/common.rc  | 10 ++++++++++

>  tests/docker/test-clang |  2 +-

>  tests/docker/test-debug |  2 +-

>  tests/docker/test-full  |  2 +-

>  tests/docker/test-quick |  2 +-

>  5 files changed, 14 insertions(+), 4 deletions(-)

> 

> diff --git a/tests/docker/common.rc b/tests/docker/common.rc

> index ba1f942328..cfc620d554 100755

> --- a/tests/docker/common.rc

> +++ b/tests/docker/common.rc

> @@ -40,6 +40,16 @@ build_qemu()

>      make $MAKEFLAGS

>  }

>  

> +check_qemu()

> +{

> +    if test -z "$@"; then

> +        TEST="check"

> +    else

> +        TEST="$@"


This is a bit confuse:

  check_qemu V=1 -> TEST=V=1

> +    fi

> +    make $MAKEFLAGS $TEST


    -> make V=1

> +}

> +

>  test_fail()

>  {

>      echo "$@"

> diff --git a/tests/docker/test-clang b/tests/docker/test-clang

> index e90a793178..324e341cea 100755

> --- a/tests/docker/test-clang

> +++ b/tests/docker/test-clang

> @@ -23,5 +23,5 @@ OPTS="--cxx=clang++ --cc=clang --host-cc=clang"

>  #OPTS="$OPTS --extra-cflags=-fsanitize=undefined \

>      #--extra-cflags=-fno-sanitize=float-divide-by-zero"

>  build_qemu $OPTS

> -make $MAKEFLAGS check

> +check_qemu

>  install_qemu

> diff --git a/tests/docker/test-debug b/tests/docker/test-debug

> index d3f9f70d01..137f4f2ddc 100755

> --- a/tests/docker/test-debug

> +++ b/tests/docker/test-debug

> @@ -22,5 +22,5 @@ OPTS="--cxx=clang++ --cc=clang --host-cc=clang"

>  OPTS="--enable-debug --enable-sanitizers $OPTS"

>  

>  build_qemu $OPTS

> -make $MAKEFLAGS V=1 check

> +check_qemu check V=1


Gotcha!

>  install_qemu

> diff --git a/tests/docker/test-full b/tests/docker/test-full

> index b4e42d25d7..aadc0f00a2 100755

> --- a/tests/docker/test-full

> +++ b/tests/docker/test-full

> @@ -15,4 +15,4 @@

>  

>  cd "$BUILD_DIR"

>  

> -build_qemu && make check $MAKEFLAGS && install_qemu

> +build_qemu && check_qemu && install_qemu

> diff --git a/tests/docker/test-quick b/tests/docker/test-quick

> index 3b7bce6105..eee59c55fb 100755

> --- a/tests/docker/test-quick

> +++ b/tests/docker/test-quick

> @@ -18,5 +18,5 @@ cd "$BUILD_DIR"

>  DEF_TARGET_LIST="x86_64-softmmu,aarch64-softmmu"

>  TARGET_LIST=${TARGET_LIST:-$DEF_TARGET_LIST} \

>  build_qemu

> -make check $MAKEFLAGS

> +check_qemu

>  install_qemu

>
Alex Bennée July 17, 2018, 9:59 a.m. UTC | #2
Philippe Mathieu-Daudé <f4bug@amsat.org> writes:

> On 07/13/2018 09:17 AM, Alex Bennée wrote:

>> Not all docker images can run the check step. Let's move everything

>> into a common helper so we don't need to replicate checks in the

>> future.

>>

>> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>

>>

>> ---

>> v2

>>   - add "move" to Let's everything in commit message

>> ---

>>  tests/docker/common.rc  | 10 ++++++++++

>>  tests/docker/test-clang |  2 +-

>>  tests/docker/test-debug |  2 +-

>>  tests/docker/test-full  |  2 +-

>>  tests/docker/test-quick |  2 +-

>>  5 files changed, 14 insertions(+), 4 deletions(-)

>>

>> diff --git a/tests/docker/common.rc b/tests/docker/common.rc

>> index ba1f942328..cfc620d554 100755

>> --- a/tests/docker/common.rc

>> +++ b/tests/docker/common.rc

>> @@ -40,6 +40,16 @@ build_qemu()

>>      make $MAKEFLAGS

>>  }

>>

>> +check_qemu()

>> +{

>> +    if test -z "$@"; then

>> +        TEST="check"

>> +    else

>> +        TEST="$@"

>

> This is a bit confuse:

>

>   check_qemu V=1 -> TEST=V=1

>

>> +    fi

>> +    make $MAKEFLAGS $TEST

>

>     -> make V=1


How about s/TEST/INVOCATION/?

>

>> +}

>> +

>>  test_fail()

>>  {

>>      echo "$@"

>> diff --git a/tests/docker/test-clang b/tests/docker/test-clang

>> index e90a793178..324e341cea 100755

>> --- a/tests/docker/test-clang

>> +++ b/tests/docker/test-clang

>> @@ -23,5 +23,5 @@ OPTS="--cxx=clang++ --cc=clang --host-cc=clang"

>>  #OPTS="$OPTS --extra-cflags=-fsanitize=undefined \

>>      #--extra-cflags=-fno-sanitize=float-divide-by-zero"

>>  build_qemu $OPTS

>> -make $MAKEFLAGS check

>> +check_qemu

>>  install_qemu

>> diff --git a/tests/docker/test-debug b/tests/docker/test-debug

>> index d3f9f70d01..137f4f2ddc 100755

>> --- a/tests/docker/test-debug

>> +++ b/tests/docker/test-debug

>> @@ -22,5 +22,5 @@ OPTS="--cxx=clang++ --cc=clang --host-cc=clang"

>>  OPTS="--enable-debug --enable-sanitizers $OPTS"

>>

>>  build_qemu $OPTS

>> -make $MAKEFLAGS V=1 check

>> +check_qemu check V=1

>

> Gotcha!

>

>>  install_qemu

>> diff --git a/tests/docker/test-full b/tests/docker/test-full

>> index b4e42d25d7..aadc0f00a2 100755

>> --- a/tests/docker/test-full

>> +++ b/tests/docker/test-full

>> @@ -15,4 +15,4 @@

>>

>>  cd "$BUILD_DIR"

>>

>> -build_qemu && make check $MAKEFLAGS && install_qemu

>> +build_qemu && check_qemu && install_qemu

>> diff --git a/tests/docker/test-quick b/tests/docker/test-quick

>> index 3b7bce6105..eee59c55fb 100755

>> --- a/tests/docker/test-quick

>> +++ b/tests/docker/test-quick

>> @@ -18,5 +18,5 @@ cd "$BUILD_DIR"

>>  DEF_TARGET_LIST="x86_64-softmmu,aarch64-softmmu"

>>  TARGET_LIST=${TARGET_LIST:-$DEF_TARGET_LIST} \

>>  build_qemu

>> -make check $MAKEFLAGS

>> +check_qemu

>>  install_qemu

>>



--
Alex Bennée
Philippe Mathieu-Daudé July 17, 2018, 2:56 p.m. UTC | #3
On 07/17/2018 06:59 AM, Alex Bennée wrote:
> Philippe Mathieu-Daudé <f4bug@amsat.org> writes:

>> On 07/13/2018 09:17 AM, Alex Bennée wrote:

>>> Not all docker images can run the check step. Let's move everything

>>> into a common helper so we don't need to replicate checks in the

>>> future.

>>>

>>> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>

>>>

>>> ---

>>> v2

>>>   - add "move" to Let's everything in commit message

>>> ---

>>>  tests/docker/common.rc  | 10 ++++++++++

>>>  tests/docker/test-clang |  2 +-

>>>  tests/docker/test-debug |  2 +-

>>>  tests/docker/test-full  |  2 +-

>>>  tests/docker/test-quick |  2 +-

>>>  5 files changed, 14 insertions(+), 4 deletions(-)

>>>

>>> diff --git a/tests/docker/common.rc b/tests/docker/common.rc

>>> index ba1f942328..cfc620d554 100755

>>> --- a/tests/docker/common.rc

>>> +++ b/tests/docker/common.rc

>>> @@ -40,6 +40,16 @@ build_qemu()

>>>      make $MAKEFLAGS

>>>  }

>>>

>>> +check_qemu()

>>> +{

>>> +    if test -z "$@"; then

>>> +        TEST="check"

>>> +    else

>>> +        TEST="$@"

>>

>> This is a bit confuse:

>>

>>   check_qemu V=1 -> TEST=V=1

>>

>>> +    fi

>>> +    make $MAKEFLAGS $TEST

>>

>>     -> make V=1

> 

> How about s/TEST/INVOCATION/?


INVOCATION or make $MAKEFLAGS ${@:-check}:

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>


>>

>>> +}

>>> +

>>>  test_fail()

>>>  {

>>>      echo "$@"

>>> diff --git a/tests/docker/test-clang b/tests/docker/test-clang

>>> index e90a793178..324e341cea 100755

>>> --- a/tests/docker/test-clang

>>> +++ b/tests/docker/test-clang

>>> @@ -23,5 +23,5 @@ OPTS="--cxx=clang++ --cc=clang --host-cc=clang"

>>>  #OPTS="$OPTS --extra-cflags=-fsanitize=undefined \

>>>      #--extra-cflags=-fno-sanitize=float-divide-by-zero"

>>>  build_qemu $OPTS

>>> -make $MAKEFLAGS check

>>> +check_qemu

>>>  install_qemu

>>> diff --git a/tests/docker/test-debug b/tests/docker/test-debug

>>> index d3f9f70d01..137f4f2ddc 100755

>>> --- a/tests/docker/test-debug

>>> +++ b/tests/docker/test-debug

>>> @@ -22,5 +22,5 @@ OPTS="--cxx=clang++ --cc=clang --host-cc=clang"

>>>  OPTS="--enable-debug --enable-sanitizers $OPTS"

>>>

>>>  build_qemu $OPTS

>>> -make $MAKEFLAGS V=1 check

>>> +check_qemu check V=1

>>

>> Gotcha!

>>

>>>  install_qemu

>>> diff --git a/tests/docker/test-full b/tests/docker/test-full

>>> index b4e42d25d7..aadc0f00a2 100755

>>> --- a/tests/docker/test-full

>>> +++ b/tests/docker/test-full

>>> @@ -15,4 +15,4 @@

>>>

>>>  cd "$BUILD_DIR"

>>>

>>> -build_qemu && make check $MAKEFLAGS && install_qemu

>>> +build_qemu && check_qemu && install_qemu

>>> diff --git a/tests/docker/test-quick b/tests/docker/test-quick

>>> index 3b7bce6105..eee59c55fb 100755

>>> --- a/tests/docker/test-quick

>>> +++ b/tests/docker/test-quick

>>> @@ -18,5 +18,5 @@ cd "$BUILD_DIR"

>>>  DEF_TARGET_LIST="x86_64-softmmu,aarch64-softmmu"

>>>  TARGET_LIST=${TARGET_LIST:-$DEF_TARGET_LIST} \

>>>  build_qemu

>>> -make check $MAKEFLAGS

>>> +check_qemu

>>>  install_qemu

>>>

> 

> 

> --

> Alex Bennée

>
diff mbox series

Patch

diff --git a/tests/docker/common.rc b/tests/docker/common.rc
index ba1f942328..cfc620d554 100755
--- a/tests/docker/common.rc
+++ b/tests/docker/common.rc
@@ -40,6 +40,16 @@  build_qemu()
     make $MAKEFLAGS
 }
 
+check_qemu()
+{
+    if test -z "$@"; then
+        TEST="check"
+    else
+        TEST="$@"
+    fi
+    make $MAKEFLAGS $TEST
+}
+
 test_fail()
 {
     echo "$@"
diff --git a/tests/docker/test-clang b/tests/docker/test-clang
index e90a793178..324e341cea 100755
--- a/tests/docker/test-clang
+++ b/tests/docker/test-clang
@@ -23,5 +23,5 @@  OPTS="--cxx=clang++ --cc=clang --host-cc=clang"
 #OPTS="$OPTS --extra-cflags=-fsanitize=undefined \
     #--extra-cflags=-fno-sanitize=float-divide-by-zero"
 build_qemu $OPTS
-make $MAKEFLAGS check
+check_qemu
 install_qemu
diff --git a/tests/docker/test-debug b/tests/docker/test-debug
index d3f9f70d01..137f4f2ddc 100755
--- a/tests/docker/test-debug
+++ b/tests/docker/test-debug
@@ -22,5 +22,5 @@  OPTS="--cxx=clang++ --cc=clang --host-cc=clang"
 OPTS="--enable-debug --enable-sanitizers $OPTS"
 
 build_qemu $OPTS
-make $MAKEFLAGS V=1 check
+check_qemu check V=1
 install_qemu
diff --git a/tests/docker/test-full b/tests/docker/test-full
index b4e42d25d7..aadc0f00a2 100755
--- a/tests/docker/test-full
+++ b/tests/docker/test-full
@@ -15,4 +15,4 @@ 
 
 cd "$BUILD_DIR"
 
-build_qemu && make check $MAKEFLAGS && install_qemu
+build_qemu && check_qemu && install_qemu
diff --git a/tests/docker/test-quick b/tests/docker/test-quick
index 3b7bce6105..eee59c55fb 100755
--- a/tests/docker/test-quick
+++ b/tests/docker/test-quick
@@ -18,5 +18,5 @@  cd "$BUILD_DIR"
 DEF_TARGET_LIST="x86_64-softmmu,aarch64-softmmu"
 TARGET_LIST=${TARGET_LIST:-$DEF_TARGET_LIST} \
 build_qemu
-make check $MAKEFLAGS
+check_qemu
 install_qemu