public function post_execution_process()
 {
     if ($this->do_save_results()) {
         if ($this->result_file_writer->get_result_count() == 0 && !pts_result_file::is_test_result_file($this->get_file_name()) && pts_c::$test_flags ^ pts_c::is_recovering && pts_c::$test_flags ^ pts_c::remote_mode) {
             pts_file_io::delete(PTS_SAVE_RESULTS_PATH . $this->get_file_name());
             return false;
         }
         pts_file_io::delete(PTS_SAVE_RESULTS_PATH . $this->get_file_name() . '/test-logs/active/', null, true);
         if (pts_c::$test_flags ^ pts_c::is_recovering && (!pts_result_file::is_test_result_file($this->get_file_name()) || $this->result_already_contains_identifier() == false)) {
             $this->result_file_writer->add_test_notes(pts_test_notes_manager::generate_test_notes($this->tests_to_run), $this->generate_json_system_attributes());
         }
         echo PHP_EOL;
         pts_module_manager::module_process('__event_results_process', $this);
         pts_client::save_result_file($this->result_file_writer, $this->get_file_name());
         pts_module_manager::module_process('__event_results_saved', $this);
         //echo PHP_EOL . 'Results Saved To: ; . PTS_SAVE_RESULTS_PATH . $this->get_file_name() . ;/composite.xml' . PHP_EOL;
         if (!(pts_c::$test_flags & pts_c::auto_mode)) {
             if (pts_c::$test_flags & pts_c::batch_mode) {
                 if (self::$batch_mode_options['OpenBrowser']) {
                     pts_client::display_web_page(PTS_SAVE_RESULTS_PATH . $this->get_file_name() . '/index.html', null, true, true);
                 }
             } else {
                 pts_client::display_web_page(PTS_SAVE_RESULTS_PATH . $this->get_file_name() . '/index.html', null, true, false);
             }
         }
         if ($this->allow_sharing_of_results && pts_network::internet_support_available()) {
             if ($this->auto_upload_to_openbenchmarking || pts_openbenchmarking_client::auto_upload_results() || pts_flags::upload_to_openbenchmarking()) {
                 $upload_results = true;
             } else {
                 if (pts_c::$test_flags & pts_c::batch_mode) {
                     $upload_results = self::$batch_mode_options['UploadResults'];
                 } else {
                     if (!(pts_c::$test_flags & pts_c::auto_mode)) {
                         $upload_results = pts_user_io::prompt_bool_input('Would you like to upload the results to OpenBenchmarking.org', true);
                     } else {
                         $upload_results = false;
                     }
                 }
             }
             if ($upload_results) {
                 $this->openbenchmarking_results_data = pts_openbenchmarking::upload_test_result($this, true);
                 if ($this->get_results_url()) {
                     if (!(pts_c::$test_flags & pts_c::auto_mode) && pts_openbenchmarking_client::auto_upload_results() == false) {
                         pts_client::display_web_page($this->get_results_url(), 'Do you want to launch OpenBenchmarking.org', true);
                     }
                 } else {
                     echo PHP_EOL . 'Results Failed To Upload.' . PHP_EOL;
                 }
             }
         }
     }
 }
 public function pre_execution_process()
 {
     if ($this->do_save_results()) {
         if ($this->is_new_result_file || $this->result_already_contains_identifier() == false) {
             $this->result_file->set_title($this->file_name_title);
             $this->result_file->set_description($this->run_description);
             $this->result_file->set_notes($this->get_notes());
             $this->result_file->set_internal_tags($this->get_internal_tags());
             $this->result_file->set_reference_id($this->get_reference_id());
             $this->result_file->set_preset_environment_variables($this->get_preset_environment_variables());
             // TODO XXX JSON In null and notes
             $sys = new pts_result_file_system($this->results_identifier, phodevi::system_hardware(true), phodevi::system_software(true), $this->generate_json_system_attributes(), pts_client::current_user(), pts_test_notes_manager::generate_test_notes($this->tests_to_run), date('Y-m-d H:i:s'), PTS_VERSION);
             $this->result_file->add_system($sys);
         }
         pts_client::setup_test_result_directory($this->get_file_name());
     }
 }
 public function post_execution_process()
 {
     if ($this->do_save_results()) {
         if ($this->result_file->get_test_count() == 0 && $this->is_new_result_file) {
             pts_file_io::delete(PTS_SAVE_RESULTS_PATH . $this->get_file_name());
             return false;
         }
         pts_file_io::delete(PTS_SAVE_RESULTS_PATH . $this->get_file_name() . '/test-logs/active/', null, true);
         if ($this->is_new_result_file || $this->result_already_contains_identifier() == false) {
             // TODO XXX JSON In null and notes
             $sys = new pts_result_file_system($this->results_identifier, phodevi::system_hardware(true), phodevi::system_software(true), $this->generate_json_system_attributes(), pts_client::current_user(), pts_test_notes_manager::generate_test_notes($this->tests_to_run), date('Y-m-d H:i:s'), PTS_VERSION);
             $this->result_file->add_system($sys);
         }
         echo PHP_EOL;
         pts_module_manager::module_process('__event_results_process', $this);
         pts_client::save_test_result($this->get_file_name() . '/composite.xml', $this->result_file->get_xml(), true, null, $this->results_identifier);
         pts_module_manager::module_process('__event_results_saved', $this);
         //echo PHP_EOL . 'Results Saved To: ; . PTS_SAVE_RESULTS_PATH . $this->get_file_name() . ;/composite.xml' . PHP_EOL;
         if (!$this->auto_mode) {
             if ($this->batch_mode) {
                 if ($this->batch_mode['OpenBrowser']) {
                     pts_client::display_web_page(PTS_SAVE_RESULTS_PATH . $this->get_file_name() . '/index.html', null, true, true);
                 }
             } else {
                 pts_client::display_web_page(PTS_SAVE_RESULTS_PATH . $this->get_file_name() . '/index.html', null, true, false);
             }
         }
         if ($this->allow_sharing_of_results && pts_network::internet_support_available()) {
             if ($this->auto_upload_to_openbenchmarking || pts_openbenchmarking_client::auto_upload_results() || pts_config::read_bool_config('PhoronixTestSuite/Options/Testing/AlwaysUploadResultsToOpenBenchmarking', 'FALSE')) {
                 $upload_results = true;
             } else {
                 if ($this->batch_mode) {
                     $upload_results = $this->batch_mode['UploadResults'];
                 } else {
                     if (!$this->auto_mode) {
                         $upload_results = pts_user_io::prompt_bool_input('Would you like to upload the results to OpenBenchmarking.org', true);
                     } else {
                         $upload_results = false;
                     }
                 }
             }
             if ($upload_results) {
                 $this->openbenchmarking_results_data = pts_openbenchmarking::upload_test_result($this, true);
                 if ($this->get_results_url()) {
                     if (!$this->auto_mode && !$this->batcj_mode && pts_openbenchmarking_client::auto_upload_results() == false) {
                         pts_client::display_web_page($this->get_results_url(), 'Do you want to launch OpenBenchmarking.org', true);
                     }
                 } else {
                     echo PHP_EOL . 'Results Failed To Upload.' . PHP_EOL;
                 }
             }
         }
     }
 }