]> git.openstreetmap.org Git - nominatim.git/blobdiff - test/bdd/steps/queries.py
Merge remote-tracking branch 'upstream/master'
[nominatim.git] / test / bdd / steps / queries.py
index 55285d6a6bac83c52fc6559c4e227dae5323b2bb..963aad4dffcdca526cef9bc7e1ed1a5496ef5d00 100644 (file)
@@ -282,7 +282,18 @@ def send_api_query(endpoint, params, fmt, context):
     if hasattr(context, 'http_headers'):
         env.update(context.http_headers)
 
-    cmd = ['/usr/bin/php-cgi', env['SCRIPT_FILENAME']]
+    cmd = ['/usr/bin/php-cgi', '-f']
+    if context.nominatim.code_coverage_path:
+        env['COV_SCRIPT_FILENAME'] = env['SCRIPT_FILENAME']
+        env['COV_PHP_DIR'] = os.path.join(context.nominatim.src_dir, "lib")
+        env['COV_TEST_NAME'] = '%s:%s' % (context.scenario.filename, context.scenario.line)
+        env['SCRIPT_FILENAME'] = \
+                os.path.join(os.path.split(__file__)[0], 'cgi-with-coverage.php')
+        cmd.append(env['SCRIPT_FILENAME'])
+        env['PHP_CODE_COVERAGE_FILE'] = context.nominatim.next_code_coverage_file()
+    else:
+        cmd.append(env['SCRIPT_FILENAME'])
+
     for k,v in params.items():
         cmd.append("%s=%s" % (k, v))
 
@@ -338,7 +349,7 @@ def website_search_request(context, fmt, query, addr):
 
     context.response = SearchResponse(outp, outfmt, status)
 
-@when(u'sending (?P<fmt>\S+ )?reverse coordinates (?P<lat>[0-9.-]+)?,(?P<lon>[0-9.-]+)?')
+@when(u'sending (?P<fmt>\S+ )?reverse coordinates (?P<lat>.+)?,(?P<lon>.+)?')
 def website_reverse_request(context, fmt, lat, lon):
     params = {}
     if lat is not None: