Skip to content

Commit

Permalink
mem.sh fix
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
anjalidk committed Mar 19, 2024
1 parent 69a2c64 commit 6f6b98d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 3 additions & 3 deletions tests/MEM/Makefile
Original file line number Diff line number Diff line change
@@ -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)
6 changes: 5 additions & 1 deletion tests/MEM/mem.sh
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 6f6b98d

Please sign in to comment.