<commit_before>#include <gtest/gtest.h>
#include <cstdlib>
#include <cstdio>
#include <cmath>
#include <boost/math/distributions/students_t.hpp>
#include <stdio.h>

class Models_BasicDistributions_Binormal : public ::testing::Test {
protected:
  virtual void SetUp() {
    FILE *in;
    if(!(in = popen("make path_separator --no-print-directory", "r")))
      throw std::runtime_error("\"make path_separator\" has failed.");
    path_separator += fgetc(in);
    pclose(in);
    
    model.append("models").append(path_separator);
    model.append("basic_distributions").append(path_separator);
    model.append("binormal");

    output1 = model + "1.csv";
    output2 = model + "2.csv";
    factory.addFile(output1);
    factory.addFile(output2);
    
    expected_y1 = 0.0;
    expected_y2 = 0.0;
  }
  std::string path_separator;
  std::string model;
  std::string output1;
  std::string output2;
  
  stan::mcmc::mcmc_output_factory factory;
  double expected_y1;
  double expected_y2;
};

TEST_F(Models_BasicDistributions_Binormal,RunModel) {
  std::string command;
  command = model;
  command += " --samples=";
  command += output1;
  EXPECT_EQ(0, system(command.c_str())) 
    << "Can not execute command: " << command << std::endl;
            
  
  command = model;
  command += " --samples=";
  command += output2;
  EXPECT_EQ(0, system(command.c_str()))
    << "Can not execute command: " << command << std::endl;
}
/*
TEST_F(Models_BasicDistributions_Binormal, y1) {
  stan::mcmc::mcmc_output y1 = factory.create("y.1");
  double neff = y1.effectiveSize();


  boost::math::students_t t(neff-1.0);
  double T = boost::math::quantile(t, 0.975);
  
  EXPECT_NEAR(expected_y1, y1.mean(), T*sqrt(y1.variance()/neff));
}
<commit_msg>chains: removed reference to mcmc_output<commit_after>#include <gtest/gtest.h>
#include <cstdlib>
#include <cstdio>
#include <cmath>
#include <boost/math/distributions/students_t.hpp>
#include <stdio.h>

class Models_BasicDistributions_Binormal : public ::testing::Test {
protected:
  virtual void SetUp() {
    FILE *in;
    if(!(in = popen("make path_separator --no-print-directory", "r")))
      throw std::runtime_error("\"make path_separator\" has failed.");
    path_separator += fgetc(in);
    pclose(in);
    
    model.append("models").append(path_separator);
    model.append("basic_distributions").append(path_separator);
    model.append("binormal");

    output1 = model + "1.csv";
    output2 = model + "2.csv";
    
    expected_y1 = 0.0;
    expected_y2 = 0.0;
  }
  std::string path_separator;
  std::string model;
  std::string output1;
  std::string output2;
  
  double expected_y1;
  double expected_y2;
};

TEST_F(Models_BasicDistributions_Binormal,RunModel) {
  std::string command;
  command = model;
  command += " --samples=";
  command += output1;
  EXPECT_EQ(0, system(command.c_str())) 
    << "Can not execute command: " << command << std::endl;
            
  
  command = model;
  command += " --samples=";
  command += output2;
  EXPECT_EQ(0, system(command.c_str()))
    << "Can not execute command: " << command << std::endl;
}
/*
TEST_F(Models_BasicDistributions_Binormal, y1) {
  stan::mcmc::mcmc_output y1 = factory.create("y.1");
  double neff = y1.effectiveSize();


  boost::math::students_t t(neff-1.0);
  double T = boost::math::quantile(t, 0.975);
  
  EXPECT_NEAR(expected_y1, y1.mean(), T*sqrt(y1.variance()/neff));
}

{'fraction_non_alphanumeric': 0.16157461809635723, 'fraction_numerical': 0.01880141010575793, 'mean_word_length': 4.089686098654709, 'pattern_counts': {'":': 0, '<': 39, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3829697', 'n_tokens_mistral': 1244, 'n_tokens_neox': 1212, 'n_words': 224}