jansvoboda11 created this revision.
jansvoboda11 added a reviewer: Bigcheese.
Herald added a project: All.
jansvoboda11 requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

This patch gets rid of the ridiculous relative path we use to invoke the 
`module-deps-to-rsp.py` script and creates proper lit substituion, cleaning up 
the tests.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D121525

Files:
  clang/test/ClangScanDeps/modulemap-via-vfs.m
  clang/test/ClangScanDeps/modules-inferred-explicit-build.m
  clang/test/ClangScanDeps/modules-no-undeclared-includes.c
  clang/test/ClangScanDeps/modules-pch-common-submodule.c
  clang/test/ClangScanDeps/modules-pch-common-via-submodule.c
  clang/test/ClangScanDeps/modules-pch.c
  clang/test/ClangScanDeps/modules-symlink.c
  clang/test/lit.cfg.py

Index: clang/test/lit.cfg.py
===================================================================
--- clang/test/lit.cfg.py
+++ clang/test/lit.cfg.py
@@ -115,6 +115,11 @@
     ('%hmaptool', "'%s' %s" % (config.python_executable,
                              os.path.join(config.clang_tools_dir, 'hmaptool'))))
 
+config.substitutions.append(
+    ('%deps-to-rsp',
+     '"%s" %s' % (config.python_executable, os.path.join(config.clang_src_dir, 'utils',
+                                                         'module-deps-to-rsp.py'))))
+
 config.substitutions.append(('%host_cc', config.host_cc))
 config.substitutions.append(('%host_cxx', config.host_cxx))
 
Index: clang/test/ClangScanDeps/modules-symlink.c
===================================================================
--- clang/test/ClangScanDeps/modules-symlink.c
+++ clang/test/ClangScanDeps/modules-symlink.c
@@ -43,10 +43,8 @@
 // RUN: clang-scan-deps -compilation-database %t/cdb.json -format experimental-full \
 // RUN:   -generate-modules-path-args -module-files-dir %t/build > %t/result_pch.json
 //
-// RUN: %python %S/../../utils/module-deps-to-rsp.py %t/result_pch.json \
-// RUN:   --module-name=mod > %t/mod.cc1.rsp
-// RUN: %python %S/../../utils/module-deps-to-rsp.py %t/result_pch.json \
-// RUN:   --tu-index=0 > %t/pch.rsp
+// RUN: %deps-to-rsp %t/result_pch.json --module-name=mod > %t/mod.cc1.rsp
+// RUN: %deps-to-rsp %t/result_pch.json --tu-index=0 > %t/pch.rsp
 //
 // RUN: %clang @%t/mod.cc1.rsp
 // RUN: %clang @%t/pch.rsp
Index: clang/test/ClangScanDeps/modules-pch.c
===================================================================
--- clang/test/ClangScanDeps/modules-pch.c
+++ clang/test/ClangScanDeps/modules-pch.c
@@ -107,14 +107,10 @@
 
 // Explicitly build the PCH:
 //
-// RUN: %python %S/../../utils/module-deps-to-rsp.py %t/result_pch.json \
-// RUN:   --module-name=ModCommon1 > %t/mod_common_1.cc1.rsp
-// RUN: %python %S/../../utils/module-deps-to-rsp.py %t/result_pch.json \
-// RUN:   --module-name=ModCommon2 > %t/mod_common_2.cc1.rsp
-// RUN: %python %S/../../utils/module-deps-to-rsp.py %t/result_pch.json \
-// RUN:   --module-name=ModPCH > %t/mod_pch.cc1.rsp
-// RUN: %python %S/../../utils/module-deps-to-rsp.py %t/result_pch.json \
-// RUN:   --tu-index=0 > %t/pch.rsp
+// RUN: %deps-to-rsp %t/result_pch.json --module-name=ModCommon1 > %t/mod_common_1.cc1.rsp
+// RUN: %deps-to-rsp %t/result_pch.json --module-name=ModCommon2 > %t/mod_common_2.cc1.rsp
+// RUN: %deps-to-rsp %t/result_pch.json --module-name=ModPCH > %t/mod_pch.cc1.rsp
+// RUN: %deps-to-rsp %t/result_pch.json --tu-index=0 > %t/pch.rsp
 //
 // RUN: %clang @%t/mod_common_1.cc1.rsp
 // RUN: %clang @%t/mod_common_2.cc1.rsp
@@ -173,10 +169,8 @@
 
 // Explicitly build the TU:
 //
-// RUN: %python %S/../../utils/module-deps-to-rsp.py %t/result_tu.json \
-// RUN:   --module-name=ModTU > %t/mod_tu.cc1.rsp
-// RUN: %python %S/../../utils/module-deps-to-rsp.py %t/result_tu.json \
-// RUN:   --tu-index=0 > %t/tu.rsp
+// RUN: %deps-to-rsp %t/result_tu.json --module-name=ModTU > %t/mod_tu.cc1.rsp
+// RUN: %deps-to-rsp %t/result_tu.json --tu-index=0 > %t/tu.rsp
 //
 // RUN: %clang @%t/mod_tu.cc1.rsp
 // RUN: %clang @%t/tu.rsp
@@ -235,10 +229,8 @@
 
 // Explicitly build the TU that has common modules with the PCH:
 //
-// RUN: %python %S/../../utils/module-deps-to-rsp.py %t/result_tu_with_common.json \
-// RUN:   --module-name=ModTUWithCommon > %t/mod_tu_with_common.cc1.rsp
-// RUN: %python %S/../../utils/module-deps-to-rsp.py %t/result_tu_with_common.json \
-// RUN:   --tu-index=0 > %t/tu_with_common.rsp
+// RUN: %deps-to-rsp %t/result_tu_with_common.json --module-name=ModTUWithCommon > %t/mod_tu_with_common.cc1.rsp
+// RUN: %deps-to-rsp %t/result_tu_with_common.json --tu-index=0 > %t/tu_with_common.rsp
 //
 // RUN: %clang @%t/mod_tu_with_common.cc1.rsp
 // RUN: %clang @%t/tu_with_common.rsp
Index: clang/test/ClangScanDeps/modules-pch-common-via-submodule.c
===================================================================
--- clang/test/ClangScanDeps/modules-pch-common-via-submodule.c
+++ clang/test/ClangScanDeps/modules-pch-common-via-submodule.c
@@ -60,10 +60,8 @@
 
 // Explicitly build the PCH:
 //
-// RUN: %python %S/../../utils/module-deps-to-rsp.py %t/result_pch.json \
-// RUN:   --module-name=ModCommon > %t/mod_common.cc1.rsp
-// RUN: %python %S/../../utils/module-deps-to-rsp.py %t/result_pch.json \
-// RUN:   --tu-index=0 > %t/pch.rsp
+// RUN: %deps-to-rsp %t/result_pch.json --module-name=ModCommon > %t/mod_common.cc1.rsp
+// RUN: %deps-to-rsp %t/result_pch.json --tu-index=0 > %t/pch.rsp
 //
 // RUN: %clang @%t/mod_common.cc1.rsp
 // RUN: %clang @%t/pch.rsp
@@ -122,10 +120,8 @@
 
 // Explicitly build the TU:
 //
-// RUN: %python %S/../../utils/module-deps-to-rsp.py %t/result_tu.json \
-// RUN:   --module-name=ModTU > %t/mod_tu.cc1.rsp
-// RUN: %python %S/../../utils/module-deps-to-rsp.py %t/result_tu.json \
-// RUN:   --tu-index=0 > %t/tu.rsp
+// RUN: %deps-to-rsp %t/result_tu.json --module-name=ModTU > %t/mod_tu.cc1.rsp
+// RUN: %deps-to-rsp %t/result_tu.json --tu-index=0 > %t/tu.rsp
 //
 // RUN: %clang @%t/mod_tu.cc1.rsp
 // RUN: %clang @%t/tu.rsp
Index: clang/test/ClangScanDeps/modules-pch-common-submodule.c
===================================================================
--- clang/test/ClangScanDeps/modules-pch-common-submodule.c
+++ clang/test/ClangScanDeps/modules-pch-common-submodule.c
@@ -63,10 +63,8 @@
 
 // Explicitly build the PCH:
 //
-// RUN: %python %S/../../utils/module-deps-to-rsp.py %t/result_pch.json \
-// RUN:   --module-name=ModCommon > %t/mod_common.cc1.rsp
-// RUN: %python %S/../../utils/module-deps-to-rsp.py %t/result_pch.json \
-// RUN:   --tu-index=0 > %t/pch.rsp
+// RUN: %deps-to-rsp %t/result_pch.json --module-name=ModCommon > %t/mod_common.cc1.rsp
+// RUN: %deps-to-rsp %t/result_pch.json --tu-index=0 > %t/pch.rsp
 //
 // RUN: %clang @%t/mod_common.cc1.rsp
 // RUN: %clang @%t/pch.rsp
@@ -124,10 +122,8 @@
 
 // Explicitly build the TU:
 //
-// RUN: %python %S/../../utils/module-deps-to-rsp.py %t/result_tu.json \
-// RUN:   --module-name=ModTU > %t/mod_tu.cc1.rsp
-// RUN: %python %S/../../utils/module-deps-to-rsp.py %t/result_tu.json \
-// RUN:   --tu-index=0 > %t/tu.rsp
+// RUN: %deps-to-rsp %t/result_tu.json --module-name=ModTU > %t/mod_tu.cc1.rsp
+// RUN: %deps-to-rsp %t/result_tu.json --tu-index=0 > %t/tu.rsp
 //
 // RUN: %clang @%t/mod_tu.cc1.rsp
 // RUN: %clang @%t/tu.rsp
Index: clang/test/ClangScanDeps/modules-no-undeclared-includes.c
===================================================================
--- clang/test/ClangScanDeps/modules-no-undeclared-includes.c
+++ clang/test/ClangScanDeps/modules-no-undeclared-includes.c
@@ -65,8 +65,8 @@
 // CHECK:        ]
 // CHECK-NEXT: }
 
-// RUN: %python %S/../../utils/module-deps-to-rsp.py %t/result.json --module-name=User > %t/User.cc1.rsp
-// RUN: %python %S/../../utils/module-deps-to-rsp.py %t/result.json --tu-index=0 > %t/tu.rsp
+// RUN: %deps-to-rsp %t/result.json --module-name=User > %t/User.cc1.rsp
+// RUN: %deps-to-rsp %t/result.json --tu-index=0 > %t/tu.rsp
 //
 // RUN: %clang @%t/User.cc1.rsp
 // RUN: %clang @%t/tu.rsp
Index: clang/test/ClangScanDeps/modules-inferred-explicit-build.m
===================================================================
--- clang/test/ClangScanDeps/modules-inferred-explicit-build.m
+++ clang/test/ClangScanDeps/modules-inferred-explicit-build.m
@@ -7,9 +7,9 @@
 //
 // RUN: clang-scan-deps -compilation-database %t.cdb -j 1 -format experimental-full \
 // RUN:   -mode preprocess-minimized-sources -generate-modules-path-args > %t.db
-// RUN: %python %S/../../utils/module-deps-to-rsp.py %t.db --module-name=Inferred > %t.inferred.cc1.rsp
-// RUN: %python %S/../../utils/module-deps-to-rsp.py %t.db --module-name=System > %t.system.cc1.rsp
-// RUN: %python %S/../../utils/module-deps-to-rsp.py %t.db --tu-index=0 > %t.tu.rsp
+// RUN: %deps-to-rsp %t.db --module-name=Inferred > %t.inferred.cc1.rsp
+// RUN: %deps-to-rsp %t.db --module-name=System > %t.system.cc1.rsp
+// RUN: %deps-to-rsp %t.db --tu-index=0 > %t.tu.rsp
 // RUN: %clang @%t.inferred.cc1.rsp -pedantic -Werror
 // RUN: %clang @%t.system.cc1.rsp -pedantic -Werror
 // RUN: %clang @%t.tu.rsp -pedantic -Werror
Index: clang/test/ClangScanDeps/modulemap-via-vfs.m
===================================================================
--- clang/test/ClangScanDeps/modulemap-via-vfs.m
+++ clang/test/ClangScanDeps/modulemap-via-vfs.m
@@ -4,7 +4,7 @@
 // RUN: sed -e "s|DIR|%/t.dir|g" %t.dir/build/vfs.yaml.in > %t.dir/build/vfs.yaml
 // RUN: clang-scan-deps -compilation-database %t.dir/build/compile-commands.json -j 1 -format experimental-full \
 // RUN:   -mode preprocess-minimized-sources -generate-modules-path-args > %t.db
-// RUN: %python %S/../../utils/module-deps-to-rsp.py %t.db --module-name=A > %t.A.cc1.rsp
+// RUN: %deps-to-rsp %t.db --module-name=A > %t.A.cc1.rsp
 // RUN: cat %t.A.cc1.rsp | sed 's:\\\\\?:/:g' | FileCheck %s
 
 // CHECK-NOT: build/module.modulemap
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
  • [PATCH] D121525: [... Jan Svoboda via Phabricator via cfe-commits

Reply via email to