Reverts the "installed tests" feature. (#6695)

* Reverts the "installed tests" feature.

* It was never fully utilized and has enough issues to call for a rethink.
* Reverts commits (with some manual fixups):
  * 9427ed633e3dd24095eb4c85423a41eae91b669e.
  * 2b235dc85f27e99103cd35911264ce38ac2d5767.
* Run lit tests in the current binary dir, like C++ tests.
diff --git a/build_tools/cmake/iree_lit_test.cmake b/build_tools/cmake/iree_lit_test.cmake
index 9f54ec9..e898800 100644
--- a/build_tools/cmake/iree_lit_test.cmake
+++ b/build_tools/cmake/iree_lit_test.cmake
@@ -5,7 +5,6 @@
 # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 
 include(CMakeParseArguments)
-include(iree_installed_test)
 
 # iree_lit_test()
 #
@@ -61,11 +60,9 @@
   iree_package_ns(_PACKAGE_NS)
   string(REPLACE "::" "/" _PACKAGE_PATH ${_PACKAGE_NS})
   set(_NAME_PATH "${_PACKAGE_PATH}/${_RULE_NAME}")
-  list(APPEND _RULE_LABELS "${_PACKAGE_PATH}")
-
-  iree_add_installed_test(
-    TEST_NAME "${_NAME_PATH}"
-    LABELS "${_RULE_LABELS}"
+  add_test(
+    NAME
+      ${_NAME_PATH}
     COMMAND
       # We run all our tests through a custom test runner to allow setup
       # and teardown.
@@ -73,18 +70,16 @@
       "${CMAKE_SOURCE_DIR}/iree/tools/run_lit.${IREE_HOST_SCRIPT_EXT}"
       ${_TEST_FILE_PATH}
       ${_DATA_DEP_PATHS}
-    INSTALLED_COMMAND
-      # TODO: Make the lit runner be not a shell script and more cross-platform.
-      # Note that the data deps are not bundled: must be externally on the path.
-      bin/run_lit.${IREE_HOST_SCRIPT_EXT}
-      ${_TEST_FILE_PATH}
+    WORKING_DIRECTORY
+      "${CMAKE_CURRENT_BINARY_DIR}"
   )
-  set_property(TEST ${_NAME_PATH} PROPERTY REQUIRED_FILES "${_TEST_FILE_PATH}")
 
-  install(FILES ${_TEST_FILE_PATH}
-    DESTINATION "tests/${_PACKAGE_PATH}"
-    COMPONENT Tests
-  )
+  list(APPEND _RULE_LABELS "${_PACKAGE_PATH}")
+  set_property(TEST ${_NAME_PATH} PROPERTY LABELS "${_RULE_LABELS}")
+  set_property(TEST ${_NAME_PATH} PROPERTY REQUIRED_FILES "${_TEST_FILE_PATH}")
+  set_property(TEST ${_NAME_PATH} PROPERTY ENVIRONMENT "TEST_TMPDIR=${_NAME}_test_tmpdir")
+  iree_add_test_environment_properties(${_NAME_PATH})
+
   # TODO(gcmn): Figure out how to indicate a dependency on _RULE_DATA being built
 endfunction()