Cannot run tests in an Xcode project that imports a different structure

I am trying to write an open source application to show how you can write client + server code in Swift. The source code is here: https://github.com/haaakon/QuizWorld (QW short message)

The application uses the infrastructure located here: https://github.com/haaakon/QuizWorld-API (QWAPI) to access the API. I imported QWAAPI as a project into a QW application, it works fine in the simulator, but when running tests it does not compile due to this error:

Undefined symbols for architecture x86_64:
"QuizWorld.QuestionViewModel.__allocating_init () -> QuizWorld.QuestionViewModel", referenced from

This is only one line of code in the test:

let a = QuestionViewModel()

This means that the test object does not import the imported module correctly. Import:

@testable import QuizWorld
@testable import QuizWorldAPI

import Prelude
import ReactiveSwift
import ReactiveExtensions
import Result

, Frameworks, API Framework, , , . QW-Tests . , ? , .

+4
1

Test Host Bundle loader. ( , ), . , , " " .

:

Test Host: $(BUILT_PRODUCTS_DIR)/QuizWorld.app/QuizWorld
Bundle Loader: $(TEST_HOST)

:

, . Undefined , , , .

, .

UPD: " " , .

UPD2: . , , QWAPI, . " ", , .

+5

Source: https://habr.com/ru/post/1668275/


All Articles