@@ -318,8 +318,6 @@ class TestTelemeter : public Telemeter {
318
318
TestTelemeter (std::string SessionId) : Uuid(SessionId), Counter(0 ) {}
319
319
320
320
static std::unique_ptr<TestTelemeter> createInstance (Config *config) {
321
- llvm::errs () << " ============================== createInstance is called"
322
- << " \n " ;
323
321
if (!config->EnableTelemetry )
324
322
return nullptr ;
325
323
CurrentContext->ExpectedUuid = nextUuid ();
@@ -348,7 +346,7 @@ class TestTelemeter : public Telemeter {
348
346
349
347
// The vendor can add additional stuff to the entry before logging.
350
348
if (auto *S = dyn_cast<StartupEvent>(Entry)) {
351
- S->MagicStartupMsg = llvm::Twine (" One_ " , ToolPath).str ();
349
+ S->MagicStartupMsg = llvm::Twine (" Startup_ " , ToolPath).str ();
352
350
}
353
351
emitToDestinations (Entry);
354
352
}
@@ -364,7 +362,7 @@ class TestTelemeter : public Telemeter {
364
362
365
363
// The vendor can add additional stuff to the entry before logging.
366
364
if (auto *E = dyn_cast<ExitEvent>(Entry)) {
367
- E->MagicExitMsg = llvm::Twine (" Three_ " , ToolPath).str ();
365
+ E->MagicExitMsg = llvm::Twine (" Exit_ " , ToolPath).str ();
368
366
}
369
367
370
368
emitToDestinations (Entry);
@@ -549,11 +547,11 @@ TEST(TelemetryTest, TelemetryEnabled) {
549
547
{
550
548
std::string ExpectedBuffer =
551
549
(" SessionId:" + llvm::Twine (CurrentContext->ExpectedUuid ) + " \n " +
552
- " MagicStartupMsg:One_ " + llvm::Twine (ToolName) + " \n " +
550
+ " MagicStartupMsg:Startup_ " + llvm::Twine (ToolName) + " \n " +
553
551
" SessionId:" + llvm::Twine (CurrentContext->ExpectedUuid ) + " \n " +
554
552
" MSG_0:Two\n " + " MSG_1:Deux\n " + " MSG_2:Zwei\n " +
555
553
" SessionId:" + llvm::Twine (CurrentContext->ExpectedUuid ) + " \n " +
556
- " MagicExitMsg:Three_ " + llvm::Twine (ToolName) + " \n " )
554
+ " MagicExitMsg:Exit_ " + llvm::Twine (ToolName) + " \n " )
557
555
.str ();
558
556
559
557
EXPECT_STREQ (ExpectedBuffer.c_str (), CurrentContext->Buffer .c_str ());
@@ -570,7 +568,7 @@ TEST(TelemetryTest, TelemetryEnabled) {
570
568
ASSERT_NE (StartupEntry, nullptr );
571
569
EXPECT_STREQ (
572
570
(" [[\" SessionId\" ,\" " + llvm::Twine (CurrentContext->ExpectedUuid ) +
573
- " \" ],[\" MagicStartupMsg\" ,\" One_ " + llvm::Twine (ToolName) + " \" ]]" )
571
+ " \" ],[\" MagicStartupMsg\" ,\" Startup_ " + llvm::Twine (ToolName) + " \" ]]" )
574
572
.str ()
575
573
.c_str (),
576
574
ValueToString (StartupEntry).c_str ());
@@ -592,7 +590,7 @@ TEST(TelemetryTest, TelemetryEnabled) {
592
590
ASSERT_NE (ExitEntry, nullptr );
593
591
EXPECT_STREQ (
594
592
(" [[\" SessionId\" ,\" " + llvm::Twine (CurrentContext->ExpectedUuid ) +
595
- " \" ],[\" MagicExitMsg\" ,\" Three_ " + llvm::Twine (ToolName) + " \" ]]" )
593
+ " \" ],[\" MagicExitMsg\" ,\" Exit_ " + llvm::Twine (ToolName) + " \" ]]" )
596
594
.str ()
597
595
.c_str (),
598
596
ValueToString (ExitEntry).c_str ());
@@ -629,12 +627,12 @@ TEST(TelemetryTest, TelemetryEnabledSanitizeData) {
629
627
// The StringDestination should have removed the odd-positioned msgs.
630
628
std::string ExpectedBuffer =
631
629
(" SessionId:" + llvm::Twine (CurrentContext->ExpectedUuid ) + " \n " +
632
- " MagicStartupMsg:One_ " + llvm::Twine (ToolName) + " \n " +
630
+ " MagicStartupMsg:Startup_ " + llvm::Twine (ToolName) + " \n " +
633
631
" SessionId:" + llvm::Twine (CurrentContext->ExpectedUuid ) + " \n " +
634
632
" MSG_0:Two\n " + " MSG_1:\n " + // <<< was sanitized away.
635
633
" MSG_2:Zwei\n " +
636
634
" SessionId:" + llvm::Twine (CurrentContext->ExpectedUuid ) + " \n " +
637
- " MagicExitMsg:Three_ " + llvm::Twine (ToolName) + " \n " )
635
+ " MagicExitMsg:Exit_ " + llvm::Twine (ToolName) + " \n " )
638
636
.str ();
639
637
EXPECT_STREQ (ExpectedBuffer.c_str (), CurrentContext->Buffer .c_str ());
640
638
}
@@ -650,7 +648,7 @@ TEST(TelemetryTest, TelemetryEnabledSanitizeData) {
650
648
ASSERT_NE (StartupEntry, nullptr );
651
649
EXPECT_STREQ (
652
650
(" [[\" SessionId\" ,\" " + llvm::Twine (CurrentContext->ExpectedUuid ) +
653
- " \" ],[\" MagicStartupMsg\" ,\" One_ " + llvm::Twine (ToolName) + " \" ]]" )
651
+ " \" ],[\" MagicStartupMsg\" ,\" Startup_ " + llvm::Twine (ToolName) + " \" ]]" )
654
652
.str ()
655
653
.c_str (),
656
654
ValueToString (StartupEntry).c_str ());
@@ -670,7 +668,7 @@ TEST(TelemetryTest, TelemetryEnabledSanitizeData) {
670
668
ASSERT_NE (ExitEntry, nullptr );
671
669
EXPECT_STREQ (
672
670
(" [[\" SessionId\" ,\" " + llvm::Twine (CurrentContext->ExpectedUuid ) +
673
- " \" ],[\" MagicExitMsg\" ,\" Three_ " + llvm::Twine (ToolName) + " \" ]]" )
671
+ " \" ],[\" MagicExitMsg\" ,\" Exit_ " + llvm::Twine (ToolName) + " \" ]]" )
674
672
.str ()
675
673
.c_str (),
676
674
ValueToString (ExitEntry).c_str ());
0 commit comments