コード例 #1
0
ファイル: regression_tests.py プロジェクト: rjleveque/geoclaw
        This version removes source that may have been compiled with NetCDF
        turned on so that it does not conflict with subsequent tests.

        """

        # Force recompilation of topo_module to add NetCDF flags
        mod_path = os.path.join(os.environ["CLAW"], "geoclaw", "src", "2d",
                                "shallow", "topo_module.mod")
        obj_path = os.path.join(os.environ["CLAW"], "geoclaw", "src", "2d",
                                "shallow", "topo_module.o")
        if os.path.exists(mod_path):
            os.remove(mod_path)
        if os.path.exists(obj_path):
            os.remove(obj_path)

        super(NetCDFBowlSloshTest, self).tearDown()


if __name__ == "__main__":
    if len(sys.argv) > 1:
        if bool(sys.argv[1]):
            # Fake the setup and save out output
            test = NetCDFBowlSloshTest()
            try:
                test.setUp()
                test.runTest(save=True)
            finally:
                test.tearDown()
            sys.exit(0)
    unittest.main()
コード例 #2
0
ファイル: regression_tests.py プロジェクト: hadjimy/geoclaw

    def runTest(self, save=False):
        r"""Test multi-layer basic plane-waves."""

        # Load and write data, change init-condition's starting angle
        self.load_rundata()
        self.rundata.qinit_data.angle = numpy.pi / 4.0
        self.write_rundata_objects()

        # Run code and check
        self.run_code()
        self.check_gauges(save=save, indices=(3, 6))

        # If we have gotten here then we do not need to copy the run results
        self.success = True


if __name__=="__main__":
    if len(sys.argv) > 1:
        if bool(sys.argv[1]):
            # Fake the setup and save out output
            test = MultilayerTest()
            try:
                test.setUp()
                test.runTest(save=True)
            finally:
                test.tearDown()
            sys.exit(0)
    unittest.main()