Cook and stir onion and garlic in olive oil until translucent. Add mushrooms, cook for several minutes. Add tomatoes, olives and capers. Bring to boil, reduce heat and simmer for one hour. Cook pasta. Drain and toss with sauce. Serve with grated cheese.