// C++ : Outils communs aux tests unitaires
-// Copyright (C) 2009-2013 CEA/DEN, EDF R&D
+// Copyright (C) 2009-2021 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
#include <string>
#include <cstdlib>
+#ifndef WIN32
#include <unistd.h>
+#endif
#include <sys/types.h> // pour getpid()
+#ifndef WIN32
#include <unistd.h> // pour getpid()
+#else
+#include <direct.h>
+#include <process.h>
+#endif
+
static int nbr_vtk = 0;
static cpchar case_name = "hexa";
if (w_default)
{
+#ifndef WIN32
pid_t pid = getpid ();
+#else
+ int pid = _getpid ();
+#endif
char bufpid [8];
sprintf (bufpid, "_p%d", pid);
workspace += bufpid;
call_system (rmdir + workspace);
call_system (mkdir + workspace);
+#ifndef WIN32
chdir (workspace.c_str());
+#else
+ _chdir (workspace.c_str());
+#endif
+
}
// ======================================================== free_workspace
void free_workspace ()