def main(args):

    pr_config = None

    # Banner
    print("+" + "=" * 78 + "+")
    print("|")
    print(
        "|   T R I L I N O S   P U L L R E Q U E S T   D R I V E R   S T A R T"
    )
    print("|")
    if args.dry_run:
        print("|                D R Y   R U N   M O D E   E N A B L E D")
        print("|")
    print("+" + "=" * 78 + "+")
    print("")

    if 'standard' == args.test_mode:
        pr_config = trilinosprhelpers.TrilinosPRConfigurationStandard(args)
    elif 'installation' == args.test_mode:
        pr_config = trilinosprhelpers.TrilinosPRConfigurationInstallation(args)
    else:
        raise KeyError("ERROR: Unknown test mode, {}, was provided.".format(
            args.test_mode))

    pr_config.prepare_test()

    status = pr_config.execute_test()

    print("PullRequestLinuxDriverTest.py main()> Done.")

    return status
    def test_TrilinosPRConfigurationInstallationExec(self):
        """
        Test the Installation Configuration
        """
        print("")
        args = self.dummy_args()
        pr_config = trilinosprhelpers.TrilinosPRConfigurationInstallation(args)

        # prepare step
        ret = pr_config.prepare_test()
        self.assertEqual(ret, 0)
        self.mock_cpu_count.assert_called()

        # execute step
        ret = pr_config.execute_test()
        self.mock_chdir.assert_called_once()
        self.mock_subprocess_check_call.assert_called_once()
        self.assertEqual(ret, 0)
        self.assertTrue(
            Path(os.path.join(args.workspace_dir,
                              "generatedPRFragment.cmake")).is_file())
        os.unlink(os.path.join(args.workspace_dir,
                               "generatedPRFragment.cmake"))
        self.assertTrue(
            Path(os.path.join(args.workspace_dir,
                              "packageEnables.cmake")).is_file())
        os.unlink(os.path.join(args.workspace_dir, "packageEnables.cmake"))
        self.assertTrue(
            Path(
                os.path.join(args.workspace_dir,
                             "package_subproject_list.cmake")).is_file())
        os.unlink(
            os.path.join(args.workspace_dir, "package_subproject_list.cmake"))
Exemplo n.º 3
0
    def test_TrilinosPRConfigurationInstallationDryRun(self):
        """
        Test the Installation Configuration
        """
        args = self.dummy_args_dry_run()
        pr_config = trilinosprhelpers.TrilinosPRConfigurationInstallation(args)

        # prepare step
        ret = pr_config.prepare_test()
        self.assertEqual(ret, 0)
        self.mock_cpu_count.assert_called()

        # execute step
        ret = pr_config.execute_test()
        self.assertEqual(ret, 0)
Exemplo n.º 4
0
    def test_TrilinosPRConfigurationInstallationExec(self):
        """
        Test the Installation Configuration
        """
        print("")
        args = self.dummy_args()
        pr_config = trilinosprhelpers.TrilinosPRConfigurationInstallation(args)

        # prepare step
        ret = pr_config.prepare_test()
        self.assertEqual(ret, 0)
        self.mock_cpu_count.assert_called()

        # execute step
        with self.assertRaises(NotImplementedError):
            ret = pr_config.execute_test()
Exemplo n.º 5
0
    def test_TrilinosPRConfigurationInstallationExec(self):
        """
        Test the Installation Configuration
        """
        print("")
        args = self.dummy_args()
        pr_config = trilinosprhelpers.TrilinosPRConfigurationInstallation(args)

        # prepare step
        ret = pr_config.prepare_test()
        self.assertEqual(ret, 0)
        self.mock_cpu_count.assert_called()

        # execute step
        ret = pr_config.execute_test()
        self.mock_chdir.assert_called_once()
        self.mock_subprocess_check_call.assert_called_once()
        self.assertEqual(ret, 0)