The problem of attenuating unknown and possibly time-varying disturbances acting on a linear time-invariant dynamical system is addressed by means of an adaptive switching control approach. Given a family of pre-designed stabilizing controllers, a supervisory unit infers in real-time the potential behavior of each candidate controller and selects the one providing the best potential performance. To this aim, a set of test functionals is defined, which is shown to enjoy favorable inference properties under certain assumptions on the nature of the disturbances. Both persistent-memory and finite-memory test functionals are analyzed. Further, an implementation of the switching controller is proposed which always guarantees stability of the feed...