Преглед на файлове

tests: skip when no worker is found

Nathalie Furmento преди 9 години
родител
ревизия
8437b45661
променени са 2 файла, в които са добавени 15 реда и са изтрити 1 реда
  1. 7 0
      tests/datawizard/noreclaim.c
  2. 8 1
      tests/disk/disk_pack.c

+ 7 - 0
tests/datawizard/noreclaim.c

@@ -92,6 +92,13 @@ int main(int argc, char **argv)
 	if (ret == -ENODEV) return STARPU_TEST_SKIPPED;
 	STARPU_CHECK_RETURN_VALUE(ret, "starpu_init");
 
+	if (starpu_cpu_worker_get_count() == 0)
+	{
+		FPRINTF(stderr, "We need at least 1 CPU worker.\n");
+		starpu_shutdown();
+		return STARPU_TEST_SKIPPED;
+	}
+
 	starpu_variable_data_register(&handle, -1, 0, FILL);
 
 	/* This makes the data allocated */

+ 8 - 1
tests/disk/disk_pack.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2013 Corentin Salingue
- * Copyright (C) 2015 CNRS
+ * Copyright (C) 2015, 2016 CNRS
  *
  * StarPU is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -80,6 +80,13 @@ int dotest(struct starpu_disk_ops *ops, char *base)
 	ret = starpu_init(&conf);
 	if (ret == -ENODEV) goto enodev;
 
+	if (starpu_cpu_worker_get_count() == 0)
+	{
+		FPRINTF(stderr, "We need at least 1 CPU worker.\n");
+		starpu_shutdown();
+		return STARPU_TEST_SKIPPED;
+	}
+
 	/* Initialize path and name */
 	const char *name_file_start = "STARPU_DISK_COMPUTE_DATA_";
 	const char *name_file_end = "STARPU_DISK_COMPUTE_DATA_RESULT_";