Ok--let's try to isolate that problem area. Let's start by running only the test that is failing. On your card under ML/scripts you'll see something like this:

Open up the api_test.lua file with a text editor and scroll down to the end, you'll see this:
function api_tests()
menu.close()
console.clear()
console.show()
test_log = logger("LUATEST.LOG")
-- note: each test routine must print a blank line at the end
strict_tests()
generic_tests()
printf("Module tests...\n")
test_io()
test_camera_gui()
test_menu()
test_camera_take_pics()
sleep(1)
test_multitasking()
test_keys()
test_lv()
test_lens_focus()
test_camera_exposure()
test_movie()
printf("Done!\n")
test_log:close()
key.wait()
console.hide()
end
Comment out all the tests that you don't want to run. In our case we only want the test_lens_focus() so put a "--" in front of all the other tests:
function api_tests()
menu.close()
console.clear()
console.show()
test_log = logger("LUATEST.LOG")
-- note: each test routine must print a blank line at the end
-- strict_tests()
-- generic_tests()
printf("Module tests...\n")
-- test_io()
-- test_camera_gui()
-- test_menu()
-- test_camera_take_pics()
-- sleep(1)
-- test_multitasking()
-- test_keys()
-- test_lv()
test_lens_focus()
-- test_camera_exposure()
-- test_movie()
printf("Done!\n")
test_log:close()
key.wait()
console.hide()
end
Make sure you do a shutter half-press when the test asks for it.
Here's how a couple of lenses did on the 700D. First one is the 28-105mm and the second is the 50mm 1.8 STM lens.
===============================================================================
ML/SCRIPTS/API_TEST.LUA - 2018-4-22 14:35:43
===============================================================================
Module tests...
Testing lens focus functionality...
Autofocus outside LiveView...
Focus distance: 1860
Autofocus in LiveView...
Please trigger autofocus (half-shutter / AF-ON / * ).
19...18...17...16...15...Autofocus triggered.
Autofocus completed.
Focus distance: 2590
Focusing backward...
Focus distance: 1860
Focus motor position: 0
Focusing forward with step size 3, wait=true...
...
Focus distance: 470
Focus motor position: 0
Focusing backward with step size 3, wait=true...
........
Focus distance: 655350
Focus motor position: 0
Focus range: 3 steps forward, 8 steps backward.
Motor steps: 0 forward, 0 backward, 0 lost.
Focusing forward with step size 3, wait=false...
.....................................
Focus distance: 470
Focus motor position: 0
Focusing backward with step size 3, wait=false...
..................................
Focus distance: 655350
Focus motor position: 0
Focus range: 37 steps forward, 34 steps backward.
Motor steps: 0 forward, 0 backward, 0 lost.
Focusing forward with step size 2, wait=true...
.....................................................
Focus distance: 470
Focus motor position: 0
Focusing backward with step size 2, wait=true...
...................................................
Focus distance: 655350
Focus motor position: 0
Focus range: 53 steps forward, 51 steps backward.
Motor steps: 0 forward, 0 backward, 0 lost.
Focusing forward with step size 2, wait=false...
...
Focus distance: 470
Focus motor position: 0
Focusing backward with step size 2, wait=false...
...
Focus distance: 655350
Focus motor position: 0
Focus range: 126 steps forward, 124 steps backward.
Motor steps: 0 forward, 0 backward, 0 lost.
Focusing forward with step size 1, wait=true...
...
Focus distance: 470
Focus motor position: 0
Focusing backward with step size 1, wait=true...
...
Focus distance: 655350
Focus motor position: 0
Focus range: 212 steps forward, 212 steps backward.
Motor steps: 0 forward, 0 backward, 0 lost.
Focusing forward with step size 1, wait=false...
...
Focus distance: 470
Focus motor position: 0
Focusing backward with step size 1, wait=false...
...
Focus distance: 655350
Focus motor position: 0
Focus range: 303 steps forward, 310 steps backward.
Motor steps: 0 forward, 0 backward, 0 lost.
Focus test completed.
Done!
===============================================================================
ML/SCRIPTS/API_TEST.LUA - 2018-4-22 14:38:10
===============================================================================
Module tests...
Testing lens focus functionality...
Autofocus outside LiveView...
Focus distance: 3500
Autofocus in LiveView...
Please trigger autofocus (half-shutter / AF-ON / * ).
19...18...17...Autofocus triggered.
Autofocus completed.
Focus distance: 3500
Focusing backward...
Focus distance: 655350
Focus motor position: 0
Focusing forward with step size 3, wait=true...
.........................
Focus distance: 340
Focus motor position: 0
Focusing backward with step size 3, wait=true...
.........................
Focus distance: 655350
Focus motor position: 0
Focus range: 25 steps forward, 25 steps backward.
Motor steps: 0 forward, 0 backward, 0 lost.
Focusing forward with step size 3, wait=false...
...
Focus distance: 1100
Focus motor position: 0
Focusing backward with step size 3, wait=false...
...
Focus distance: 1100
Focus motor position: 0
Focus range: 162 steps forward, 163 steps backward.
Motor steps: 0 forward, 0 backward, 0 lost.
Focusing forward with step size 2, wait=true...
...
Focus distance: 1100
Focus motor position: 0
Focusing backward with step size 2, wait=true...
...
Focus distance: 1100
Focus motor position: 0
Focus range: 164 steps forward, 164 steps backward.
Motor steps: 0 forward, 0 backward, 0 lost.
Focusing forward with step size 2, wait=false...
...
Focus distance: 1100
Focus motor position: 0
Focusing backward with step size 2, wait=false...
...
Focus distance: 1100
Focus motor position: 0
Focus range: 419 steps forward, 421 steps backward.
Motor steps: 0 forward, 0 backward, 0 lost.
Focusing forward with step size 1, wait=true...
...
Focus distance: 1100
Focus motor position: 0
Focusing backward with step size 1, wait=true...
...
Focus distance: 1100
Focus motor position: 0
Focus range: 1055 steps forward, 1055 steps backward.
Motor steps: 0 forward, 0 backward, 0 lost.
Focusing forward with step size 1, wait=false...
...
Focus distance: 1100
Focus motor position: 0
Focusing backward with step size 1, wait=false...
...
Focus distance: 1100
Focus motor position: 0
Focus range: 1057 steps forward, 1058 steps backward.
Motor steps: 0 forward, 0 backward, 0 lost.
Focus test completed.
Done!