[kvm-unit-tests,3/4] x86: Add the setjmp test to the CI
diff mbox series

Message ID 20191211094221.7030-4-thuth@redhat.com
State New
Headers show
Series
  • Improvements for the x86 tests
Related show

Commit Message

Thomas Huth Dec. 11, 2019, 9:42 a.m. UTC
Use a proper report() in the test instead of printf(), and add
it to the unittests.cfg and the CI yaml files.

Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 .gitlab-ci.yml    | 4 ++--
 .travis.yml       | 4 ++--
 x86/setjmp.c      | 8 +++-----
 x86/unittests.cfg | 3 +++
 4 files changed, 10 insertions(+), 9 deletions(-)

Patch
diff mbox series

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index fbf3328..ea1aeaf 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -67,7 +67,7 @@  build-x86_64:
      ioapic-split ioapic smptest smptest3 vmexit_cpuid vmexit_mov_from_cr8
      vmexit_mov_to_cr8 vmexit_inl_pmtimer  vmexit_ipi vmexit_ipi_halt
      vmexit_ple_round_robin vmexit_tscdeadline vmexit_tscdeadline_immed
-     eventinj msr port80 syscall tsc rmap_chain umip intel_iommu
+     eventinj msr port80 setjmp syscall tsc rmap_chain umip intel_iommu
      | tee results.txt
  - if grep -q FAIL results.txt ; then exit 1 ; fi
 
@@ -77,6 +77,6 @@  build-i386:
  - ./configure --arch=i386
  - make -j2
  - ACCEL=tcg ./run_tests.sh
-     eventinj port80 sieve tsc taskswitch taskswitch2 umip
+     eventinj port80 setjmp sieve tsc taskswitch taskswitch2 umip
      | tee results.txt
  - if grep -q FAIL results.txt ; then exit 1 ; fi
diff --git a/.travis.yml b/.travis.yml
index 75bcf08..53f8d7d 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -15,7 +15,7 @@  matrix:
       - BUILD_DIR="."
       - TESTS="access asyncpf debug emulator ept hypercall hyperv_stimer
                hyperv_synic idt_test intel_iommu ioapic ioapic-split
-               kvmclock_test msr pcid rdpru realmode rmap_chain s3 umip"
+               kvmclock_test msr pcid rdpru realmode rmap_chain s3 setjmp umip"
       - ACCEL="kvm"
 
     - addons:
@@ -45,7 +45,7 @@  matrix:
       - BUILD_DIR="i386-builddir"
       - TESTS="tsx-ctrl umip vmexit_cpuid vmexit_ipi vmexit_ipi_halt
                vmexit_mov_from_cr8 vmexit_mov_to_cr8 vmexit_ple_round_robin
-               vmexit_tscdeadline vmexit_tscdeadline_immed vmexit_vmcall"
+               vmexit_tscdeadline vmexit_tscdeadline_immed vmexit_vmcall setjmp"
       - ACCEL="kvm"
 
     - addons:
diff --git a/x86/setjmp.c b/x86/setjmp.c
index 1a848b4..cc411cd 100644
--- a/x86/setjmp.c
+++ b/x86/setjmp.c
@@ -14,13 +14,11 @@  int main(void)
 	int i;
 
 	i = setjmp(j);
-	if (expected[index] != i) {
-		printf("FAIL: actual %d / expected %d\n", i, expected[index]);
-		return -1;
-	}
+	report(expected[index] == i, "actual %d == expected %d",
+	       i, expected[index]);
 	index++;
 	if (i + 1 < NUM_LONGJMPS)
 		longjmp(j, i + 1);
 
-	return 0;
+	return report_summary();
 }
diff --git a/x86/unittests.cfg b/x86/unittests.cfg
index e99b086..acdde10 100644
--- a/x86/unittests.cfg
+++ b/x86/unittests.cfg
@@ -171,6 +171,9 @@  file = realmode.flat
 [s3]
 file = s3.flat
 
+[setjmp]
+file = setjmp.flat
+
 [sieve]
 file = sieve.flat
 timeout = 180