Tests of local hidden-variable theories using measurements with continuous-variable (CV) outcomes are developed, and a comparison of different methods is presented. As examples, we focus on multipartite entangled Greenberger-Horne-Zeilinger and cluster states. We suggest a physical process that produces the states proposed here, and investigate experiments both with and without binning of the continuous variable. In the former case, the Mermin-Klyshko inequalities can be used directly. For unbinned outcomes, the moment-based Cavalcanti-Foster-Reid-Drummond inequalities are extended to functional inequalities by consideration of arbitrary functions of the measurements at each site. By optimizing these functions, we obtain more robust violations of local hidden-variable theories than with either binning or moments. Recent inequalities based on the algebra of quaternions and octonions are compared with these methods. Since the prime advantage of CV experiments is to provide a route to highly efficient detection via homodyne measurements, we analyze the effect of noise and detection losses in both binned and unbinned cases. The CV moment inequalities with an optimal function have greater robustness to both loss and noise. This could permit a loophole-free test of Bell inequalities.