test.sh 772 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #!/bin/bash
  2. # Runs test images
  3. echo "*** Running unit tests..."
  4. # Remove previous test results
  5. rm _results/*.txt
  6. # How long we shall wait for each test to conclude
  7. export netcon_test_wait_time=60s
  8. # Test structure, in later releases more complex multi-party scripts will be included
  9. export test_script=_two_party_test.sh
  10. # Iterate over all depth=2 (relatively-speaking) directories and perform each test
  11. find . -mindepth 2 -maxdepth 2 -type d | while read testdir; do
  12. if [[ $testdir != *$1* ]]
  13. then
  14. continue
  15. fi
  16. echo "*** Testing: '$testdir'..."
  17. rm _results/*.tmp
  18. # Stage scripts
  19. cp $test_script $testdir/$test_script
  20. cd $testdir
  21. # Run test
  22. ./$test_script
  23. rm $test_script
  24. cd ../../
  25. done
  26. echo "*** Done"