]> git.proxmox.com Git - swtpm.git/blobdiff - run_tests
swtpm: Remove stale parameter from function documentation
[swtpm.git] / run_tests
index 57dec06e83b0618e798be253ed7e8cd6e5de05f7..1b47820a08b1cd2a64fb2525d538af70a0cd91c4 100755 (executable)
--- a/run_tests
+++ b/run_tests
@@ -7,34 +7,47 @@ fi
 
 unset SWTPM
 
+# Comment the following to compile and test with CUSE interface
+WITHOUT_CUSE="--without-cuse"
+
 # FIXME:
 # Due to some bug in glib2 for i686 we don't seem to be able to run a
 # 32bit swtpm with cuse interface correctly. The g_cond_wait_until()
 # doesn't behave as it does with 64bit. test_hashing2 gets stuck.
 
 
-CFLAGS='-m64' ./configure --with-openssl --with-gnutls --prefix=/usr --libdir=/lib64 && \
+CFLAGS='-m64' ./configure --with-openssl --with-gnutls --prefix=/usr --libdir=/lib64 ${WITHOUT_CUSE} && \
  make clean && \
- make -j8 &&
- sudo make -j8 install &&
+ make -j$(nproc) &&
+ sudo make -j$(nproc) install &&
  cp /usr/bin/swtpm /tmp/swtpm64 &&
- make -j8 check &&
- sudo make -j8 check ||
+ make -j$(nproc) check ||
+ exit 1
+if [ -z "${WITHOUT_CUSE}" ]; then
+ sudo make -j$(nproc) check ||
  exit 1
+fi
 
 PKG_CONFIG_PATH=/usr/lib/pkgconfig \
- CFLAGS='-m32' ./configure --with-openssl --with-gnutls --prefix=/usr --libdir=/lib && \
+ CFLAGS='-m32' ./configure --with-openssl --with-gnutls --prefix=/usr --libdir=/lib ${WITHOUT_CUSE} && \
  make clean && \
- make -j8 &&
- sudo make -j8 install &&
+ make -j$(nproc) &&
+ sudo make -j$(nproc) install &&
  cp /usr/bin/swtpm /tmp/swtpm32 &&
- make -j8 check &&
- SWTPM_EXE=/tmp/swtpm64 make -j8 check &&
- sudo SWTPM_EXE=/tmp/swtpm64 make -j8 check ||
+ make -j$(nproc) check &&
+ SWTPM_EXE=/tmp/swtpm64 make -j$(nproc) check ||
+ exit 1
+if [ -z "${WITHOUT_CUSE}" ]; then
+ sudo SWTPM_EXE=/tmp/swtpm64 make -j$(nproc) check ||
  exit 1
+fi
 
-CFLAGS='-m64' ./configure --with-openssl --with-gnutls --prefix=/usr --libdir=/lib64 && \
+CFLAGS='-m64' ./configure --with-openssl --with-gnutls --prefix=/usr --libdir=/lib64 ${WITHOUT_CUSE} && \
  make clean && \
- make -j8 &&
- SWTPM_EXE=/tmp/swtpm32 make -j8 check &&
+ make -j$(nproc) &&
+ SWTPM_EXE=/tmp/swtpm32 make -j$(nproc) check ||
  exit 1
+
+echo "*** All tests succeeded ***"
+
+exit 0