[LNT] r258051 - [test-suite-cmake] Add very basic testing for the CMake LNT driver

James Molloy via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 18 07:54:27 PST 2016


Author: jamesm
Date: Mon Jan 18 09:54:27 2016
New Revision: 258051

URL: http://llvm.org/viewvc/llvm-project?rev=258051&view=rev
Log:
[test-suite-cmake] Add very basic testing for the CMake LNT driver

This adds the input files for a fake CMake test-suite and a sanity test.

Added:
    lnt/trunk/tests/runtest/Inputs/test-suite-cmake/
    lnt/trunk/tests/runtest/Inputs/test-suite-cmake/CMakeLists.txt
    lnt/trunk/tests/runtest/Inputs/test-suite-cmake/README.txt
    lnt/trunk/tests/runtest/Inputs/test-suite-cmake/fake-cmake   (with props)
    lnt/trunk/tests/runtest/Inputs/test-suite-cmake/fake-lit   (with props)
    lnt/trunk/tests/runtest/Inputs/test-suite-cmake/fake-make   (with props)
    lnt/trunk/tests/runtest/Inputs/test-suite-cmake/fake-results.json
    lnt/trunk/tests/runtest/Inputs/test-suite-cmake/fake-test
    lnt/trunk/tests/runtest/test_suite.py

Added: lnt/trunk/tests/runtest/Inputs/test-suite-cmake/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/tests/runtest/Inputs/test-suite-cmake/CMakeLists.txt?rev=258051&view=auto
==============================================================================
--- lnt/trunk/tests/runtest/Inputs/test-suite-cmake/CMakeLists.txt (added)
+++ lnt/trunk/tests/runtest/Inputs/test-suite-cmake/CMakeLists.txt Mon Jan 18 09:54:27 2016
@@ -0,0 +1 @@
+I am a dummy file.

Added: lnt/trunk/tests/runtest/Inputs/test-suite-cmake/README.txt
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/tests/runtest/Inputs/test-suite-cmake/README.txt?rev=258051&view=auto
==============================================================================
--- lnt/trunk/tests/runtest/Inputs/test-suite-cmake/README.txt (added)
+++ lnt/trunk/tests/runtest/Inputs/test-suite-cmake/README.txt Mon Jan 18 09:54:27 2016
@@ -0,0 +1,2 @@
+This is a dummy set of LLVM test-suite sources, just intended for use with
+testing the 'lnt runtest test-suite' module.

Added: lnt/trunk/tests/runtest/Inputs/test-suite-cmake/fake-cmake
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/tests/runtest/Inputs/test-suite-cmake/fake-cmake?rev=258051&view=auto
==============================================================================
--- lnt/trunk/tests/runtest/Inputs/test-suite-cmake/fake-cmake (added)
+++ lnt/trunk/tests/runtest/Inputs/test-suite-cmake/fake-cmake Mon Jan 18 09:54:27 2016
@@ -0,0 +1,8 @@
+#!/bin/bash
+
+if [[ ! -f $1/CMakeLists.txt ]]; then
+  exit 1
+else
+  cp $1/fake-test $1/fake-results.json .
+  exit 0
+fi

Propchange: lnt/trunk/tests/runtest/Inputs/test-suite-cmake/fake-cmake
------------------------------------------------------------------------------
    svn:executable = *

Added: lnt/trunk/tests/runtest/Inputs/test-suite-cmake/fake-lit
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/tests/runtest/Inputs/test-suite-cmake/fake-lit?rev=258051&view=auto
==============================================================================
--- lnt/trunk/tests/runtest/Inputs/test-suite-cmake/fake-lit (added)
+++ lnt/trunk/tests/runtest/Inputs/test-suite-cmake/fake-lit Mon Jan 18 09:54:27 2016
@@ -0,0 +1,10 @@
+#!/usr/bin/python
+
+import argparse, shutil
+parser = argparse.ArgumentParser(description='dummy lit')
+parser.add_argument('-o')
+parser.add_argument('-j', type=int)
+parser.add_argument('bar')
+args, _ = parser.parse_known_args()
+
+shutil.copyfile(args.bar + '/fake-results.json', args.o)

Propchange: lnt/trunk/tests/runtest/Inputs/test-suite-cmake/fake-lit
------------------------------------------------------------------------------
    svn:executable = *

Added: lnt/trunk/tests/runtest/Inputs/test-suite-cmake/fake-make
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/tests/runtest/Inputs/test-suite-cmake/fake-make?rev=258051&view=auto
==============================================================================
--- lnt/trunk/tests/runtest/Inputs/test-suite-cmake/fake-make (added)
+++ lnt/trunk/tests/runtest/Inputs/test-suite-cmake/fake-make Mon Jan 18 09:54:27 2016
@@ -0,0 +1,3 @@
+#!/bin/bash
+cp fake-test fake-test.test
+exit 0
\ No newline at end of file

Propchange: lnt/trunk/tests/runtest/Inputs/test-suite-cmake/fake-make
------------------------------------------------------------------------------
    svn:executable = *

Added: lnt/trunk/tests/runtest/Inputs/test-suite-cmake/fake-results.json
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/tests/runtest/Inputs/test-suite-cmake/fake-results.json?rev=258051&view=auto
==============================================================================
--- lnt/trunk/tests/runtest/Inputs/test-suite-cmake/fake-results.json (added)
+++ lnt/trunk/tests/runtest/Inputs/test-suite-cmake/fake-results.json Mon Jan 18 09:54:27 2016
@@ -0,0 +1,11 @@
+{
+    "tests": [
+        {
+            "name": "test-suite :: foo",
+            "code": "PASS",
+            "metrics": {
+                "compile_time": 1.3
+            }
+        }
+    ]
+}

Added: lnt/trunk/tests/runtest/Inputs/test-suite-cmake/fake-test
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/tests/runtest/Inputs/test-suite-cmake/fake-test?rev=258051&view=auto
==============================================================================
--- lnt/trunk/tests/runtest/Inputs/test-suite-cmake/fake-test (added)
+++ lnt/trunk/tests/runtest/Inputs/test-suite-cmake/fake-test Mon Jan 18 09:54:27 2016
@@ -0,0 +1 @@
+RUN: I am a fake LIT test file!
\ No newline at end of file

Added: lnt/trunk/tests/runtest/test_suite.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/tests/runtest/test_suite.py?rev=258051&view=auto
==============================================================================
--- lnt/trunk/tests/runtest/test_suite.py (added)
+++ lnt/trunk/tests/runtest/test_suite.py Mon Jan 18 09:54:27 2016
@@ -0,0 +1,28 @@
+# Testing for the 'lnt runtest test-suite' module.
+#
+# Check a basic nt run.
+# RUN: lnt runtest test-suite \
+# RUN:     --sandbox %t.SANDBOX \
+# RUN:     --no-timestamp \
+# RUN:     --test-suite %S/Inputs/test-suite-cmake \
+# RUN:     --cc %{shared_inputs}/FakeCompilers/clang-r154331 \
+# RUN:     --use-cmake %S/Inputs/test-suite-cmake/fake-cmake \
+# RUN:     --use-make %S/Inputs/test-suite-cmake/fake-make \
+# RUN:     --use-lit %S/Inputs/test-suite-cmake/fake-lit \
+# RUN:     > %t.log 2> %t.err
+# RUN: FileCheck  --check-prefix CHECK-STDOUT < %t.log %s
+# RUN: FileCheck  --check-prefix CHECK-BASIC < %t.err %s
+# RUN: FileCheck  --check-prefix CHECK-REPORT < %t.SANDBOX/build/report.json %s
+
+# CHECK-REPORT: "run_order": "154331"
+# CHECK-REPORT: "Name": "nts.{{[^.]+}}.compile"
+# CHECK-REPORT: "Name": "nts.{{[^.]+}}.compile.status"
+#
+# CHECK-STDOUT: Import succeeded.
+# CHECK-STDOUT: Added Machines: 1
+# CHECK-STDOUT: Added Runs    : 1
+# CHECK-STDOUT: Added Tests   : 1
+#
+# CHECK-BASIC: inferred C++ compiler under test
+# CHECK-BASIC: submitting result to dummy instance
+# CHECK-BASIC: Successfully created db_None/v4/nts/1




More information about the llvm-commits mailing list