-
Notifications
You must be signed in to change notification settings - Fork 510
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
common: separate test to verify if Valgrind enabled in tests
Signed-off-by: Tomasz Gromadzki <tomasz.gromadzki@intel.com>
- Loading branch information
Showing
6 changed files
with
63 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
valgrind_check |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# SPDX-License-Identifier: BSD-3-Clause | ||
# Copyright 2024, Intel Corporation | ||
|
||
# | ||
# src/test/valgrind_check/Makefile -- build valgrind_check unit test | ||
# | ||
TARGET = valgrind_check | ||
OBJS = valgrind_check.o | ||
|
||
include ../Makefile.inc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Persistent Memory Development Kit | ||
|
||
This is src/test/valgrind_check/README. | ||
|
||
This directory contains a unit test for Valgrind enabling. | ||
|
||
The program in valgrind_check.c verifies if Valgrind was enabled during build. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/usr/bin/env bash | ||
# SPDX-License-Identifier: BSD-3-Clause | ||
# Copyright 2024, Intel Corporation | ||
|
||
# | ||
# src/test/valgrind_check/TEST0 -- unit test for valgrind_check | ||
# | ||
|
||
. ../unittest/unittest.sh | ||
|
||
require_test_type short | ||
require_valgrind | ||
|
||
setup | ||
|
||
expect_normal_exit ./valgrind_check$EXESUFFIX | ||
|
||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// SPDX-License-Identifier: BSD-3-Clause | ||
/* Copyright 2024, Intel Corporation */ | ||
|
||
/* | ||
* valgrind_check.c -- unit test Valgrind enabled during build | ||
* | ||
* usage: valgrind_check | ||
* | ||
*/ | ||
|
||
#include "valgrind_internal.h" | ||
|
||
#ifndef VALGRIND_ENABLED | ||
#error Valgrind tools not properly configured | ||
#endif | ||
|
||
int | ||
main(int argc, char *argv[]) | ||
{ | ||
#if VALGRIND_ENABLED | ||
return 0; | ||
#else | ||
return 1; | ||
#endif | ||
} |