Standard protocol for drug-testing in the US is to ask the testee for a list of all prescription and OTC drugs he is currently taking. If something comes back positive, and it is on the list you gave them, they may ask you about it. At that point, you show them the prescription bottle. If you DIDN'T tell them about the drug(s) before the test, you're going to be in a world of hurt.
I got tested several times while at Texas Instruments Defense Systems and Electronics. I was on several prescriptions at the time, one of them a serious (read: opiate) pain med. The tester was competent. She knew every drug on that list, and she knew their indications for use. Upon reading the list, she quietly suggested that I read up on FMLA, as asthma was specifically one of the conditions for which FMLA leave was authorized and the employer couldn't say a word about it. I had NOT told her I had asthma, I had NOT used my inhaler in front of her. She got it from the drug list.
Nothing was said about the opiate, and nothing was ever said about the test results. I have to assume they got a positive test for codeine, looked at the list, said "Yes, he told us about it, no problem."