Elasticity, viscoelasticity and glass transitions of glass-forming liquids and model solids are investigated by computer simulations at equilibrium using the stress fluctuation formalism. The models systems studied include Lennard-Jones systems at two and three dimensions, a binary mixture of Lennard-Jones (LJ) particles constituting the two-dimensional version of the well known glass-former Kob-Andersen model (KA2d model), a AB13 binary mixture of repulsive particles and a ternary mixture of hard spheres. Our studies aim mainly at the effect of the temperature T on the mechanical properties of the systems under investigation, with special focus on phase transitions such as the crystallization, or the glass transition. Our results are prese...