summaryrefslogtreecommitdiffstats
path: root/library/cpp/testing/unittest/junit.h
diff options
context:
space:
mode:
authorgalaxycrab <[email protected]>2023-11-27 16:33:16 +0300
committergalaxycrab <[email protected]>2023-11-27 17:27:37 +0300
commitfab1896e3382b8a943398e3ef93fc03ef3d98613 (patch)
tree474fe934a510966762beafae65122ac2346279db /library/cpp/testing/unittest/junit.h
parent3536f8d1eba936f9bdd52a24cc3703e893c3c8da (diff)
KIKIMR-19979 Remove dependency on libxml of library/cpp/testing/unittest
Diffstat (limited to 'library/cpp/testing/unittest/junit.h')
-rw-r--r--library/cpp/testing/unittest/junit.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/library/cpp/testing/unittest/junit.h b/library/cpp/testing/unittest/junit.h
index 27b73013ca0..3a9a9658906 100644
--- a/library/cpp/testing/unittest/junit.h
+++ b/library/cpp/testing/unittest/junit.h
@@ -77,7 +77,12 @@ class TJUnitProcessor : public ITestSuiteProcessor {
struct TOutputCapturer;
public:
- TJUnitProcessor(TString file, TString exec);
+ enum class EOutputFormat {
+ Xml,
+ Json,
+ };
+
+ TJUnitProcessor(TString file, TString exec, EOutputFormat outputFormat);
~TJUnitProcessor();
void SetForkTestsParams(bool forkTests, bool isForked) override;
@@ -111,9 +116,12 @@ private:
}
void SerializeToFile();
+ void SerializeToXml();
+ void SerializeToJson();
void MergeSubprocessReport();
TString BuildFileName(size_t index, const TStringBuf extension) const;
+ TStringBuf GetFileExtension() const;
void MakeReportFileName();
void MakeTmpFileNameForForkedTests();
static void TransferFromCapturer(THolder<TJUnitProcessor::TOutputCapturer>& capturer, TString& out, IOutputStream& outStream);
@@ -125,6 +133,7 @@ private:
private:
const TString FileName; // cmd line param
const TString ExecName; // cmd line param
+ const EOutputFormat OutputFormat;
TString ResultReportFileName;
TMaybe<TTempFile> TmpReportFile;
TMap<TString, TTestSuite> Suites;