* [kvm-unit-tests PATCH] run scripts: add BUILD_HEAD
@ 2016-03-03 14:33 Andrew Jones
2016-03-03 14:36 ` Paolo Bonzini
0 siblings, 1 reply; 2+ messages in thread
From: Andrew Jones @ 2016-03-03 14:33 UTC (permalink / raw)
To: kvm; +Cc: pbonzini, rkrcmar, pfeiner
Signed-off-by: Andrew Jones <drjones@redhat.com>
---
.gitignore | 1 +
Makefile | 2 ++
run_tests.sh | 2 +-
scripts/mkstandalone.sh | 2 ++
4 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/.gitignore b/.gitignore
index 242fae475094c..3155418a34303 100644
--- a/.gitignore
+++ b/.gitignore
@@ -15,3 +15,4 @@ cscope.*
/test.log
/msr.out
/tests
+/build-head
diff --git a/Makefile b/Makefile
index ddba941858596..72e671195c5c7 100644
--- a/Makefile
+++ b/Makefile
@@ -66,6 +66,8 @@ $(LIBFDT_archive): $(addprefix $(LIBFDT_objdir)/,$(LIBFDT_OBJS))
-include */.*.d */*/.*.d
+all: $(shell git rev-parse --verify --short=8 HEAD >build-head 2>/dev/null)
+
standalone: all
@scripts/mkstandalone.sh
diff --git a/run_tests.sh b/run_tests.sh
index 10de5474a0b42..89e8f848d4ae9 100755
--- a/run_tests.sh
+++ b/run_tests.sh
@@ -49,5 +49,5 @@ done
RUNTIME_arch_run="./$TEST_DIR/run >> test.log"
config=$TEST_DIR/unittests.cfg
rm -f test.log
-echo > test.log
+printf "BUILD_HEAD=$(cat build-head)\n\n" > test.log
for_each_unittest $config run
diff --git a/scripts/mkstandalone.sh b/scripts/mkstandalone.sh
index 2d071deebcbca..1d3a20dd100bf 100755
--- a/scripts/mkstandalone.sh
+++ b/scripts/mkstandalone.sh
@@ -45,6 +45,8 @@ generate_test ()
config_export ARCH_NAME
config_export PROCESSOR
+ echo "echo BUILD_HEAD=$(cat build-head)"
+
if [ ! -f $kernel ]; then
echo 'echo "skip '"$testname"' (test kernel not present)"'
echo 'exit 2'
--
2.4.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [kvm-unit-tests PATCH] run scripts: add BUILD_HEAD
2016-03-03 14:33 [kvm-unit-tests PATCH] run scripts: add BUILD_HEAD Andrew Jones
@ 2016-03-03 14:36 ` Paolo Bonzini
0 siblings, 0 replies; 2+ messages in thread
From: Paolo Bonzini @ 2016-03-03 14:36 UTC (permalink / raw)
To: Andrew Jones, kvm; +Cc: rkrcmar, pfeiner
On 03/03/2016 15:33, Andrew Jones wrote:
> Signed-off-by: Andrew Jones <drjones@redhat.com>
> ---
> .gitignore | 1 +
> Makefile | 2 ++
> run_tests.sh | 2 +-
> scripts/mkstandalone.sh | 2 ++
> 4 files changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/.gitignore b/.gitignore
> index 242fae475094c..3155418a34303 100644
> --- a/.gitignore
> +++ b/.gitignore
> @@ -15,3 +15,4 @@ cscope.*
> /test.log
> /msr.out
> /tests
> +/build-head
> diff --git a/Makefile b/Makefile
> index ddba941858596..72e671195c5c7 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -66,6 +66,8 @@ $(LIBFDT_archive): $(addprefix $(LIBFDT_objdir)/,$(LIBFDT_OBJS))
>
> -include */.*.d */*/.*.d
>
> +all: $(shell git rev-parse --verify --short=8 HEAD >build-head 2>/dev/null)
> +
> standalone: all
> @scripts/mkstandalone.sh
>
> diff --git a/run_tests.sh b/run_tests.sh
> index 10de5474a0b42..89e8f848d4ae9 100755
> --- a/run_tests.sh
> +++ b/run_tests.sh
> @@ -49,5 +49,5 @@ done
> RUNTIME_arch_run="./$TEST_DIR/run >> test.log"
> config=$TEST_DIR/unittests.cfg
> rm -f test.log
> -echo > test.log
> +printf "BUILD_HEAD=$(cat build-head)\n\n" > test.log
> for_each_unittest $config run
> diff --git a/scripts/mkstandalone.sh b/scripts/mkstandalone.sh
> index 2d071deebcbca..1d3a20dd100bf 100755
> --- a/scripts/mkstandalone.sh
> +++ b/scripts/mkstandalone.sh
> @@ -45,6 +45,8 @@ generate_test ()
> config_export ARCH_NAME
> config_export PROCESSOR
>
> + echo "echo BUILD_HEAD=$(cat build-head)"
> +
> if [ ! -f $kernel ]; then
> echo 'echo "skip '"$testname"' (test kernel not present)"'
> echo 'exit 2'
>
Pushed, thanks. You guys are making me work hard. :)
Paolo
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-03-03 14:36 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-03 14:33 [kvm-unit-tests PATCH] run scripts: add BUILD_HEAD Andrew Jones
2016-03-03 14:36 ` Paolo Bonzini
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).