<commit_before>#!/usr/bin/env python

import sys
import unittest
import StringIO
import pyrtl

sys.path.append("test")
import adder

class TestAdder(unittest.TestCase):
  sim_trace = None

  @classmethod
  def setUpClass(cls):
    cls.sim_trace = adder.run_adder()

  def test_adder(self):
    output = StringIO.StringIO()
    self.sim_trace.print_trace(output)
    self.assertEqual(output.getvalue(), open("test/adder_output.txt").read())

  def test_export(self):
    output = StringIO.StringIO()
    pyrtl.ParseState.export(pyrtl.TrivialGraphExporter(), output)

    with open("adder.vcd", "w") as vcd_fp:
      TestAdder.sim_trace.print_vcd(vcd_fp)
    #print output.getvalue()
    #with open("curr.txt", "w") as fp:
    #  fp.write(output.getvalue())
    #self.assertEqual(output.getvalue(), open("test/adder_export.txt", "r").read())
<commit_msg>run_test modified to not call old TrivialGraph class<commit_after>#!/usr/bin/env python

import sys
import unittest
import StringIO
import pyrtl

sys.path.append("test")
import adder

class TestAdder(unittest.TestCase):
  sim_trace = None

  @classmethod
  def setUpClass(cls):
    cls.sim_trace = adder.run_adder()

  def test_adder(self):
    output = StringIO.StringIO()
    self.sim_trace.print_trace(output)
    self.assertEqual(output.getvalue(), open("test/adder_output.txt").read())

  def test_export(self):
    output = StringIO.StringIO()
    #pyrtl.ParseState.export(pyrtl.TrivialGraphExporter(), output)

    #with open("adder.vcd", "w") as vcd_fp:
    #  TestAdder.sim_trace.print_vcd(vcd_fp)

{'fraction_non_alphanumeric': 0.13470173187940987, 'fraction_numerical': 0.0, 'mean_word_length': 4.492957746478873, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '7502726', 'n_tokens_mistral': 566, 'n_tokens_neox': 540, 'n_words': 100}