USB C to A cable testing refined - Nexus 5X only
Edit: Now 6P as well
Edit: added descriptions of output values

Short version
5X
adb shell "cat /sys/bus/i2c/drivers/fusb301/*/fclientcur"
Or  from a shell on the phone
cat /sys/bus/i2c/drivers/fusb301/*/fclientcur

If the result is 3000 an A to C cable is non-compliant

Possible values
0 - standard USB charging
1500 - 1.5 amp type C charging
3000 - 3 amp type C charging

It will also report 0 if not plugged in.

6P
adb shell "cat /sys/class/typec/typec_device/current_detect"
Or from a shell on the phone
cat /sys/class/typec/typec_device/current_detect

If the result is 2 an A to C cable is non-compliant

Possible values
0 - standard USB charging
1 - 1.5A type C
2 - 3A type C

Details
The FUSB301 chip is connected directly to the configuration channel pins in the Type-C port on the Nexus 5X and is used determine if the cable is connected, the orientation, and the power level and direction.  The fusb301 driver makes the charge current value available in the file fclientcur in the sys file system.  Because this is as close as it gets to the CC pins in the port, this is the best that can be done from the phone.

Also, because this can be done from the phone, if it is in fact reliable, an app can be built around this.

Looking at the kernel sources for the 6P, it doesn't have the fusb301 driver so it is probably using a different chip. 

The 6P uses a tusb320
Shared publiclyView activity