Please point me to any dupes or better places to post this question that you may find.
I have never sold software before, but when I put myself in my customers' shoes, I think, "I sure would like to see source code for automatic tests for any software that I buy. It would serve as awesomely detailed documentation for the software that I'm buying! In fact, I'd love to see the tests as proof-of-concept before I buy, if possible."
From the seller's perspective, I see no reason to hide the test code source (as long as the tests only access the binaries through "front doors" and contain no sensitive data), or even to release the tests as open source to receive help from anyone who wants to help us, as well as prove to potential customers what the software can do in detail.
So... Is it customary, or even a good idea, to let users see (some) automated test code, or even release it open-source, for a closed-source application application that you are selling?
EDIT: Thank you all for the insightful comments. I should clarify that my goal is not to say "Look at how high-quality my software is!" but instead "This is how you use the software" (using tests as documentation). This is for an API; no UI is involved. I just want to demonstrate how to use it (public interface), not the internal workings. I really hate demo apps that are very long, but show only the "happy path" through an API, so I was looking for a way to improve on that.