summaryrefslogtreecommitdiff
path: root/test-export
diff options
context:
space:
mode:
authorJonathan Ringer <jonringer117@gmail.com>2021-11-08 06:47:25 -0800
committerAzat Khuzhin <azat@libevent.org>2023-05-14 22:43:47 +0200
commitbe03bf385b0dccec189af71af71e0af0b402ebdb (patch)
tree46d442699cd133306b81668122bb10b773c14e57 /test-export
parent1f1593ff27bdf51c3e1c45b92cfb0ac931960298 (diff)
downloadlibevent-be03bf385b0dccec189af71af71e0af0b402ebdb.tar.gz
Install LibeventConfig.cmake similar to other cmake files
- Don't destroy cmake file between test case invocations
Diffstat (limited to 'test-export')
-rw-r--r--test-export/test-export.py16
1 files changed, 0 insertions, 16 deletions
diff --git a/test-export/test-export.py b/test-export/test-export.py
index 9eaf0d63..84824350 100644
--- a/test-export/test-export.py
+++ b/test-export/test-export.py
@@ -109,18 +109,6 @@ def test_group():
testcase("mbedtls", "pthreads", 1)
-def config_restore():
- if os.path.isfile("tempconfig") and not os.path.isfile("LibeventConfig.cmake"):
- os.rename("tempconfig", "LibeventConfig.cmake")
-
-
-def config_backup():
- if os.path.isfile("tempconfig"):
- os.remove("tempconfig")
- if os.path.isfile("LibeventConfig.cmake"):
- os.rename("LibeventConfig.cmake", "tempconfig")
-
-
shutil.rmtree(os.path.join(script_dir, "build"), ignore_errors=True)
@@ -158,7 +146,6 @@ print("[test-export] use %s library" % link_type)
# Test for build tree.
print("[test-export] test for build tree")
dllpath = os.path.join(working_dir, "bin", "Debug")
-config_restore()
os.environ["CMAKE_PREFIX_PATH"] = working_dir
export_dll(dllpath)
run_test_group()
@@ -175,7 +162,6 @@ else:
prefix = "/usr/local"
exec_cmd('cmake -DCMAKE_SKIP_INSTALL_RPATH=OFF -DCMAKE_INSTALL_PREFIX="%s" ..' % prefix, True)
exec_cmd('cmake --build . -v --target install', True)
-config_backup()
os.environ["CMAKE_PREFIX_PATH"] = os.path.join(prefix, "lib/cmake/libevent")
export_dll(dllpath)
run_test_group()
@@ -191,13 +177,11 @@ tempdir = tempfile.TemporaryDirectory()
cmd = 'cmake -DCMAKE_SKIP_INSTALL_RPATH=OFF -DCMAKE_INSTALL_PREFIX="%s" ..' % tempdir.name
exec_cmd(cmd, True)
exec_cmd("cmake --build . -v --target install", True)
-config_backup()
os.environ["CMAKE_PREFIX_PATH"] = os.path.join(tempdir.name, "lib/cmake/libevent")
dllpath = os.path.join(tempdir.name, "lib")
export_dll(dllpath)
run_test_group()
unexport_dll(dllpath)
del os.environ["CMAKE_PREFIX_PATH"]
-config_restore()
print("[test-export] all testcases have run successfully")