You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

buildAndRun 699B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. if [ "$(uname --operating-system)" == "Msys" ]
  2. then
  3. CFLAGS='-I.. -std=c++11 -g -O0 -DWIN32 -pthread'
  4. else
  5. CFLAGS='-I.. -std=c++0x -g -O0 -pthread'
  6. fi
  7. g++ $CFLAGS serviceProgram.cpp ../CodeDweller/service.cpp -o serviceProgram
  8. if [ $? -ne 0 ]
  9. then
  10. exit -1
  11. fi
  12. # Run test.
  13. logFileName=serviceProgram.log
  14. rm -f $logFileName
  15. ./serviceProgram $(pwd)/$logFileName
  16. PID=$(ps axl | grep -i serviceProgram |grep -v grep | cut -d ' ' -f 4)
  17. sleep 1
  18. kill -TSTP $PID
  19. sleep 2
  20. kill -CONT $PID
  21. sleep 2
  22. kill -HUP $PID
  23. sleep 2
  24. kill -TERM $PID
  25. sleep 1
  26. if cmp expected_$logFileName $logFileName
  27. then
  28. echo CodeDweller::Service under Linux: ok
  29. else
  30. echo CodeDweller::Service under Linux: fail
  31. fi