Skip to content

Commit

Permalink
Merge pull request #3 from gnustep/gsxctestrunner-linking
Browse files Browse the repository at this point in the history
Move GSXCTestRunner into XCTest and add README
  • Loading branch information
hmelder authored Dec 23, 2023
2 parents 14045ac + 93daa69 commit 958397b
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 6 deletions.
3 changes: 1 addition & 2 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ PACKAGE_NAME = xctest
TOOL_NAME = xctest
SUBPROJECTS = XCTest

xctest_HEADER_FILES = GSXCTestRunner.h
xctest_OBJC_FILES = main.m GSXCTestRunner.m
xctest_OBJC_FILES = main.m
ADDITIONAL_TOOL_LIBS = -lXCTest
ADDITIONAL_LIB_DIRS = -L./XCTest/obj

Expand Down
46 changes: 45 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,47 @@
# tools-xctest

The license for some of these files is in the header. For those that are not explicitly licensed, they are under the LGPL. Please see COPYING.LIB for information.
`tools-xctest` is a testing framework for Objective-C, providing functionalities identical to Apple's XCTest. It is designed for use with the GNUstep development environment. This framework allows developers to write and run unit tests for their Objective-C code in a way that is familiar to those accustomed to XCTest in Apple's ecosystem.

## Requirements
- GNUstep Base
- GNUstep Make

## Installation
1. Ensure GNUstep Base and GNUstep Make are installed on your system.
2. Clone the `tools-xctest` repository from GitHub.
3. Navigate to the cloned directory.
4. Run `make` to build the project.
5. Run `make install` to install `tools-xctest` on your system.

## Usage
To use `tools-xctest`, include the header files in your test classes and link against the `tools-xctest` library. The usage is similar to Apple's XCTest:

```objc
#import <XCTest/XCTest.h>

@interface MyTestCase : XCTestCase
@end

@implementation MyTestCase

- (void)testExample {
XCTAssertEqual(1 + 1, 2, @"Basic arithmetic doesn't seem to work!");
}

@end
```
You will need to compile the test cases into one or more bundles, as `xctest` expects `.bundle`'s.
## Running Tests
Tests can be run using the command line tool provided by `tools-xctest`. This can be done by navigating to the directory containing your test cases and executing:
```bash
xctest [path to your test case bundle]
```

## License
`tools-xctest` is licensed under LGPL-2.1. Please refer to the COPYING.LIB file for detailed information. For files not explicitly licensed, they fall under the same LGPL.

## Contributions
Contributions to `tools-xctest` are welcome. Please submit pull requests or issues through the GitHub repository.
2 changes: 1 addition & 1 deletion XCTest/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ PACKAGE_NAME = XCTest

LIBRARY_NAME = XCTest
XCTest_HEADER_FILES = XCTest.h XCTestAssertions.h XCTestAssertionsImpl.h XCTestCase.h
XCTest_OBJC_FILES = XCTestAssertions.m XCTestCase.m
XCTest_OBJC_FILES = XCTestAssertions.m XCTestCase.m GSXCTestRunner.m
XCTest_INCLUDE_DIRS = -I../

-include GNUmakefile.preamble
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion GSXCTestRunner.m → XCTest/GSXCTestRunner.m
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
*/


#import <GSXCTestRunner.h>
#import <XCTest/GSXCTestRunner.h>
#import <XCTest/XCTestCase.h>

#import <objc/runtime.h>
Expand Down
2 changes: 1 addition & 1 deletion main.m
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
*/

#import <Foundation/Foundation.h>
#import "GSXCTestRunner.h"
#import <XCTest/GSXCTestRunner.h>

int main(int argc, char *argv[]) {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
Expand Down

0 comments on commit 958397b

Please sign in to comment.