This might be the 1994 film, Terminal Voyage, as per Movie Identification - Spaceship, earth destroyed but not really.
In 2035, global warming rendered the Earth barely inhabitable and its human population is on the verge of extinction. The Earth Federation sends a space ship on a century-long trip to a distant planet Trion which could be suitable for colonization. The eight crew-members come from Russia, United States, China, United Kingdom, France, and Saudi Arabia.
As the ship approaches Trion, the crew wakes from hibernation. They immediately find a decomposed corpse of the Captain in his capsule. The ship's XO, Commander Hollis, assumes command. When he reads a secure transmission from Earth received while they were sleeping, he commits suicide, leaving a note that he "joins his loved ones". The new CO, Lieutenant Jammad, reveals the content of the message: the Earth has been devastated in a nuclear holocaust.
Zinovitz discovers that the ship's systems have been tampered with. A fight for power ensues and Becker, as a representative of the government, relieves Jammad from command. He is soon found dead in a malfunctioned virtual reality simulator. The remaining crew-members suspect that Becker killed the officers and use force to arrest her, discovering in process that she is an android.
When questioned, Becker denies any guilt then sets off the self-destruction sequence. Granier and Han are too devastated to continue and commit suicide with a morphine overdose, and Reese and Zinovitz make it to the escape capsule. As the countdown reaches zero, they find themselves in an underground simulation facility stationed on Earth. There was no space flight – it is their final test, an "extreme stress simulation" scenario which involved the death of the commanding officer and multiple system failures. The crew have only been in hibernation for 6 months, and Hollis, Jammad and Becker apparently knew about the test.
However the nuclear war on Earth was indeed real, and the facility is empty and abandoned. The film ends with a view of a destroyed city, as Reese and Zinovitz look on to uncertain future.