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

Use correct values for MinimumVisualStudioVersion in Android projects #1285

Merged
merged 3 commits into from
Jun 7, 2019
Merged

Use correct values for MinimumVisualStudioVersion in Android projects #1285

merged 3 commits into from
Jun 7, 2019

Conversation

ifarbod
Copy link
Contributor

@ifarbod ifarbod commented May 8, 2019

No description provided.

Copy link
Member

@samsinsane samsinsane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please add some tests for this?

@ifarbod
Copy link
Contributor Author

ifarbod commented May 10, 2019

I tried something like this but this is what I get:

local function preparePropertyGroup()
		system "android"
		local cfg = test.getconfig(prj, "Debug", platform)
		vc2010.propertyGroup(cfg)
	end

	function suite.minVisualStudioVersion()
		preparePropertyGroup()
		test.capture [[
	<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
	<ApplicationType>Android</ApplicationType>
	<ApplicationTypeRevision>2.0</ApplicationTypeRevision>]]
	end
[  FAILED  ] test_android_project.minVisualStudioVersion
...make-core/modules/android/tests/test_android_project.lua:31: (1) expected:
        <MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
...but was:
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Android'">
fulltext:
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Android'">

stack traceback:
        ...make-core/modules/android/tests/test_android_project.lua:31: in function 'testFunction'

 1 FAILED TESTS

@ratzlaff
Copy link
Contributor

ratzlaff commented May 13, 2019

After your call to preparePropertyGroup() you probably want to call android.androidApplicationType(cfg) - so preparePropertyGroup may need to return the proper cfg.

the output after fulltext: is what was captured (normally written to the file) for the unit test as a result of calling those functions in that order.

@samsinsane
Copy link
Member

You're also probably going to need to set the action with p.action.set("vs2015"), or whichever action you're intending to test.

@ifarbod
Copy link
Contributor Author

ifarbod commented May 24, 2019

@ratzlaff Thanks, I've fixed it.
@samsinsane I thought suite.setup() already did that, so I did nothing for that.

@samsinsane
Copy link
Member

@ifarbod Sorry, I wasn't overly clear there. Testing vs2015 is great, but it would be good to test all the actions that your code supports. If someone rearranged the if statements, which would result in 14.0 being output always, the tests should catch that.

@ifarbod
Copy link
Contributor Author

ifarbod commented Jun 7, 2019

All right then, I hope this is good enough.

@samsinsane
Copy link
Member

Perfect, thanks!

@samsinsane samsinsane merged commit 900e4b0 into premake:master Jun 7, 2019
@ifarbod ifarbod deleted the vs16-compat-android branch June 8, 2019 12:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants