Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove option to disable BDD tests that require Lua #2211

Merged
merged 3 commits into from
Jul 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions src/command-line-parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -242,15 +242,11 @@ void print_version()
fmt::print(stderr, "Compiled using the following library versions:\n");
fmt::print(stderr, "Libosmium {}\n", LIBOSMIUM_VERSION_STRING);
fmt::print(stderr, "Proj {}\n", get_proj_version());
#ifdef HAVE_LUA
#ifdef HAVE_LUAJIT
fmt::print(stderr, "{} ({})\n", LUA_RELEASE, LUAJIT_VERSION);
#else
fmt::print(stderr, "{}\n", LUA_RELEASE);
#endif
#else
fmt::print(stderr, "Lua support not included\n");
#endif
}

// NOLINTNEXTLINE(cppcoreguidelines-avoid-c-arrays,hicpp-avoid-c-arrays,modernize-avoid-c-arrays)
Expand Down
7 changes: 0 additions & 7 deletions tests/bdd/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
'KEEP_TEST_DB': False,
'TEST_DB': 'osm2pgsql-test',
'HAVE_TABLESPACE': True,
'HAVE_LUA': True,
'HAVE_PROJ': True
}

Expand Down Expand Up @@ -93,9 +92,6 @@ def before_all(context):
if proc.returncode != 0:
raise RuntimeError('Cannot run osm2pgsql')

if context.config.userdata['HAVE_LUA']:
context.config.userdata['HAVE_LUA'] = 'Lua support not included' not in ver_info

if context.config.userdata['HAVE_PROJ']:
context.config.userdata['HAVE_PROJ'] = 'Proj [disabled]' not in ver_info

Expand All @@ -118,9 +114,6 @@ def before_scenario(context, scenario):
if 'config.have_proj' in scenario.tags and not context.config.userdata['HAVE_PROJ']:
scenario.skip("Generic proj library not configured.")

if 'config.have_lua' in scenario.tags and not context.config.userdata['HAVE_LUA']:
scenario.skip("Lua support not compiled in.")

context.db = use_fixture(test_db, context)
context.import_file = None
context.import_data = {'n': [], 'w': [], 'r': []}
Expand Down
12 changes: 8 additions & 4 deletions tests/bdd/flex/lua-basics.feature
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
Feature: Flex output uses a Lua config file

Scenario: Check access to osm2pgsql object from Lua
Given the input file 'liechtenstein-2013-08-03.osm.pbf'
Given the OSM data
"""
"""
And the lua style
"""
print("version=" .. osm2pgsql.version)
Expand All @@ -28,15 +30,17 @@ Feature: Flex output uses a Lua config file
"""

Scenario: Check access to osm2pgsql properties from Lua
Given the input file 'liechtenstein-2013-08-03.osm.pbf'
Given the OSM data
"""
"""
And the lua style
"""
local p = osm2pgsql.properties
print("attributes=" .. p.attributes)
print("prefix=" .. p.prefix)
"""
Then running osm2pgsql flex fails
And the standard output contains
When running osm2pgsql flex
Then the standard output contains
"""
attributes=false
"""
Expand Down
1 change: 0 additions & 1 deletion tests/bdd/regression/properties.feature
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ Feature: Updates to the test database with properties check
Using style file '' (same as on import).
"""

@config.have_lua
Scenario Outline: Create/append with various style parameters with flex output
When running osm2pgsql flex with parameters
| --slim |
Expand Down
12 changes: 0 additions & 12 deletions tests/bdd/steps/steps_execute.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,30 +121,18 @@ def do_not_setup_tagtransform(context):

@given("the default lua tagtransform")
def setup_lua_tagtransform(context):
if not context.config.userdata['HAVE_LUA']:
context.scenario.skip("Lua support not compiled in.")
return

context.osm2pgsql_params.extend(('--tag-transform-script',
str(context.default_data_dir / 'style.lua')))

@given("the lua style")
def setup_inline_lua_style(context):
if not context.config.userdata['HAVE_LUA']:
context.scenario.skip("Lua support not compiled in.")
return

outfile = context.workdir / 'inline_style.lua'
outfile.write_text(context.text)
context.osm2pgsql_params.extend(('-S', str(outfile)))


@given("the style file '(?P<style>.+)'")
def setup_style_file(context, style):
if style.endswith('.lua') and not context.config.userdata['HAVE_LUA']:
context.scenario.skip("Lua support not compiled in.")
return

context.osm2pgsql_params.extend(('-S', str(context.test_data_dir / style)))


Expand Down
Loading