Skip to content

Commit

Permalink
tests/shmem: also test topologies with memattrs/cpukinds/io from XML
Browse files Browse the repository at this point in the history
Signed-off-by: Brice Goglin <Brice.Goglin@inria.fr>
  • Loading branch information
bgoglin committed Feb 3, 2021
1 parent 5cf8a51 commit b4f945d
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
34 changes: 34 additions & 0 deletions tests/hwloc/shmem.c
Expand Up @@ -205,6 +205,7 @@ int main(int argc, char *argv[])
hwloc_obj_t nodes[3];
uint64_t node_distances[9];
unsigned i,j;
const char *top_srcdir;
int err, ret, ret2;

if (argc > 1) {
Expand Down Expand Up @@ -277,6 +278,39 @@ int main(int argc, char *argv[])
printf("destroying original\n");
hwloc_topology_destroy(orig);

top_srcdir = getenv("HWLOC_TOP_SRCDIR");
if (top_srcdir) {
const char *xmlnames[4] = {
"16intel64-manyVFs.xml",
"8intel64-4n2t-memattrs.xml",
"fakecpukinds.xml",
"fakeheterodistances.xml"
};
for(i=0; i<4; i++) {
char xmlpath[PATH_MAX];
snprintf(xmlpath, sizeof(xmlpath), "%s/tests/hwloc/xml/%s", top_srcdir, xmlnames[i]);

printf("#########################################\n");
printf("creating from XML %s\n", xmlpath);
err = hwloc_topology_init(&orig);
assert(!err);
err = hwloc_topology_set_xml(orig, xmlpath);
assert(!err);
err = hwloc_topology_set_all_types_filter(orig, HWLOC_TYPE_FILTER_KEEP_ALL);
assert(!err);
err = hwloc_topology_load(orig);
assert(!err);

ret = test(orig, argv[0]);

printf("destroying original\n");
hwloc_topology_destroy(orig);
}
} else {
printf("#########################################\n");
printf("Skipping XML tests because HWLOC_TOP_SRCDIR isn't defined in the environment\n");
}

/* we caught errors above.
* return SKIP if both returned SKIP. otherwise SUCCESS
*/
Expand Down
6 changes: 5 additions & 1 deletion tests/hwloc/wrapper.sh.in
Expand Up @@ -2,13 +2,17 @@
#-*-sh-*-

#
# Copyright © 2012-2020 Inria. All rights reserved.
# Copyright © 2012-2021 Inria. All rights reserved.
# See COPYING in top-level directory.
#

HWLOC_top_builddir="@HWLOC_top_builddir@"
HWLOC_top_srcdir="@HWLOC_top_srcdir@"
xmlbuffer=xmlbuffer@EXEEXT@

HWLOC_TOP_SRCDIR=${HWLOC_top_srcdir}
export HWLOC_TOP_SRCDIR

HWLOC_PLUGINS_PATH=${HWLOC_top_builddir}/hwloc/.libs
export HWLOC_PLUGINS_PATH

Expand Down

0 comments on commit b4f945d

Please sign in to comment.