attn: Remove stub code intended for native build
Removed some stub code that was originally used to build
openpower-hw-diags natively (via local meson/ninja). Building in this
manner is not supported right now due to the numerous external
dependencies required by the final binary.
Signed-off-by: Ben Tyner <ben.tyner@ibm.com>
Change-Id: I58c932f68e6cfe980a9a9503fc6e8d71bbd3528a
diff --git a/test/end2end/main.cpp b/test/end2end/main.cpp
index c523842..ff7d468 100644
--- a/test/end2end/main.cpp
+++ b/test/end2end/main.cpp
@@ -1,8 +1,20 @@
#include <libpdbg.h>
+#include <attn/attention.hpp>
#include <attn/attn_config.hpp>
#include <attn/attn_handler.hpp>
#include <cli.hpp>
+#include <util/trace.hpp>
+
+#include <vector>
+
+namespace attn
+{
+// these are in the attn_lib but not all exposed via headers
+int handleSpecial(Attention* i_attention);
+int handleCheckstop(Attention* i_attention);
+int handleVital(Attention* i_attention);
+} // namespace attn
/** @brief Attention handler test application */
int main(int argc, char* argv[])
@@ -21,5 +33,39 @@
// exercise attention gpio event path
attn::attnHandler(&attnConfig);
+ // Get first enabled proc for testing
+ pdbg_target* target = nullptr;
+ pdbg_for_each_class_target("proc", target)
+ {
+ trace::inf("proc: %u", pdbg_target_index(target));
+ if (PDBG_TARGET_ENABLED == pdbg_target_probe(target))
+ {
+ trace::inf("target enabled");
+ break;
+ }
+ }
+
+ // Exercise special, checkstop and vital attention handler paths
+ if ((nullptr != target) &&
+ (PDBG_TARGET_ENABLED == pdbg_target_probe(target)))
+ {
+ std::vector<attn::Attention> attentions;
+
+ attentions.emplace_back(attn::Attention::AttentionType::Special,
+ attn::handleSpecial, target, &attnConfig);
+
+ attentions.emplace_back(attn::Attention::AttentionType::Checkstop,
+ attn::handleCheckstop, target, &attnConfig);
+
+ attentions.emplace_back(attn::Attention::AttentionType::Vital,
+ attn::handleVital, target, &attnConfig);
+
+ std::for_each(std::begin(attentions), std::end(attentions),
+ [](attn::Attention attention) {
+ trace::inf("calling handler");
+ attention.handle();
+ });
+ }
+
return rc;
}