Skip to content

Commit

Permalink
test-runner: Output EAPP errors and check against them in log (#167)
Browse files Browse the repository at this point in the history
Authored-by: Gui Andrade <gh@archshift.com>
  • Loading branch information
dkohlbre committed Apr 2, 2020
2 parents 6c0e114 + 1b3be4c commit 1883a98
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions tests/tests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ all: $(OBJS) $(SDK_HOST_LIB) $(SDK_EDGE_LIB) $(SDK_VERIFIER_LIB)
$(foreach test, $(TESTS), \
echo "echo 'testing $(test)'" >> test;\
echo "./$(RUNNER) $(test).eapp_riscv $(RUNTIME)" >> test; \
echo '[ $$? -eq 0 ] || echo "... ERROR"' >> test; \
)
chmod +x test

Expand Down
5 changes: 3 additions & 2 deletions tests/tests/test-runner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,14 +133,15 @@ int main(int argc, char** argv)
asm volatile ("rdcycle %0" : "=r" (cycles3));
}

int retcode = 0;
if( !load_only )
enclave.run();
retcode = enclave.run();

if( self_timing ){
asm volatile ("rdcycle %0" : "=r" (cycles4));
printf("[keystone-test] Init: %lu cycles\r\n", cycles2-cycles1);
printf("[keystone-test] Runtime: %lu cycles\r\n", cycles4-cycles3);
}

return 0;
return retcode;
}

0 comments on commit 1883a98

Please sign in to comment.