Skip to content

Commit

Permalink
Movet format to config
Browse files Browse the repository at this point in the history
  • Loading branch information
vmilosevic committed Nov 22, 2024
1 parent 857667e commit 2c771b4
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 31 deletions.
29 changes: 18 additions & 11 deletions test/lit.cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,32 @@

import os
import sys
import platform
import re
import subprocess
import tempfile

import datetime
import lit
import lit.formats
import lit.util

from lit.llvm import llvm_config
from lit.llvm.subst import ToolSubst
from lit.llvm.subst import FindTool
from lit.formats.base import TestFormat


# Configuration file for the 'lit' test runner.

class TimestampedTestFormat(TestFormat):
def __init__(self):
super().__init__('Timestamped Test')

def execute(self, test, lit_config):
start_timestamp = datetime.datetime.now().strftime("%Y-%m-%dT%H:%M:%S%z")
test.setMetric('start_timestamp', start_timestamp)

# Run the test
result = lit.TestRunner.executeShTest(test, lit_config)

end_timestamp = datetime.datetime.now().strftime("%Y-%m-%dT%H:%M:%S%z")
test.setMetric('end_timestamp', end_timestamp)

return result

def set_system_desc_features(system_desc):
config.available_features.add(system_desc["chip_descs"][0]["arch"])
if len(system_desc["chip_desc_indices"]) > 1:
Expand All @@ -31,11 +41,8 @@ def set_system_desc_features(system_desc):
# name: The name of this test suite.
config.name = "TTMLIR"

from timestamped_test_format import TimestampedTestFormat
config.test_format = TimestampedTestFormat()

#config.test_format = lit.formats.ShTest(not llvm_config.use_lit_shell)

# Stablehlo tests can be optionally enabled.
if config.enable_stablehlo:
config.available_features.add("stablehlo")
Expand Down
20 changes: 0 additions & 20 deletions test/timestamped_test_format.py

This file was deleted.

0 comments on commit 2c771b4

Please sign in to comment.