From 6f6b98d39c45e9e39b56ef1374b3e3b0e800cc32 Mon Sep 17 00:00:00 2001 From: Anjali Kulkarni Date: Tue, 19 Mar 2024 16:34:04 -0700 Subject: [PATCH] mem.sh fix On the Ubuntu system on which qa_test.yml is run, gcc does not seem to accept -lresource as a CFLAGS. Instead, added this on the 'make' target. In addition, in mem.sh, we need to cd to the correct directory, before running make. Signed-off-by: Anjali Kulkarni --- tests/MEM/Makefile | 6 +++--- tests/MEM/mem.sh | 6 +++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/tests/MEM/Makefile b/tests/MEM/Makefile index ad590dd..043965c 100644 --- a/tests/MEM/Makefile +++ b/tests/MEM/Makefile @@ -1,14 +1,14 @@ CC = gcc export LD_LIBRARY_PATH = `git rev-parse --show-toplevel` -CFLAGS = -g -Wall -Werror -I $(LD_LIBRARY_PATH) -std=gnu99 -L $(LD_LIBRARY_PATH) -lresource +CFLAGS = -g -Wall -Werror -I $(LD_LIBRARY_PATH) -std=gnu99 -L $(LD_LIBRARY_PATH) REXE = mem_test mem_test_cg MFILES = mem_info.* mem_test: mem_test.c - $(CC) $(CFLAGS) -o $@ $^ + $(CC) $(CFLAGS) -o $@ $^ -lresource mem_test_cg: mem_test_cg.c - $(CC) $(CFLAGS) -o $@ $^ + $(CC) $(CFLAGS) -o $@ $^ -lresource clean: rm -rf $(MFILES) $(REXE) diff --git a/tests/MEM/mem.sh b/tests/MEM/mem.sh index 786146b..42ea8df 100755 --- a/tests/MEM/mem.sh +++ b/tests/MEM/mem.sh @@ -1,9 +1,13 @@ #!/bin/sh # Enable -DTESTING in Makefile and the recompile library - make -make clean +export LD_LIBRARY_PATH=`git rev-parse --show-toplevel` +cd $LD_LIBRARY_PATH/tests/MEM + +make clean make mem_test + cat /proc/meminfo > mem_info.orig sed -i 's/[ ]\+/ /g' mem_info.orig ./mem_test