Skip to content
Snippets Groups Projects
Commit e9991ef2 authored by Frederich Munch's avatar Frederich Munch Committed by Axel Naumann
Browse files

Revert "Simplify; make Windows compatible (cannot delete cwd)."

This reverts commit 245922175593ec769be5abf63011d86aa2c02934.
parent 349cf7f1
No related branches found
No related tags found
No related merge requests found
......@@ -6,10 +6,11 @@
// LICENSE.TXT for details.
//------------------------------------------------------------------------------
// Test running a file in the same directory `cling CurrentDir.C`.
// More info in CIFactory.cpp ("<<< cling interactive line includer >>>")
// Test runing a file in the same directory `cling CurrentDir.C`
// More info in CIFactory.cpp createCIImpl (line ~850)
// RUN: cp "%s" "%T/CurrentDir.C" && cd %T && %cling -Xclang -verify CurrentDir.C 2>&1 | FileCheck %s
// RUN: cd %S && %cling -Xclang -verify CurrentDir.C 2>&1 | FileCheck %s
// RUN: mkdir %T/Remove && cd %T/Remove && rm -rf %T/Remove && %cling -DTEST_CWDRETURN %s -Xclang -verify 2>&1 | FileCheck --check-prefix CHECK --check-prefix CHECKcwd %s
// Test testCurrentDir
extern "C" {
......@@ -17,7 +18,26 @@ extern "C" {
char* getcwd(char *buf, std::size_t size);
}
#ifdef TEST_CWDRETURN
// Make sure include still works
#include <string.h>
#include <vector>
#endif
void CurrentDir() {
printf("Script ran\n"); // CHECK: Script ran
#ifdef TEST_CWDRETURN
char thisDir[1024];
const char *rslt = getcwd(thisDir, sizeof(thisDir));
// Make sure cling reported the error
// CHECKcwd: Could not get current working directory: {{.*}}
if (rslt)
printf("Working directory exists\n");
// CHECK-NOT: Working directory exists
#endif
printf("Script ran\n");
// CHECK: Script ran
}
//expected-no-diagnostics
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment