Skip to content
Snippets Groups Projects
Commit 349cf7f1 authored by Bertrand Bellenot's avatar Bertrand Bellenot
Browse files

Simplify; make Windows compatible (cannot delete cwd).

parent 0f5f489d
No related branches found
No related tags found
No related merge requests found
......@@ -6,11 +6,10 @@
// LICENSE.TXT for details.
//------------------------------------------------------------------------------
// Test runing a file in the same directory `cling CurrentDir.C`
// More info in CIFactory.cpp createCIImpl (line ~850)
// Test running a file in the same directory `cling CurrentDir.C`.
// More info in CIFactory.cpp ("<<< cling interactive line includer >>>")
// 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
// RUN: cp "%s" "%T/CurrentDir.C" && cd %T && %cling -Xclang -verify CurrentDir.C 2>&1 | FileCheck %s
// Test testCurrentDir
extern "C" {
......@@ -18,26 +17,7 @@ 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() {
#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
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.
Finish editing this message first!
Please register or to comment