summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--pkgs/os-specific/linux/sgx-sdk/default.nix31
1 files changed, 18 insertions, 13 deletions
diff --git a/pkgs/os-specific/linux/sgx-sdk/default.nix b/pkgs/os-specific/linux/sgx-sdk/default.nix
index 3cda94c7386..28af8a32a64 100644
--- a/pkgs/os-specific/linux/sgx-sdk/default.nix
+++ b/pkgs/os-specific/linux/sgx-sdk/default.nix
@@ -228,25 +228,30 @@ stdenv.mkDerivation rec {
   installCheckPhase = ''
     runHook preInstallCheck
 
+    header "Building and running SGX samples"
+
     source $out/share/bin/environment
 
-    TESTDIR=`mktemp -d`
-    cp -r $out/share/SampleCode $TESTDIR/
+    TESTDIR=$(mktemp -d)
+    pushd $TESTDIR
 
-    for dir in "Cxx11SGXDemo" "SampleEnclave" "SampleEnclavePCL" "SealUnseal" "Switchless"; do
-      cd $TESTDIR/SampleCode/$dir/
-      make SGX_MODE=SIM
-      ./app
-    done
+    cp -r $out/share/SampleCode/. ./
 
-    cd $TESTDIR/SampleCode/LocalAttestation
-    make SGX_MODE=SIM
-    cd bin/
-    ./app
+    for dir in "Cxx11SGXDemo" "LocalAttestation" "SampleEnclave" "SampleEnclavePCL" "SealUnseal" "Switchless"; do
+      pushd "$dir/"
+      make -j $NIX_BUILD_CORES SGX_MODE=SIM
+      ./app || ./bin/app
+      popd
+    done
 
-    cd $TESTDIR/SampleCode/RemoteAttestation
-    make SGX_MODE=SIM
+    pushd "RemoteAttestation"
+    make -j $NIX_BUILD_CORES SGX_MODE=SIM
     echo "a" | LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/sample_libcrypto ./app
+    popd
+
+    popd
+
+    header "Checking symlink targets"
 
     # Make sure all symlinks are valid
     output=$(find "$out" -type l -exec test ! -e {} \; -print)