aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2016-01-15 21:43:15 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2016-01-15 21:43:15 +0200
commita5508d3fd362ea33633d9706a6257ef0f0c2bbc0 (patch)
treed1b35f622aa5feae62dee35eaef33df19b2b9d40
parent8b1039fa30a405e2d07ac70eb0284ee4654c619a (diff)
downloadmeson-a5508d3fd362ea33633d9706a6257ef0f0c2bbc0.zip
meson-a5508d3fd362ea33633d9706a6257ef0f0c2bbc0.tar.gz
meson-a5508d3fd362ea33633d9706a6257ef0f0c2bbc0.tar.bz2
Can run most of test suite (with hacks).
-rw-r--r--meson/backends.py15
-rw-r--r--meson/environment.py2
-rw-r--r--[-rwxr-xr-x]meson/mesonmain.py3
-rw-r--r--meson/ninjabackend.py2
-rw-r--r--meson/wrap.py30
-rwxr-xr-xrun_tests.py7
-rwxr-xr-xscripts/commandrunner.py (renamed from meson/commandrunner.py)0
-rwxr-xr-xscripts/delwithsuffix.py (renamed from meson/delwithsuffix.py)0
-rwxr-xr-xscripts/depfixer.py (renamed from meson/depfixer.py)0
-rwxr-xr-xscripts/dirchanger.py (renamed from meson/dirchanger.py)0
-rwxr-xr-xscripts/gtkdochelper.py (renamed from meson/gtkdochelper.py)0
-rwxr-xr-xscripts/meson_benchmark.py (renamed from meson/meson_benchmark.py)0
-rwxr-xr-xscripts/meson_install.py (renamed from meson/meson_install.py)15
-rwxr-xr-xscripts/meson_test.py (renamed from meson/meson_test.py)1
-rwxr-xr-xscripts/mesonconf.py (renamed from meson/mesonconf.py)0
-rwxr-xr-xscripts/mesongui.py (renamed from meson/mesongui.py)0
-rwxr-xr-xscripts/mesonintrospect.py (renamed from meson/mesonintrospect.py)0
-rwxr-xr-xscripts/regen_checker.py (renamed from meson/regen_checker.py)0
-rwxr-xr-xscripts/symbolextractor.py (renamed from meson/symbolextractor.py)0
-rwxr-xr-xscripts/vcstagger.py (renamed from meson/vcstagger.py)0
-rwxr-xr-xscripts/wraptool.py (renamed from meson/wraptool.py)29
21 files changed, 51 insertions, 53 deletions
diff --git a/meson/backends.py b/meson/backends.py
index 2706368..c583a7b 100644
--- a/meson/backends.py
+++ b/meson/backends.py
@@ -19,6 +19,21 @@ from . import mesonlib
import json
from .coredata import MesonException
+class InstallData():
+ def __init__(self, source_dir, build_dir, prefix, depfixer):
+ self.source_dir = source_dir
+ self.build_dir= build_dir
+ self.prefix = prefix
+ self.targets = []
+ self.depfixer = depfixer
+ self.headers = []
+ self.man = []
+ self.data = []
+ self.po_package_name = ''
+ self.po = []
+ self.install_scripts = []
+ self.install_subdirs = []
+
class TestSerialisation:
def __init__(self, name, suite, fname, is_cross, exe_wrapper, is_parallel, cmd_args, env,
should_fail, valgrind_args, timeout, workdir, extra_paths):
diff --git a/meson/environment.py b/meson/environment.py
index 3e10bd4..a99cb30 100644
--- a/meson/environment.py
+++ b/meson/environment.py
@@ -125,7 +125,7 @@ class Environment():
coredata.save(self.coredata, cdf)
def get_script_dir(self):
- return os.path.dirname(self.meson_script_file)
+ return os.path.join(os.path.dirname(self.meson_script_file), '../scripts')
def get_log_dir(self):
return self.log_dir
diff --git a/meson/mesonmain.py b/meson/mesonmain.py
index c4a9ada..0bf123c 100755..100644
--- a/meson/mesonmain.py
+++ b/meson/mesonmain.py
@@ -220,6 +220,3 @@ def run(args):
traceback.print_exc()
return 1
return 0
-
-if __name__ == '__main__':
- sys.exit(run(sys.argv[:]))
diff --git a/meson/ninjabackend.py b/meson/ninjabackend.py
index 53b59a1..d21cea0 100644
--- a/meson/ninjabackend.py
+++ b/meson/ninjabackend.py
@@ -18,7 +18,7 @@ from . import build
from . import mlog
from . import dependencies
from .mesonlib import File
-from .meson_install import InstallData
+from .backends import InstallData
from .build import InvalidArguments
from .coredata import MesonException
import os, sys, pickle, re
diff --git a/meson/wrap.py b/meson/wrap.py
index e55d3db..ac9c9ce 100644
--- a/meson/wrap.py
+++ b/meson/wrap.py
@@ -17,7 +17,33 @@ import urllib.request, os, hashlib, shutil
import subprocess
import sys
-from . import wraptool
+try:
+ import ssl
+ has_ssl = True
+ API_ROOT = 'https://wrapdb.mesonbuild.com/v1/'
+except ImportError:
+ has_ssl = False
+ API_ROOT = 'http://wrapdb.mesonbuild.com/v1/'
+
+def open_wrapdburl(urlstring):
+ global ssl_warning_printed
+ if has_ssl:
+ try:
+ return urllib.request.urlopen(urlstring)#, context=build_ssl_context())
+ except urllib.error.URLError:
+ if not ssl_warning_printed:
+ print('SSL connection failed. Falling back to unencrypted connections.')
+ ssl_warning_printed = True
+ if not ssl_warning_printed:
+ print('Warning: SSL not available, traffic not authenticated.',
+ file=sys.stderr)
+ ssl_warning_printed = True
+ # Trying to open SSL connection to wrapdb fails because the
+ # certificate is not known.
+ if urlstring.startswith('https'):
+ urlstring = 'http' + urlstring[5:]
+ return urllib.request.urlopen(urlstring)
+
class PackageDefinition:
def __init__(self, fname):
@@ -94,7 +120,7 @@ class Resolver:
def get_data(self, url):
blocksize = 10*1024
if url.startswith('https://wrapdb.mesonbuild.com'):
- resp = wraptool.open_wrapdburl(url)
+ resp = open_wrapdburl(url)
else:
resp = urllib.request.urlopen(url)
dlsize = int(resp.info()['Content-Length'])
diff --git a/run_tests.py b/run_tests.py
index f1ea2a9..e24c906 100755
--- a/run_tests.py
+++ b/run_tests.py
@@ -21,12 +21,13 @@ import sys
from meson import environment
from meson import mesonlib
from meson import mlog
-from meson import meson, meson_test, meson_benchmark
+from meson import mesonmain
+from scripts import meson_test, meson_benchmark
import argparse
import xml.etree.ElementTree as ET
import time
-from meson.meson import backendlist
+from meson.mesonmain import backendlist
class TestResult:
def __init__(self, msg, stdo, stde, conftime=0, buildtime=0, testtime=0):
@@ -154,7 +155,7 @@ def run_configure_inprocess(commandlist):
old_stderr = sys.stderr
sys.stderr = mystderr = StringIO()
try:
- returncode = meson.run(commandlist)
+ returncode = mesonmain.run(commandlist)
finally:
sys.stdout = old_stdout
sys.stderr = old_stderr
diff --git a/meson/commandrunner.py b/scripts/commandrunner.py
index 0dad585..0dad585 100755
--- a/meson/commandrunner.py
+++ b/scripts/commandrunner.py
diff --git a/meson/delwithsuffix.py b/scripts/delwithsuffix.py
index 4b8a60d..4b8a60d 100755
--- a/meson/delwithsuffix.py
+++ b/scripts/delwithsuffix.py
diff --git a/meson/depfixer.py b/scripts/depfixer.py
index 4f7ce3d..4f7ce3d 100755
--- a/meson/depfixer.py
+++ b/scripts/depfixer.py
diff --git a/meson/dirchanger.py b/scripts/dirchanger.py
index fd3dc23..fd3dc23 100755
--- a/meson/dirchanger.py
+++ b/scripts/dirchanger.py
diff --git a/meson/gtkdochelper.py b/scripts/gtkdochelper.py
index 7e476b8..7e476b8 100755
--- a/meson/gtkdochelper.py
+++ b/scripts/gtkdochelper.py
diff --git a/meson/meson_benchmark.py b/scripts/meson_benchmark.py
index 26f1f95..26f1f95 100755
--- a/meson/meson_benchmark.py
+++ b/scripts/meson_benchmark.py
diff --git a/meson/meson_install.py b/scripts/meson_install.py
index c5c17ba..e0a5eb2 100755
--- a/meson/meson_install.py
+++ b/scripts/meson_install.py
@@ -17,21 +17,6 @@
import sys, pickle, os, shutil, subprocess, gzip, platform
from glob import glob
-class InstallData():
- def __init__(self, source_dir, build_dir, prefix, depfixer):
- self.source_dir = source_dir
- self.build_dir= build_dir
- self.prefix = prefix
- self.targets = []
- self.depfixer = depfixer
- self.headers = []
- self.man = []
- self.data = []
- self.po_package_name = ''
- self.po = []
- self.install_scripts = []
- self.install_subdirs = []
-
def do_install(datafilename):
ifile = open(datafilename, 'rb')
d = pickle.load(ifile)
diff --git a/meson/meson_test.py b/scripts/meson_test.py
index d9b4993..43b1cdb 100755
--- a/meson/meson_test.py
+++ b/scripts/meson_test.py
@@ -14,6 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+import meson
import sys, os, subprocess, time, datetime, pickle, multiprocessing, json
import concurrent.futures as conc
import argparse
diff --git a/meson/mesonconf.py b/scripts/mesonconf.py
index e53875f..e53875f 100755
--- a/meson/mesonconf.py
+++ b/scripts/mesonconf.py
diff --git a/meson/mesongui.py b/scripts/mesongui.py
index bdd44bb..bdd44bb 100755
--- a/meson/mesongui.py
+++ b/scripts/mesongui.py
diff --git a/meson/mesonintrospect.py b/scripts/mesonintrospect.py
index 9fcd4db..9fcd4db 100755
--- a/meson/mesonintrospect.py
+++ b/scripts/mesonintrospect.py
diff --git a/meson/regen_checker.py b/scripts/regen_checker.py
index a0fe028..a0fe028 100755
--- a/meson/regen_checker.py
+++ b/scripts/regen_checker.py
diff --git a/meson/symbolextractor.py b/scripts/symbolextractor.py
index f2c709d..f2c709d 100755
--- a/meson/symbolextractor.py
+++ b/scripts/symbolextractor.py
diff --git a/meson/vcstagger.py b/scripts/vcstagger.py
index ccc584e..ccc584e 100755
--- a/meson/vcstagger.py
+++ b/scripts/vcstagger.py
diff --git a/meson/wraptool.py b/scripts/wraptool.py
index 2366b78..46860aa 100755
--- a/meson/wraptool.py
+++ b/scripts/wraptool.py
@@ -14,18 +14,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-import urllib.request, json
+import json
import sys, os
import configparser
import shutil
-import platform
-try:
- import ssl
- has_ssl = True
- API_ROOT = 'https://wrapdb.mesonbuild.com/v1/'
-except ImportError:
- has_ssl = False
- API_ROOT = 'http://wrapdb.mesonbuild.com/v1/'
ssl_warning_printed = False
@@ -64,25 +56,6 @@ def build_ssl_context():
ctx.load_default_certs()
return ctx
-def open_wrapdburl(urlstring):
- global ssl_warning_printed
- if has_ssl:
- try:
- return urllib.request.urlopen(urlstring)#, context=build_ssl_context())
- except urllib.error.URLError:
- if not ssl_warning_printed:
- print('SSL connection failed. Falling back to unencrypted connections.')
- ssl_warning_printed = True
- if not ssl_warning_printed:
- print('Warning: SSL not available, traffic not authenticated.',
- file=sys.stderr)
- ssl_warning_printed = True
- # Trying to open SSL connection to wrapdb fails because the
- # certificate is not known.
- if urlstring.startswith('https'):
- urlstring = 'http' + urlstring[5:]
- return urllib.request.urlopen(urlstring)
-
def get_result(urlstring):
u = open_wrapdburl(urlstring)
data = u.read().decode('utf-8')