setup.py 813 B

12345678910111213141516171819202122232425262728
  1. import subprocess
  2. import sys
  3. import setup_util
  4. import os
  5. def start(args, logfile, errfile):
  6. if os.name == 'nt':
  7. return 1
  8. app = args.troot + "/src"
  9. try:
  10. # build
  11. subprocess.check_call("rm -rf bin obj", shell=True, cwd=app, stdout=logfile, stderr=errfile)
  12. subprocess.check_call("xbuild /p:Configuration=Release", shell=True, cwd=app, stdout=logfile, stderr=errfile)
  13. os.environ['MONO_GC_PARAMS']="nursery-size=64m"
  14. subprocess.Popen("mono -O=all bin/Release/EvHttpSharpBenchmark.exe 127.0.0.1 8085 " + str(args.max_threads) + " &", shell=True, cwd=app, stdout=logfile, stderr=errfile)
  15. return 0
  16. except subprocess.CalledProcessError:
  17. return 1
  18. def stop(logfile, errfile):
  19. if os.name == 'nt':
  20. return 0
  21. subprocess.check_call("pkill -9 mono", shell=True)
  22. return 0