|
@@ -1,10 +1,7 @@
|
|
#!/usr/bin/env python
|
|
#!/usr/bin/env python
|
|
# -*- coding: utf-8 -*-
|
|
# -*- coding: utf-8 -*-
|
|
import os
|
|
import os
|
|
-import subprocess
|
|
|
|
-import requests
|
|
|
|
-import time
|
|
|
|
-from conans import ConanFile, CMake, tools, RunEnvironment
|
|
|
|
|
|
+from conans import ConanFile, CMake
|
|
|
|
|
|
|
|
|
|
class TestPackageConan(ConanFile):
|
|
class TestPackageConan(ConanFile):
|
|
@@ -19,15 +16,4 @@ class TestPackageConan(ConanFile):
|
|
def test(self):
|
|
def test(self):
|
|
assert os.path.isfile(os.path.join(self.deps_cpp_info["civetweb"].rootpath, "licenses", "LICENSE.md"))
|
|
assert os.path.isfile(os.path.join(self.deps_cpp_info["civetweb"].rootpath, "licenses", "LICENSE.md"))
|
|
bin_path = os.path.join("bin", "test_package")
|
|
bin_path = os.path.join("bin", "test_package")
|
|
- run_vars = RunEnvironment(self).vars
|
|
|
|
- with tools.environment_append(run_vars):
|
|
|
|
- if self.settings.os == "Macos" or self.settings.os == "Linux":
|
|
|
|
- run_vars["DYLD_LIBRARY_PATH"] = os.environ.get('DYLD_LIBRARY_PATH', '')
|
|
|
|
- process = subprocess.Popen([bin_path], shell=True, env=run_vars)
|
|
|
|
- else:
|
|
|
|
- process = subprocess.Popen([bin_path], shell=True)
|
|
|
|
- time.sleep(3)
|
|
|
|
- response = requests.get("http://localhost:8080/example")
|
|
|
|
- assert response.ok
|
|
|
|
- process.kill()
|
|
|
|
- print("Finish Conan test package - SUCCESS!")
|
|
|
|
|
|
+ self.run(bin_path, run_environment=True)
|