@@ -232,6 +232,11 @@ def test_get_config_vars(self):
232232 self .assertTrue (cvars )
233233
234234 def test_get_platform (self ):
235+ # Check the actual platform returns something reasonable.
236+ actual_platform = get_platform ()
237+ self .assertIsInstance (actual_platform , str )
238+ self .assertTrue (actual_platform )
239+
235240 # windows XP, 32bits
236241 os .name = 'nt'
237242 sys .version = ('2.4.4 (#71, Oct 18 2006, 08:34:43) '
@@ -347,6 +352,21 @@ def test_get_platform(self):
347352
348353 self .assertEqual (get_platform (), 'linux-i686' )
349354
355+ # Android
356+ os .name = 'posix'
357+ sys .platform = 'android'
358+ get_config_vars ()['ANDROID_API_LEVEL' ] = 9
359+ for machine , abi in {
360+ 'x86_64' : 'x86_64' ,
361+ 'i686' : 'x86' ,
362+ 'aarch64' : 'arm64_v8a' ,
363+ 'armv7l' : 'armeabi_v7a' ,
364+ }.items ():
365+ with self .subTest (machine ):
366+ self ._set_uname (('Linux' , 'localhost' , '3.18.91+' ,
367+ '#1 Tue Jan 9 20:35:43 UTC 2018' , machine ))
368+ self .assertEqual (get_platform (), f'android-9-{ abi } ' )
369+
350370 # XXX more platforms to tests here
351371
352372 @unittest .skipIf (is_wasi , "Incompatible with WASI mapdir and OOT builds" )
0 commit comments