summaryrefslogtreecommitdiff
path: root/suite/api_test.py
diff options
context:
space:
mode:
authorPeter LaFosse <peter@vector35.com>2018-08-29 15:26:00 -0400
committerPeter LaFosse <peter@vector35.com>2018-08-31 14:21:07 -0400
commitf0ccb75e7d80a6c0ae8b01d794b929f03bc6ea6d (patch)
tree7569fe7689062b265329ad0f649705aa8caab922 /suite/api_test.py
parenta6b801afadada75afd2b1779edee8d203f3b3140 (diff)
parent426bb3d8b47b93658bf969c429a8b98adae13c30 (diff)
Merging with dev
Diffstat (limited to 'suite/api_test.py')
-rw-r--r--suite/api_test.py43
1 files changed, 0 insertions, 43 deletions
diff --git a/suite/api_test.py b/suite/api_test.py
index a162d26a..740f88e3 100644
--- a/suite/api_test.py
+++ b/suite/api_test.py
@@ -1,17 +1,10 @@
import unittest
-import time
import platform
import os
-import tempfile
-import zipfile
-import urllib
-import subprocess
-import getpass
from binaryninja.setting import Setting
from binaryninja.metadata import Metadata
from binaryninja.demangle import demangle_gnu3, get_qualified_name
from binaryninja.architecture import Architecture
-from binaryninja.binaryview import BinaryViewType
class SettingsAPI(unittest.TestCase):
@@ -226,39 +219,3 @@ class DemanglerTest(unittest.TestCase):
for i, test in enumerate(tests):
t, n = demangle_gnu3(Architecture['x86'], test)
assert self.get_type_string(t, n) == results[i]
-
-
-class TimingTest(unittest.TestCase):
- def unpackage_file(self, file):
- if not os.path.exists(file):
- with zipfile.ZipFile(file + ".zip", "r") as zf:
- zf.extractall()
- assert os.path.exists(file)
-
- def test_analysis_time(self):
- if platform.system() != "Linux" or getpass.getuser() != "jenkins":
- return
-
- start_time = time.time()
- file_names = [os.path.join(os.path.dirname(__file__), "binaries", "quick3dcoreplugin.dll"),
- os.path.join(os.path.dirname(__file__), "binaries", "md5"),
- os.path.join(os.path.dirname(__file__), "binaries", "ls")]
-
- for file_name in file_names:
- temp_name = next(tempfile._get_candidate_names()) + ".bndb"
- self.unpackage_file(file_name)
- try:
- bv = BinaryViewType.get_view_of_file(file_name)
- bv.create_database(temp_name)
- bv.file.close()
- bv = BinaryViewType.get_view_of_file(temp_name)
- bv.file.close()
- finally:
- if os.path.exists(file_name):
- os.unlink(file_name)
- if os.path.exists(temp_name):
- os.unlink(temp_name)
-
- time_s = time.time() - start_time
- commit = subprocess.check_output(["git", "rev-parse", "HEAD"])[:-1]
- conn = urllib.urlopen("https://script.google.com/macros/s/AKfycbxrZtlgLaWt3l95_7RyH9ceDdFIBm0VaR6jG1-4UDt6CFFCFzQ/exec?BuildID=%s&Test1=%.2f" % (commit, time_s))