setup.py 792 B

12345678910111213141516171819202122232425262728
  1. import subprocess
  2. import sys
  3. import setup_util
  4. import os
  5. root = os.getcwd() + "/evhttp-sharp"
  6. app = root + "/src"
  7. def start(args, logfile, errfile):
  8. if os.name == 'nt':
  9. return 1
  10. try:
  11. # build
  12. subprocess.check_call("rm -rf bin obj", shell=True, cwd=app, stdout=logfile, stderr=errfile)
  13. subprocess.check_call("xbuild /p:Configuration=Release", shell=True, cwd=app, stdout=logfile, stderr=errfile)
  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