summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/Makefile7
-rw-r--r--test/src/gtest_fieldstat.cpp15
2 files changed, 5 insertions, 17 deletions
diff --git a/test/Makefile b/test/Makefile
deleted file mode 100644
index 0718719..0000000
--- a/test/Makefile
+++ /dev/null
@@ -1,7 +0,0 @@
-LIBS=../lib/libMESA_field_stat2.so.*
-INC=-I../inc/
-all:
- g++ -o fs2_test -g -Wall fs2_test.cpp $(INC) $(LIBS) -lpthread
-clean:
- rm fs2_test fs2_test.status* -f
-
diff --git a/test/src/gtest_fieldstat.cpp b/test/src/gtest_fieldstat.cpp
index 609853e..6683a31 100644
--- a/test/src/gtest_fieldstat.cpp
+++ b/test/src/gtest_fieldstat.cpp
@@ -15,22 +15,17 @@ TEST(FeildStatAPI, FieldStatInstanceNew)
fieldstat_instance_free(instance);
}
-/*
+
TEST(FeildStatAPI, FieldStatEnablePrometheusEndpoint)
{
- int ret_enable_prometheus_endpoint = 0;
- int ret_req_prometheus_endpoint = 0;
- const char *request_cmd = "curl -s -o /dev/null http://127.0.0.1:9020/metrics";
+ int ret = 0;
- ret_enable_prometheus_endpoint = fieldstat_global_enable_prometheus_endpoint(9020, "/metrcis");
- EXPECT_EQ(0, ret_enable_prometheus_endpoint);
- usleep(500 * 1000);
- ret_req_prometheus_endpoint = system(request_cmd);
- EXPECT_EQ(0,ret_req_prometheus_endpoint);
+ ret = fieldstat_global_enable_prometheus_endpoint(9020, "/metrcis");
+ EXPECT_EQ(0, ret);
usleep(500 * 1000);
fieldstat_global_disable_prometheus_endpoint();
}
-*/
+
TEST(FeildStatAPI, FieldStatSetPrometheusOutput)
{
struct fieldstat_instance *instance = NULL;