Skip to content

Refactor tests/benchmarks to be expanded at configure time #3599

Open

Description

@ezyang

Presently, a test is expanded into a, e.g., library and executable, immediately before we build it. This is dumb. Let's expand it at configure-time. Then "building" a test suite and benchmark is a no-op, and these only matter when you run the subcommand in question.

I need this change so because the rewrite of depLibraryPaths in #3595 requires the component graph to make sense for any CLBI we pass it.

-    let -- TODO: this is kind of inefficient
-        internalDeps = [ cid
-                       | (cid, _) <- componentPackageDeps clbi
-                       -- Test that it's internal
-                       , (sub_clbi, _) <- componentsConfigs lbi
-                       , componentUnitId sub_clbi == cid ]
-        internalLibs = [ getLibDir sub_clbi
-                       | sub_clbi <- componentsInBuildOrder'
-                                        lbi internalDeps ]
+    let internalCLBIs = filter ((/= componentUnitId clbi) . componentUnitId)
+                      . map targetCLBI
+                      $ neededTargetsInBuildOrder lbi [componentUnitId clbi]
+        internalLibs = map getLibDir internalCLBIs

Activity

  1. ezyang commented on Jul 22, 2016

    @ezyang
    ContributorAuthor

    CC @ttuegel who wants to add test 2.0 #3578

  2. ttuegel commented on Jul 22, 2016

    @ttuegel
    Member

    👍 Sounds good!

  3. ezyang commented on Jul 24, 2016

    @ezyang
    ContributorAuthor

    This will be a little more difficult than I actually thought, because in general the test suite elaborates to an executable with the same component name. Since the "test suite" proper has no build content, this is OK, but it might break some invariants.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions