[LNT] r310748 - Do not use %T in unittests anymore

Matthias Braun via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 11 12:42:56 PDT 2017


Author: matze
Date: Fri Aug 11 12:42:56 2017
New Revision: 310748

URL: http://llvm.org/viewvc/llvm-project?rev=310748&view=rev
Log:
Do not use %T in unittests anymore

%T is deprecated in favor of `mkdir %t`; see also
https://reviews.llvm.org/D35396

Modified:
    lnt/trunk/tests/lnttool/admin.shtest
    lnt/trunk/tests/lnttool/submit.shtest

Modified: lnt/trunk/tests/lnttool/admin.shtest
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/tests/lnttool/admin.shtest?rev=310748&r1=310747&r2=310748&view=diff
==============================================================================
--- lnt/trunk/tests/lnttool/admin.shtest (original)
+++ lnt/trunk/tests/lnttool/admin.shtest Fri Aug 11 12:42:56 2017
@@ -1,7 +1,8 @@
 # RUN: rm -rf %t.instance
+# RUN: rm -rf %t.tmp && mkdir -p %t.tmp
 # RUN: python %{shared_inputs}/create_temp_instance.py \
 # RUN:   %s %{shared_inputs}/SmallInstance %t.instance
-# RUN: %{shared_inputs}/server_wrapper.sh %t.instance 9092 /bin/sh %s %T %{shared_inputs}
+# RUN: %{shared_inputs}/server_wrapper.sh %t.instance 9092 /bin/sh %s %t.tmp %{shared_inputs}
 
 set -eux
 DIR="$1"
@@ -11,7 +12,7 @@ cd "$DIR"
 rm -rf lntadmin.yaml
 lnt admin create-config > create_config.stdout
 mv lntadmin.yaml create_config.txt
-# RUN: FileCheck %s --check-prefix=CREATE_CONFIG < %T/create_config.txt
+# RUN: FileCheck %s --check-prefix=CREATE_CONFIG < %t.tmp/create_config.txt
 # CREATE_CONFIG: lnt_url: "http://localhost:8000"
 # CREATE_CONFIG-NEXT: database: default
 # CREATE_CONFIG-NEXT: testsuite: nts
@@ -27,11 +28,11 @@ auth_token: test_token
 __EOF__
 
 lnt admin post-run "${SHARED_INPUTS}/sample-a-small.plist" > post_run.stdout
-# RUN: FileCheck %s --check-prefix=POST_RN < %T/post_run.stdout
+# RUN: FileCheck %s --check-prefix=POST_RN < %t.tmp/post_run.stdout
 # POST_RN: http://localhost:9092/api/db_default/v4/nts/runs/3
 
 lnt admin machine-info 1 > machine_info.stdout
-# RUN: FileCheck %s --check-prefix=MACHINE_INFO < %T/machine_info.stdout
+# RUN: FileCheck %s --check-prefix=MACHINE_INFO < %t.tmp/machine_info.stdout
 # MACHINE_INFO: name: localhost__clang_DEV__x86_64
 # MACHINE_INFO: id: 1
 # MACHINE_INFO: hardware: x86_64
@@ -41,7 +42,7 @@ lnt admin machine-info 1 > machine_info.
 
 rm -rf run_3.json
 lnt admin get-run 3 > get_run.stdout
-# RUN: FileCheck %s --check-prefix=GET_RN < %T/run_3.json
+# RUN: FileCheck %s --check-prefix=GET_RN < %t.tmp/run_3.json
 # GET_RN: {
 # GET_RN:   "generated_by":
 # GET_RN:   "machine": {
@@ -59,18 +60,18 @@ lnt admin get-run 3 > get_run.stdout
 # GET_RN: }
 
 lnt admin list-machines > list_machines.stdout
-# RUN: FileCheck %s --check-prefix=LIST_MACHINES < %T/list_machines.stdout
+# RUN: FileCheck %s --check-prefix=LIST_MACHINES < %t.tmp/list_machines.stdout
 # LIST_MACHINES: localhost__clang_DEV__x86_64:1
 # LIST_MACHINES-NEXT: LNT SAMPLE MACHINE:2
 
 lnt admin list-runs 1 > list_runs.stdout
-# RUN: FileCheck %s --check-prefix=LIST_RUNS < %T/list_runs.stdout
+# RUN: FileCheck %s --check-prefix=LIST_RUNS < %t.tmp/list_runs.stdout
 # LIST_RUNS: llvm_project_revision=154331 1
 # LIST_RUNS: llvm_project_revision=152289 2
 
 rm -rf machine_1.json
 lnt admin get-machine 1 > get_machine.stdout
-# RUN: FileCheck %s --check-prefix=GET_MACHINE_JSON < %T/machine_1.json
+# RUN: FileCheck %s --check-prefix=GET_MACHINE_JSON < %t.tmp/machine_1.json
 # GET_MACHINE_JSON: {
 # GET_MACHINE_JSON:   "generated_by":
 # GET_MACHINE_JSON:   "machine": {
@@ -87,12 +88,12 @@ lnt admin get-machine 1 > get_machine.st
 # GET_MACHINE_JSON: }
 
 lnt admin rm-machine 1 > rm_machine.stdout
-# RUN: FileCheck %s --check-prefix=RM_MACHINE < %T/rm_machine.stdout
+# RUN: FileCheck %s --check-prefix=RM_MACHINE < %t.tmp/rm_machine.stdout
 # RM_MACHINE: Deleting runs 1 2 (2/2)
 # RM_MACHINE: Deleted machine localhost__clang_DEV__x86_64:1
 
 lnt admin list-machines > list_machines2.stdout
-# RUN: FileCheck %s --check-prefix=LIST_MACHINES2 < %T/list_machines2.stdout
+# RUN: FileCheck %s --check-prefix=LIST_MACHINES2 < %t.tmp/list_machines2.stdout
 # LIST_MACHINES2-NOT: localhost__clang_DEV__x86_64:1
 # LIST_MACHINES2: LNT SAMPLE MACHINE:2
 
@@ -100,7 +101,7 @@ lnt admin rename-machine 2 hal9000
 # No output
 
 lnt admin list-machines > list_machines3.stdout
-# RUN: FileCheck %s --check-prefix=LIST_MACHINES3 < %T/list_machines3.stdout
+# RUN: FileCheck %s --check-prefix=LIST_MACHINES3 < %t.tmp/list_machines3.stdout
 # LIST_MACHINES3: hal9000:2
 
 # Just post again so we have a machine to merge

Modified: lnt/trunk/tests/lnttool/submit.shtest
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/tests/lnttool/submit.shtest?rev=310748&r1=310747&r2=310748&view=diff
==============================================================================
--- lnt/trunk/tests/lnttool/submit.shtest (original)
+++ lnt/trunk/tests/lnttool/submit.shtest Fri Aug 11 12:42:56 2017
@@ -1,8 +1,9 @@
 # RUN: rm -rf %t.instance
+# RUN: rm -rf %t.tmp && mkdir -p %t.tmp
 # RUN: python %{shared_inputs}/create_temp_instance.py \
 # RUN:   %s %{shared_inputs}/SmallInstance %t.instance
 # RUN: %{shared_inputs}/server_wrapper.sh %t.instance 9091 \
-# RUN:    /bin/sh %s %T %S/Inputs %{shared_inputs} %{src_root}
+# RUN:    /bin/sh %s %t.tmp %S/Inputs %{shared_inputs} %{src_root}
 
 OUTPUT_DIR="$1"
 INPUTS="$2"
@@ -10,7 +11,7 @@ SHARED_INPUTS="$3"
 SRC_ROOT="$4"
 
 lnt submit "http://localhost:9091/db_default/submitRun" --commit 1 "${SHARED_INPUTS}/sample-report.json" -v > "${OUTPUT_DIR}/submit_verbose.txt"
-# RUN: FileCheck %s --check-prefix=CHECK-VERBOSE < %T/submit_verbose.txt
+# RUN: FileCheck %s --check-prefix=CHECK-VERBOSE < %t.tmp/submit_verbose.txt
 #
 # CHECK-VERBOSE: Import succeeded.
 # CHECK-VERBOSE: --- Tested: 10 tests --
@@ -28,14 +29,14 @@ lnt submit "http://localhost:9091/db_def
 
 
 lnt submit "http://localhost:9091/db_default/submitRun" --commit "${SHARED_INPUTS}/sample-report.json" > "${OUTPUT_DIR}/submit0.txt"
-# RUN: FileCheck %s --check-prefix=CHECK-SUBMIT0 < %T/submit0.txt
+# RUN: FileCheck %s --check-prefix=CHECK-SUBMIT0 < %t.tmp/submit0.txt
 #
 # Make sure the old --commit=1 style argument is still accepted.
 lnt submit "http://localhost:9091/db_default/submitRun" --commit=1 "${SHARED_INPUTS}/sample-report.json" > "${OUTPUT_DIR}/submit1.txt"
-# RUN: FileCheck %s --check-prefix=CHECK-SUBMIT1 < %T/submit1.txt
+# RUN: FileCheck %s --check-prefix=CHECK-SUBMIT1 < %t.tmp/submit1.txt
 
 lnt submit "http://localhost:9091/db_default/submitRun" --commit 1 "${SHARED_INPUTS}/sample-report.json" > "${OUTPUT_DIR}/submit2.txt"
-# RUN: FileCheck %s --check-prefix=CHECK-SUBMIT2 < %T/submit2.txt
+# RUN: FileCheck %s --check-prefix=CHECK-SUBMIT2 < %t.tmp/submit2.txt
 
 # CHECK-SUBMIT0: http://localhost:9091/db_default/v4/nts/4
 # CHECK-SUBMIT1: http://localhost:9091/db_default/v4/nts/5
@@ -43,7 +44,7 @@ lnt submit "http://localhost:9091/db_def
 
 
 lnt submit "http://localhost:9091/db_default/v4/compile/submitRun" --commit "${INPUTS}/compile_submission.json" -v > "${OUTPUT_DIR}/submit_compile.txt"
-# RUN: FileCheck %s --check-prefix=CHECK-COMPILE0 < %T/submit_compile.txt
+# RUN: FileCheck %s --check-prefix=CHECK-COMPILE0 < %t.tmp/submit_compile.txt
 #
 # CHECK-COMPILE0: --- Tested: 10 tests --
 #
@@ -59,7 +60,7 @@ lnt submit "http://localhost:9091/db_def
 # CHECK-COMPILE0: Results available at: http://localhost:9091/db_default/v4/compile/5
 
 lnt submit "http://localhost:9091/db_default/submitRun" --commit "${SRC_ROOT}/docs/report-example.json" -v > "${OUTPUT_DIR}/submit_newformat.txt"
-# RUN: FileCheck %s --check-prefix=CHECK-NEWFORMAT < %T/submit_newformat.txt
+# RUN: FileCheck %s --check-prefix=CHECK-NEWFORMAT < %t.tmp/submit_newformat.txt
 #
 # CHECK-NEWFORMAT: Import succeeded.
 # CHECK-NEWFORMAT: --- Tested: 10 tests --
@@ -79,7 +80,7 @@ lnt submit "http://localhost:9091/db_def
 # test-suite based on the Info.Run.tag field instead of the URL. The result
 # should be the same as using the "correct" URL.
 lnt submit "http://localhost:9091/db_default/submitRun" --commit "${INPUTS}/compile_submission.json" -v > "${OUTPUT_DIR}/submit_compile1.txt"
-# RUN: FileCheck %s --check-prefix=CHECK-COMPILE1 < %T/submit_compile1.txt
+# RUN: FileCheck %s --check-prefix=CHECK-COMPILE1 < %t.tmp/submit_compile1.txt
 #
 # CHECK-COMPILE1: Import succeeded.
 #
@@ -91,7 +92,7 @@ lnt submit "http://localhost:9091/db_def
 # Check some error handling/reporting
 rm -f "${OUTPUT_DIR}/submit_errors.txt"
 lnt submit "http://localhost:9091/db_default/v4/badsuite/submitRun" --commit "${INPUTS}/compile_submission.json" >> "${OUTPUT_DIR}/submit_errors.txt" 2>&1
-# RUN: FileCheck %s --check-prefix=CHECK-ERRORS < %T/submit_errors.txt
+# RUN: FileCheck %s --check-prefix=CHECK-ERRORS < %t.tmp/submit_errors.txt
 # CHECK-ERRORS: lnt server error: Unknown test suite 'badsuite'!
 lnt submit "http://localhost:9091/db_baddb/v4/compile/submitRun" --commit "${INPUTS}/compile_submission.json" >> "${OUTPUT_DIR}/submit_errors.txt" 2>&1
 # CHECK-ERRORS: lnt server error: The page you are looking for does not exist.
@@ -113,7 +114,7 @@ lnt submit "http://localhost:9091/db_def
 
 # Adding extra fields to the machine in a submission is fine.
 lnt submit "http://localhost:9091/db_default/v4/compile/submitRun" --commit "${INPUTS}/compile_submission_machine_diff_fine.json" -v > "${OUTPUT_DIR}/submit_compile_machine_diff.txt"
-# RUN: FileCheck %s --check-prefix=CHECK-MACHINEDIFF < %T/submit_compile_machine_diff.txt
+# RUN: FileCheck %s --check-prefix=CHECK-MACHINEDIFF < %t.tmp/submit_compile_machine_diff.txt
 #
 # CHECK-MACHINEDIFF: Imported Data
 # CHECK-MACHINEDIFF: -------------
@@ -128,7 +129,7 @@ lnt submit "http://localhost:9091/db_def
 
 # Test updating existing machine
 lnt submit "http://localhost:9091/db_default/v4/compile/submitRun" --commit "${INPUTS}/compile_submission_machine_diff_reject.json" --update-machine -v > "${OUTPUT_DIR}/submit_compile_machine_update.txt"
-# RUN: FileCheck %s --check-prefix=CHECK-UPDATEMACHINE < %T/submit_compile_machine_update.txt
+# RUN: FileCheck %s --check-prefix=CHECK-UPDATEMACHINE < %t.tmp/submit_compile_machine_update.txt
 #
 # CHECK-UPDATEMACHINE: Imported Data
 # CHECK-UPDATEMACHINE: -------------




More information about the llvm-commits mailing list